This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Untimed resolve ?
- From: Martin Vechev <martin at fadata dot bg>
- To: java at gcc dot gnu dot org
- Date: Fri, 27 Dec 2002 19:39:03 +0200
- Subject: 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.