JavaExceptionTableEntry.st
author Claus Gittinger <cg@exept.de>
Thu, 22 Dec 2005 18:00:03 +0100
changeset 2125 cfa7b540ebf1
parent 2108 ca8c4e7db2e8
child 2151 c0b6570c6f9b
permissions -rw-r--r--
*** empty log message ***

"
 COPYRIGHT (c) 1997 by eXept Software AG
              All Rights Reserved

 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.
"



"{ Package: 'stx:libjava' }"

Object subclass:#JavaExceptionTableEntry
	instanceVariableNames:'startPC endPC handlerPC catchType'
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Java-Support'
!

!JavaExceptionTableEntry class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1997 by eXept Software AG
              All Rights Reserved

 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.
"


! !

!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"
! !

!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|

    (pc between:startPC and:endPC) ifTrue:[
        (catchType == 0) ifTrue:[^ handlerPC].
        (catchType isNil) ifTrue:[^ handlerPC].
        cls := aMethod javaClass.
        catchType isUnresolved ifTrue:[
            catchType := catchType preResolve.
        ].
        (catchType isKindOf:JavaClass) ifFalse:[
            self halt.
            ^ nil
        ].
        (exception isKindOf:catchType) ifTrue:[
            ^ handlerPC
        ].
        ^ nil
    ].
    ^ nil

    "Modified: / 7.1.1998 / 15:30:14 / cg"
!

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
    ^ '$Header: /cvs/stx/stx/libjava/JavaExceptionTableEntry.st,v 1.15 2002-11-22 20:12:59 cg Exp $'
! !