JDK-4148751 : URL.sameFile return false on URL's, that are equal modulo url-encoding
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.2.0,1.4.2,5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_2.5.1
  • CPU: generic,sparc
  • Submitted: 1998-06-15
  • Updated: 2017-05-16
  • Resolved: 2004-09-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Related Reports
Duplicate :  
Description
Name: yyC67448			Date: 06/15/98




The java.net.URL.sameFile method return false on URLs, that are equal modulo 
url encoding.

Here is the simple test demonstrating the bug:

-------------------------------- Test.java -----------------------------
import java.net.*;

class test
{

  public static void main(String args[])
  {
  URL url = null;
  URL url1 = null;
  
  try {
    url = new URL("http://web2.javasoft.com/some+file.html");
    url1 = new URL("http://web2.javasoft.com/some%20file.html");
  } catch(Exception e)
  {
    System.out.println("Unexpected exception :" + e);
    System.exit(-1);
  }

  if(url.sameFile(url1))
  {
    System.out.println("OKAY");
    System.exit(0);
  }
  else
  {
    System.out.println("Failed. ");
    System.exit(-1);
  }
}

}

----------------------  Output from the test --------------------
Failed.
-----------------------------------------------------------------

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b24 VERIFIED IN: 1.5.0_01
2004-09-22

EVALUATION See comments.
2004-09-22