Wicket
  1. Wicket
  2. WICKET-5054

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.6.0, 1.5.10
    • Fix Version/s: 6.7.0, 1.5.11
    • Component/s: wicket
    • Labels:
      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".

        Activity

        Hide
        Christophe Levesque added a comment -

        Note that building an absolute path from package "com.foo.bar" with relative path "foo/baz/qux" works as expected.

        Show
        Christophe Levesque added a comment - Note that building an absolute path from package "com.foo.bar" with relative path "foo/baz/qux" works as expected.
        Hide
        Sven Meier added a comment -

        partially reverted 78052bf for Packages#absolutePath(), adjusted IPackageResourceGuard

        Show
        Sven Meier added a comment - partially reverted 78052bf for Packages#absolutePath(), adjusted IPackageResourceGuard
        Hide
        Christophe Levesque added a comment -

        Thanks!

        Show
        Christophe Levesque added a comment - Thanks!
        Hide
        Tomek Szpinda added a comment -

        This is still a bug, occurs ie in wicketstuff CometdPushBehavior. The javascript files are in: org.wicketstuff.push.cometd.org and CometdPushBehavior tries to use:

        	private static final ResourceReference COMETD = new PackageResourceReference(CometdPushBehavior.class, "org/cometd.js");
        

        where CometdPushBehavior is in:

         
        org.wicketstuff.push.cometd
        
        Show
        Tomek Szpinda added a comment - This is still a bug, occurs ie in wicketstuff CometdPushBehavior. The javascript files are in: org.wicketstuff.push.cometd.org and CometdPushBehavior tries to use: private static final ResourceReference COMETD = new PackageResourceReference(CometdPushBehavior.class, "org/cometd.js" ); where CometdPushBehavior is in: org.wicketstuff.push.cometd
        Hide
        Martin Grigorov added a comment -

        Tomek,

        Please create a new ticket with a test case/quickstart app.
        Thanks!

        Show
        Martin Grigorov added a comment - Tomek, Please create a new ticket with a test case/quickstart app. Thanks!

          People

          • Assignee:
            Sven Meier
            Reporter:
            Christophe Levesque
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development