This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Untimed resolve ?


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]