Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
jtsk_2.1
-
None
Description
According to the specification of net.jini.url.httpmd.Handler the message digest may contain the ',' (comma) character, however the parsing logic in net.jini.url.httpmd.Handler.sameFile(URL, URL) assumes the first comma in the parameter part to be the start of the comment. As a consequence the following piece of code (requires the installation of a security provider with support for the non existing message digest algorithms MD5,0 and MD5,10) yields the wrong result:
URL url1 = new URL("httpmd://localhost:80/;md5,0=7be207c7111e459eeea1c9b3d04f1667,.jar"); URL url2 = new URL("HTTPMD://localhost/;md5,10=7be207c7111e459eeea1c9b3d04f1667"); System.out.println("equals: " + url1.equals(url2));
The output is "true" while it is of course obvious that the output should be "false" here.