jaxp/src/com/sun/org/apache/bcel/internal/generic/CodeExceptionGen.java
Print this page
@@ -56,11 +56,10 @@
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
-import com.sun.org.apache.bcel.internal.Constants;
import com.sun.org.apache.bcel.internal.classfile.*;
/**
* This class represents an exception handler, i.e., specifies the region where
* a handler is active and an instruction where the actual handling is done.
@@ -116,35 +115,39 @@
}
/* Set start of handler
* @param start_pc Start of handled region (inclusive)
*/
- public void setStartPC(InstructionHandle start_pc) {
- BranchInstruction.notifyTarget(this.start_pc, start_pc, this);
+ public final void setStartPC(InstructionHandle start_pc) {
+ BranchInstruction.notifyTargetChanging(this.start_pc, this);
this.start_pc = start_pc;
+ BranchInstruction.notifyTargetChanged(this.start_pc, this);
}
/* Set end of handler
* @param end_pc End of handled region (inclusive)
*/
- public void setEndPC(InstructionHandle end_pc) {
- BranchInstruction.notifyTarget(this.end_pc, end_pc, this);
+ public final void setEndPC(InstructionHandle end_pc) {
+ BranchInstruction.notifyTargetChanging(this.end_pc, this);
this.end_pc = end_pc;
+ BranchInstruction.notifyTargetChanged(this.end_pc, this);
}
/* Set handler code
* @param handler_pc Start of handler
*/
- public void setHandlerPC(InstructionHandle handler_pc) {
- BranchInstruction.notifyTarget(this.handler_pc, handler_pc, this);
+ public final void setHandlerPC(InstructionHandle handler_pc) {
+ BranchInstruction.notifyTargetChanging(this.handler_pc, this);
this.handler_pc = handler_pc;
+ BranchInstruction.notifyTargetChanged(this.handler_pc, this);
}
/**
* @param old_ih old target, either start or end
* @param new_ih new target
*/
+ @Override
public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) {
boolean targeted = false;
if(start_pc == old_ih) {
targeted = true;
@@ -167,10 +170,11 @@
}
/**
* @return true, if ih is target of this handler
*/
+ @Override
public boolean containsTarget(InstructionHandle ih) {
return (start_pc == ih) || (end_pc == ih) || (handler_pc == ih);
}
/** Sets the type of the Exception to catch. Set 'null' for ANY. */
@@ -188,14 +192,16 @@
/** @return start of handler
*/
public InstructionHandle getHandlerPC() { return handler_pc; }
+ @Override
public String toString() {
return "CodeExceptionGen(" + start_pc + ", " + end_pc + ", " + handler_pc + ")";
}
+ @Override
public Object clone() {
try {
return super.clone();
} catch(CloneNotSupportedException e) {
System.err.println(e);