1. Wicket
  2. WICKET-4443

AbstractClassResolver recreates URL incorrectly



      AbstractClassResolver converts java.net.URLs to their external form (java.lang.String), then converts them back to java.net.URLs. It looks like the conversion to external form is for comparison between URLs (comparing URLs is slow, Strings not so - see WICKET-3867), because we only want one result per URL (Set<URL>).

      The problem is that, when converting from the external form back to a java.net.URL, the no context URL is given to the URL constructor, just the external form String is given. Passing a context URL to the java.net.URL constructor is the only way of setting the URLStreamHandler related to the URL. So, if you have some exotic URL schema, like I do, using protocols the standard Java libraries dont know about, you can no longer load your resources.

      Please see the code in CompoundClassResolver#getResources() - it implements a unique list of URL by comparing the external forms of the URLs, while still managing to use the original URL objects, with their URLStreamHandlers attached.


        Jesse Long created issue -
        Jesse Long made changes -
        Field Original Value New Value
        Attachment WICKET-4443.patch [ 12517510 ]
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 1.5.6 [ 12319053 ]
        Fix Version/s 6.0.0 [ 12315431 ]
        Resolution Fixed [ 1 ]
        Martin Grigorov made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Martin Grigorov made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]


          • Assignee:
            Martin Grigorov
            Jesse Long
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: