JavaExceptionTableEntry.st
author cg
Mon, 16 Nov 1998 15:17:54 +0000
changeset 454 38f590639d65
parent 264 44aedfcd08d1
child 713 75e92ac63bf1
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.
"



Object subclass:#JavaExceptionTableEntry
	instanceVariableNames:'startPC endPC handlerPC catchType'
	classVariableNames:''
	poolDictionaries:''
	category:'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: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaExceptionTableEntry.st,v 1.14 1998/11/16 15:13:15 cg Exp $'
! !