a return of 1 would provide a message containing
(OutOfMemoryError or StackOverflow)
a return of 2 would provide a generic message
such as Unexpected exception...
Now 1 would give just a generic internal error but it
would be with a message such as:
FATAL ERROR in native method: JNI method
CallIntMethod : internal error from
StackTraceController.cpp : 48
at
nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
Method)
at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)
at
nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
Method)
at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)
at
nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
Method)
at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)
at
nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
Method)
at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)
at
nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
Method)
at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)
at
nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
Method)
at
nsk.monitoring.stress.thread.RunningThread.recursionJava(strace001.java:343)
at
nsk.monitoring.stress.thread.RunningThread.recursionNative(Native
Method)
....
and you would guess it is either an OOM or a stack
overflow. And 2 actually now gives you which method
failed. So it's a win for the 2 case, for the 1 there is
an extra step that, for me, seemed relatively straight
forward.
I can change the code slightly for the 1 case to make
the error message more specific and closer to the
original but I was not sure it was worth it.... What do
you all think?