-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
1.3
-
x86
-
linux
-
Verified
Name: dkC103137 Date: 09/15/2000
The test libs_api_tests/common_2/java_rmi/server/RMIClassLoader/loadClass_2Tests case Test03 from
testbase_ss is invalid for testing since JDK1.2. The testcase Test03 wrongly expects
MalformedURLException for loadClass invocation with null URL codebase parameter:
------------------------------------------------------------------------------------------
try {
URL codeBase = null;
Class cName = RMIClassLoader.loadClass(codeBase, sName);
System.out.println("class: " + cName);
} catch (Exception e) {
exceptionThrown = true;
if ( e instanceof MalformedURLException ) {
bReturn = true;
System.out.println("Test 3 Passed");
System.out.println ("Expected MalformedURLException thrown");
} else {
bReturn = false;
System.out.println("Test 3 Failed");
System.out.println ("Exception thrown, but not the expected MalformedURLException");
}
e.printStackTrace();
}
------------------------------------------------------------------------------------------
But Java2 SE v1.3 API Spec reads:
------------------------------------------------------------------------------------------
public static Class loadClass(URL codebase, String name)
throws MalformedURLException,
ClassNotFoundException
Loads a class from a codebase URL. If the given codebase is null, then the Class object returned is
equivalent to the Class object returned by RMIClassLoader.loadClass(name).
Parameters:
codebase - the URL to load the class from
name - the name of the class to load
Returns:
the Class object representing the loaded class
Throws:
MalformedURLException - if the codebase paramater contains an invalid non-null URL
ClassNotFoundException - if a definition for the class could not be found at the specified URL
------------------------------------------------------------------------------------------
======================================================================
- relates to
-
JDK-4221945 clarify javadoc: RMIClassLoader.loadClass(null, String) no MalformedURLException
-
- Resolved
-