-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.4.0
-
sparc
-
solaris_8
J2SE API Document read:
IllegalAccessException -
if the class or its nullary constructor is not accessible.
InstantiationException -
if this Class represents an abstract class, an interface, an array class,
a primitive type, or void; or if the class has no nullary constructor;
or if the instantiation fails for some other reason.
Following simple test throw InstantiationException in ladybird.
bug throw IllegalAccessException in merlin.
abstract class Y
{
private Y() { }
}
class test1
{
test1() { }
public static void main( String argv[] )
{
Y oy;
try {
oy = (Y) Class.forName("Y").newInstance();
} catch (Exception e) {
System.out.println (e);
}
}
}
$ /import/java/jdk1.3.1/solsparc/bin/java test1
java.lang.InstantiationException: Y
$ /import/java/jdk1.4/solsparc/bin/java test1
java.lang.IllegalAccessException: Class test1 can not access a member of class Y with modifiers "private"