#REFACTORING by exept cvs_MAIN
authorClaus Gittinger <cg@exept.de>
Fri, 04 Oct 2019 11:41:15 +0200
branchcvs_MAIN
changeset 3968 a2f749d76588
parent 3967 5b3d710b1e01
child 3969 6f67acece18c
#REFACTORING by exept class: JavaVM class changed: #throwException:
JavaVM.st
--- a/JavaVM.st	Sat Sep 28 15:39:26 2019 +0200
+++ b/JavaVM.st	Fri Oct 04 11:41:15 2019 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1996-2015 by Claus Gittinger
 
@@ -3560,9 +3558,10 @@
 
 throwException: aJavaException
     <resource: #skipInDebuggersWalkBack>
-    | con  jMsg  msg  exClass  srchCon  handlerContext  handlerPC  method  pc  hPC handler |
+
+    |con jMsg msg exClass srchCon handlerContext handlerPC method pc hPC handler tmpMessage|
+
     ExceptionTrace ifTrue: [
-        | tmpMessage |
         tmpMessage := aJavaException instVarNamed: 'detailMessage'.
         tmpMessage isNil ifTrue: [ tmpMessage := '' ] ifFalse: [
             tmpMessage := Java as_ST_String: tmpMessage
@@ -3576,21 +3575,18 @@
     ExceptionDebug ifTrue: [
         "/        self internalError:('JAVA: exception: ' , aJavaException class fullName).
         (ExceptionDebugPatterns isEmptyOrNil
-            or: [
-                ExceptionDebugPatterns
-                    anySatisfy: [:pattern | pattern match: aJavaException class binaryName ]
-            ])
-                ifTrue: [
-                    ObjectMemory debugBreakPoint3.
-                    self halt: ('JAVA: exceptionDebug: ' , aJavaException class binaryName )
-                ]
+        or: [
+            ExceptionDebugPatterns
+                anySatisfy: [:pattern | pattern match: aJavaException class binaryName ]
+        ]) ifTrue: [
+            ObjectMemory debugBreakPoint3.
+            self halt: ('JAVA: exceptionDebug: ' , aJavaException class binaryName )
+        ]
     ].
 
     "/
     "/ search stack for a javaContext which handles that exception
     "/
-
-
     srchCon := thisContext.
     [ handlerContext isNil and: [ srchCon notNil ] ] whileTrue: [
         srchCon := srchCon findSpecialHandle:true raise:false.
@@ -3622,6 +3618,8 @@
         "/ no JavaHandler ... let smalltalk handle it
         "/
         exClass := aJavaException class.
+        msg := 'Java ' , exClass binaryName.
+
         (exClass binaryName == #'java/lang/ThreadDeath') ifTrue: [
             JavaUnhandledThreadDeathError
                 raiseWith: aJavaException
@@ -3629,7 +3627,6 @@
                 in: thisContext sender.
             ^ self.
         ].
-        msg := 'Java ' , exClass binaryName.
         jMsg := aJavaException instVarNamed: 'detailMessage'.
         jMsg notNil ifTrue: [ msg := msg , ': ' , (Java as_ST_String: jMsg). ].