Exception handling unclear

Martin Vechev martin@fadata.bg
Thu Sep 12 09:14:00 GMT 2002


Exception handling is discussed in VMSpecs, but there is no discussion
what happens when error/exception of exception/error happens, when circular
exceptions happen. I guess the VM must detect this. I've tried this with 
Sun's VM
and it clearly does not handle even the simplest of such complications, 
basically
unpredictable behavior. This are fatal errors for sure, same with OutOfMemory
on a non-GC collected memory. (Clearly cannot create instance when there is no
memory). So there is a set of errors that are fatal. There is info what 
should happen
then. I think there should be a whole chapter by itself on this, what they 
are and
what to do when they happen. An Example would be to try to load a class, 
which is
not there - > ClassNotFound, but ClassNotFound has ClassFormatError, and 
ClassFormatError
is also not found ->ClassNotFound, etc...
Also, could a user program return with a fatal error to a native method ? 
When the
user wants to see if ExceptionOccured, then there is no reall instance of 
that exception/error.
And it will return no exception/error.
I guess implications then are that the thread must perform proper cleanup 
(ex:release monitors).
Anyway, its interesting to see what you guys think about this issues.
Martin.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /