Package com.ibm.wala.shrike.shrikeBT
Class ExceptionHandler
- java.lang.Object
-
- com.ibm.wala.shrike.shrikeBT.ExceptionHandler
-
public final class ExceptionHandler extends java.lang.ObjectAn ExceptionHandler represents a single handler covering a single instruction. It simply tells us what kind of exception to catch and where to dispatch the exception to.ExceptionHandlers are immutable. It is quite legal to save a reference to an exception handler and use it in any other context. We also treat arrays of ExceptionHandlers as immutable. Therefore the following code can be used to build an exception handler table that specifies two handlers covering an entire block of code:
ExceptionHandler[] hs = { new ExceptionHandler(110, "Ljava.lang.NullPointerException;"), new ExceptionHandler(220, "Ljava.io.IOException;"); }; for (int i = 0; i < 100; i++) { handlers[i] = hs; }
-
-
Constructor Summary
Constructors Constructor Description ExceptionHandler(int handler, java.lang.String catchClass)ExceptionHandler(int handler, java.lang.String catchClass, java.lang.Object catchClassLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(ExceptionHandler h)booleanequals(java.lang.Object o)java.lang.StringgetCatchClass()java.lang.ObjectgetCatchClassLoader()intgetHandler()inthashCode()
-
-
-
Constructor Detail
-
ExceptionHandler
public ExceptionHandler(int handler, java.lang.String catchClass, java.lang.Object catchClassLoader)- Parameters:
handler- the label for the handler codecatchClass- the type of exception that should be caught (in JVM format), or null if all exceptions should be caught (as with 'finally')
-
ExceptionHandler
public ExceptionHandler(int handler, java.lang.String catchClass)
-
-
Method Detail
-
getHandler
public int getHandler()
- Returns:
- the label of the handler code
-
getCatchClassLoader
public java.lang.Object getCatchClassLoader()
-
getCatchClass
public java.lang.String getCatchClass()
- Returns:
- the type of exceptions to be caught, or null if all exceptions should be caught
-
equals
public boolean equals(ExceptionHandler h)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-