"
COPYRIGHT (c) 1996-2011 by Claus Gittinger
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
SWING Research Group, Czech Technical University in Prague
Parts of the code written by Claus Gittinger are under following
license:
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the 'Software'), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
[1] Code written at SWING Research Group contain a signature
of one of the above copright owners.
"
"{ Package: 'stx:libjava' }"
Object subclass:#JavaExceptionTableEntry
instanceVariableNames:'startPC endPC handlerPC catchType'
classVariableNames:''
poolDictionaries:''
category:'Languages-Java-Support'
!
!JavaExceptionTableEntry class methodsFor:'documentation'!
copyright
"
COPYRIGHT (c) 1996-2011 by Claus Gittinger
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
SWING Research Group, Czech Technical University in Prague
Parts of the code written by Claus Gittinger are under following
license:
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
Parts of the code written at SWING Reasearch Group [1] are MIT licensed:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the 'Software'), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
[1] Code written at SWING Research Group contain a signature
of one of the above copright owners.
"
! !
!JavaExceptionTableEntry class methodsFor:'instance creation'!
startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type
^ self new startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type
"Created: 16.4.1996 / 12:11:13 / cg"
! !
!JavaExceptionTableEntry methodsFor:'accessing'!
catchType
"return the value of the instance variable 'catchType' (automatically generated)"
^ catchType
"Created: 7.2.1997 / 21:01:23 / cg"
!
endPC
"return the value of the instance variable 'endPC' (automatically generated)"
^ endPC
"Created: 7.2.1997 / 20:53:23 / cg"
!
handlerPC
"return the value of the instance variable 'handlerPC' (automatically generated)"
^ handlerPC
"Created: 7.2.1997 / 20:06:31 / cg"
!
startPC
"return the value of the instance variable 'startPC' (automatically generated)"
^ startPC
"Created: 7.2.1997 / 20:53:20 / cg"
! !
!JavaExceptionTableEntry methodsFor:'printing & storing'!
displayString
^ super displayString , '(' , catchType displayString,
' in ' , startPC printString , '..' ,
endPC printString , '->' ,
handlerPC printString , ')'
"Modified: 15.8.1997 / 03:33:51 / cg"
!
printOn: aStream
super printOn: aStream.
aStream nextPut:$(.
catchType printOn: aStream.
aStream nextPutAll:' in ' , startPC printString , '..' ,
endPC printString , '->' ,
handlerPC printString , ')'
"Modified: / 15-08-1997 / 03:33:51 / cg"
"Created: / 25-02-2011 / 09:08:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!JavaExceptionTableEntry methodsFor:'private accessing'!
handlerPCFor:exception at:pc in:aMethod
"if there is a handler for exceptionClass, with given pc,
return the handler-PC; otherwise, return nil."
|cls|
"JV+MH@2011-02-25: You may wonder why there is endPC - 1:
The Java VM Spec, 3rd edition, sec 4.7.3, page 78:
The fact that end_pc is exclusive is a historical mistake in the design of the
Java virtual machine: if the Java virtual machine code for a method is exactly
65535 bytes long and ends with an instruction that is 1 byte long, then that
instruction cannot be protected by an exception handler. A compiler writer can
work around this bug by limiting the maximum size of the generated Java
virtual machine code for any method, instance initialization method, or static
initializer (the size of any code array) to 65534 bytes.
"
(pc between:startPC and:endPC - 1) ifTrue:[
(catchType == 0) ifTrue:[^ handlerPC].
(catchType isNil) ifTrue:[^ handlerPC].
cls := aMethod javaClass.
catchType := catchType javaClass.
(catchType isKindOf:JavaClass) ifFalse:[
self halt.
^ nil
].
(exception isKindOf:catchType) ifTrue:[
^ handlerPC
].
^ nil
].
^ nil
"Modified: / 07-01-1998 / 15:30:14 / cg"
"Modified: / 31-05-2011 / 09:53:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
startPC:start_pc endPC:end_pc handlerPC:handler_pc catchType:catch_type
startPC := start_pc.
endPC := end_pc.
handlerPC := handler_pc.
catchType := catch_type
"Created: 16.4.1996 / 12:11:45 / cg"
! !
!JavaExceptionTableEntry class methodsFor:'documentation'!
version
^ '$Id: JavaExceptionTableEntry.st,v 1.16 2011-08-18 18:42:48 vrany Exp $'
!
version_SVN
^ '$Id: JavaExceptionTableEntry.st,v 1.16 2011-08-18 18:42:48 vrany Exp $'
! !