This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Exception handling unclear
- From: Martin Vechev <martin at fadata dot bg>
- To: java at gcc dot gnu dot org
- Date: Thu, 12 Sep 2002 19:14:59 +0300
- Subject: Exception handling unclear
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.