United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4148751 : URL.sameFile return false on URL's, that are equal modulo url-encoding

Details
Type:
Bug
Submit Date:
1998-06-15
Status:
Resolved
Updated Date:
2004-09-20
Project Name:
JDK
Resolved Date:
2004-09-20
Component:
core-libs
OS:
solaris_2.5.1,generic
Sub-Component:
java.net
CPU:
sparc,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.2.0,1.4.2,5.0
Fixed Versions:
5.0 (tiger)

Related Reports
Duplicate:

Sub Tasks

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
EVALUATION

See comments.
                                     
2004-09-22
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



Hardware and Software, Engineered to Work Together