jaxp/src/com/sun/org/apache/bcel/internal/generic/LineNumberGen.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 a line number within a method, i.e., give an instruction
  * a line number corresponding to the source code line.

@@ -86,18 +85,20 @@
   }
 
   /**
    * @return true, if ih is target of this line number
    */
+  @Override
   public boolean containsTarget(InstructionHandle ih) {
     return this.ih == ih;
   }
 
   /**
    * @param old_ih old target
    * @param new_ih new target
    */
+  @Override
   public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) {
     if(old_ih != ih)
       throw new ClassGenException("Not targeting " + old_ih + ", but " + ih + "}");
     else
       setInstruction(new_ih);

@@ -111,16 +112,17 @@
    */
   public LineNumber getLineNumber() {
     return new LineNumber(ih.getPosition(), src_line);
   }
 
-  public void setInstruction(InstructionHandle ih) {
-    BranchInstruction.notifyTarget(this.ih, ih, this);
-
+  public final void setInstruction(InstructionHandle ih) {
+    BranchInstruction.notifyTargetChanging(this.ih, this);
     this.ih = ih;
+    BranchInstruction.notifyTargetChanged(this.ih, this);
   }
 
+  @Override
   public Object clone() {
     try {
       return super.clone();
     } catch(CloneNotSupportedException e) {
       System.err.println(e);