NoClassDefFoundError vs. ClassNotFoundException

Date view Thread view Subject view Author view

From: Godmar Back (gback@marker.cs.utah.edu)
Date: Tue Nov 17 1998 - 22:01:42 EST


 So, under what circumstances is NoClassDefFound and under what
circumstances is ClassNotFoundException thrown?

First of all, Kaffe so far only threw ClassNotFound, which is clearly
wrong.

The doc says that ClassNotFoundException is only thrown by
findSystemClass, loadClass, and Class.forName().

So, looking at Edouard's test case, where we do Class.forName("B")
for a subclass B of A after deleting A.class, one would expect a
ClassNotFoundException ... yet a NoClassDefFound:A is thrown by Sun's
JVM.

I'll try to make us as compatible as possible.
Btw, I'm passing Edouard's two test cases now.
For the translation test, Sun's JVM throws a NullPointerException, while
Kaffe now (IMO) correctly reports NoSuchFieldError.

        - Godmar


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:03 EDT