Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5054

Possible bug in org.apache.wicket.util.lang.Packages when building path with repeating names

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.6.0, 1.5.10
    • 6.7.0, 1.5.11
    • wicket
    • None

    Description

      When trying to build the absolute path from package "com.foo.bar" with relative path "baz/foo/qux" in method org.apache.wicket.util.lang.Packages.absolutePath(String, String) the block:

      				else if (absolutePath.size() <= i || absolutePath.get(i).equals(folder) == false)
      				{
      					// Add to stack
      					absolutePath.add(folder);
      				}
      

      doesn't run for the "foo" part of the relative path because absolutePath.get(1) == foo from the package == foo from the relative path.

      So the resulting absolute path is "com/foo/bar/baz/qux" rather than the expected "com/foo/bar/baz/foo/qux".

      Seems like the "else if" should just be a "else".

      Attachments

        Activity

          People

            svenmeier Sven Meier
            totof3110 Christophe Levesque
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: