# HG changeset patch # User Claus Gittinger # Date 1570182075 -7200 # Node ID a2f749d76588a473bb25ebe043482194dd0db66f # Parent 5b3d710b1e01a289f4eeb3be419aca1aff4b24b3 #REFACTORING by exept class: JavaVM class changed: #throwException: diff -r 5b3d710b1e01 -r a2f749d76588 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 - | 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). ].