Untimed resolve ?
Martin Vechev
martin@fadata.bg
Fri Dec 27 09:39:00 GMT 2002
In the code below, If X.class is removed after Testx.java is compiled, then
gij gives ClassNotFoundException.
class X extends Exception
{}
class Testx
{
public static void main(String args[])
{
System.out.println("loaded.");
new X();
}
}
At the end of loading the X class it also resolves it, which seems
incorrect. Shouldn't it rich the actual 'new' bytecode
and then throw NoClassDefFoundError. It is possible the user has a
try-catch around the 'new X()'. I understand there
could be early resolving, but I thought it is correct to look like it is
late, i.e. the exception must be thrown when
'new' bytecode is reached and the class must be loaded.
More information about the Java
mailing list