-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.1.5, 1.2.0
-
sparc
-
solaris_2.5
Name: yyC67448 Date: 02/23/98
The java.net.URLConnection.setFileNameMap(FileNameMap map) allows
null map parameter.
Method's behavior for null map parameter is not documented.
Here is the javadoc comments for methods setFileNameMap
/**
* Sets the FileNameMap.
*
* @param map the FileNameMap to be set
* @since JDK1.2
*/
Here is the test demonstrating the bug:
------------------------ Test.java ---------------------------------------
import java.net.*;
class test
{
public static void main(String args[])
{
FileNameMap map=null;
try {
URLConnection.setFileNameMap(map);
} catch(SecurityException e)
{
System.out.println("Passed. Correctly failed to setup test:" + e);
System.exit(0);
}
catch(NullPointerException e)
{
System.out.println("Passed. OKAY");
System.exit(0);
}
catch(Exception e)
{
System.out.println("Failed. Unexpected exception :" + e);
System.exit(-1);
}
System.out.println("Failed. No exceptions.");
}
}
------------------------- Output from the test ----------------------------
Failed. No exceptions.
---------------------------------------------------------------------------
======================================================================