Program: 24486
Project: 24486
Buggy source:
public LinkController(IViewControllerModel localViewControllerStore,ILinkEdge localLinkAttribute,int index){
  super(localViewControllerStore,index);
  this.linkAttribute=localLinkAttribute;
  this.parentAttribute=(ICanvasElementAttribute)this.linkAttribute.getGraphElement().getParent().getAttribute();
  this.linkDefinition=new LinkPointDefinition(linkAttribute.getAttribute());
  this.srcTermChangeListener=new ILinkTerminusChangeListener(){
    @Override public void valueChangeEvent(    ILinkTerminusValueChangeEvent e){
      if (e.getChangeType().equals(LinkTerminusChangeType.LOCATION)) {
        Envelope originalDrawnBounds=getDrawnBounds();
        Point newLocation=(Point)e.getNewValue();
        linkDefinition.setSrcAnchorPosition(newLocation);
        notifyDrawnBoundsChanged(originalDrawnBounds,getDrawnBounds());
      }
    }
  }
;
  this.tgtTermChangeListener=new ILinkTerminusChangeListener(){
    @Override public void valueChangeEvent(    ILinkTerminusValueChangeEvent e){
      if (e.getChangeType().equals(LinkTerminusChangeType.LOCATION)) {
        Envelope originalDrawnBounds=getDrawnBounds();
        Point newLocation=(Point)e.getNewValue();
        linkDefinition.setTgtAnchorPosition(newLocation);
        notifyDrawnBoundsChanged(originalDrawnBounds,getDrawnBounds());
      }
    }
  }
;
  this.parentDrawingElementPropertyChangeListener=new ICanvasAttributeChangeListener(){
    @Override public void propertyChange(    ICanvasAttributePropertyChangeEvent e){
    }
    @Override public void elementTranslated(    ICanvasAttributeTranslationEvent e){
      linkAttribute.getAttribute().translate(e.getTranslationDelta());
    }
    @Override public void nodeResized(    ICanvasAttributeResizedEvent e){
    }
  }
;
  this.bpChangeListener=new IBendPointChangeListener(){
    @Override public void locationChange(    IBendPointLocationChangeEvent e){
      Point bpPosn=e.getNewPosition();
      int idx=e.getBendPointIndex();
      linkDefinition.setBendPointPosition(idx,bpPosn);
      updateLinksToBendPoints(idx,bpPosn);
    }
    @Override public void propertyChange(    IBendPointChangeEvent e){
      Envelope originalDrawnBounds=getDrawnBounds();
      if (e.getChangeType().equals(BendPointChange.BEND_POINT_ADDED)) {
        int bpIdx=e.getNewIndexPos();
        Point bpPosn=e.getBendPoint();
        linkDefinition.addNewBendPoint(bpIdx,bpPosn);
        updateLinksToBendPoints(bpIdx,bpPosn);
      }
 else       if (e.getChangeType().equals(BendPointChange.BEND_POINT_REMOVED)) {
        int bpIdx=e.getOldIndexPos();
        linkDefinition.removeBendPoint(bpIdx);
        if (bpIdx < linkDefinition.numBendPoints()) {
          Point bpPosn=linkAttribute.getAttribute().getBendPointContainer().getBendPoint(bpIdx);
          updateLinksToBendPoints(bpIdx,bpPosn);
        }
 else         if (linkDefinition.numBendPoints() == 0) {
          updateAnchorPoints();
        }
 else {
          int lastBpIdx=linkDefinition.numBendPoints() - 1;
          Point bpPosn=linkAttribute.getAttribute().getBendPointContainer().getBendPoint(lastBpIdx);
          updateLinksToBendPoints(lastBpIdx,bpPosn);
        }
      }
      notifyDrawnBoundsChanged(originalDrawnBounds,getDrawnBounds());
    }
  }
;
}

Fixed version (ground truth):
public LinkController(IViewControllerModel localViewControllerStore,ILinkEdge localLinkAttribute,int index){
  super(localViewControllerStore,index);
  this.linkAttribute=localLinkAttribute;
  this.parentAttribute=(ICanvasElementAttribute)this.linkAttribute.getGraphElement().getParent().getAttribute();
  this.linkDefinition=new LinkPointDefinition(linkAttribute.getAttribute());
  this.srcTermChangeListener=new ILinkTerminusChangeListener(){
    @Override public void valueChangeEvent(    ILinkTerminusValueChangeEvent e){
      if (e.getChangeType().equals(LinkTerminusChangeType.LOCATION)) {
        Envelope originalDrawnBounds=getDrawnBounds();
        Point newLocation=(Point)e.getNewValue();
        linkDefinition.setSrcAnchorPosition(newLocation);
        notifyDrawnBoundsChanged(originalDrawnBounds,getDrawnBounds());
      }
    }
  }
;
  this.tgtTermChangeListener=new ILinkTerminusChangeListener(){
    @Override public void valueChangeEvent(    ILinkTerminusValueChangeEvent e){
      if (e.getChangeType().equals(LinkTerminusChangeType.LOCATION)) {
        Envelope originalDrawnBounds=getDrawnBounds();
        Point newLocation=(Point)e.getNewValue();
        linkDefinition.setTgtAnchorPosition(newLocation);
        notifyDrawnBoundsChanged(originalDrawnBounds,getDrawnBounds());
      }
    }
  }
;
  this.parentDrawingElementPropertyChangeListener=new ICanvasAttributeChangeListener(){
    @Override public void propertyChange(    ICanvasAttributePropertyChangeEvent e){
    }
    @Override public void elementTranslated(    ICanvasAttributeTranslationEvent e){
      linkAttribute.getAttribute().translate(e.getTranslationDelta());
    }
    @Override public void nodeResized(    ICanvasAttributeResizedEvent e){
    }
  }
;
  this.bpChangeListener=new IBendPointChangeListener(){
    @Override public void locationChange(    IBendPointLocationChangeEvent e){
      Point bpPosn=e.getNewPosition();
      int idx=e.getBendPointIndex();
      linkDefinition.setBendPointPosition(idx,bpPosn);
      updateLinksToBendPoints(idx,bpPosn);
    }
    @Override public void propertyChange(    IBendPointChangeEvent e){
      Envelope originalDrawnBounds=getDrawnBounds();
      if (e.getChangeType().equals(BendPointChange.BEND_POINT_ADDED)) {
        int bpIdx=e.getNewIndexPos();
        Point bpPosn=e.getBendPoint();
        linkDefinition.addNewBendPoint(bpIdx,bpPosn);
        updateLinksToBendPoints(bpIdx,bpPosn);
      }
 else       if (e.getChangeType().equals(BendPointChange.BEND_POINT_REMOVED)) {
        int bpIdx=e.getOldIndexPos();
        linkDefinition.removeBendPoint(bpIdx);
        if (bpIdx < linkDefinition.numBendPoints()) {
          Point bpPosn=linkAttribute.getAttribute().getBendPointContainer().getBendPoint(bpIdx);
          updateLinksToBendPoints(bpIdx,bpPosn);
        }
 else         if (linkDefinition.numBendPoints() == 0) {
          updateAnchorPoints();
        }
 else {
          int lastBpIdx=linkDefinition.numBendPoints() - 1;
          Point bpPosn=linkAttribute.getAttribute().getBendPointContainer().getBendPoint(lastBpIdx);
          updateLinksToBendPoints(lastBpIdx,bpPosn);
        }
      }
      notifyDrawnBoundsChanged(originalDrawnBounds,getDrawnBounds());
    }
  }
;
  linkAttributePropertyChangeListener=new ICanvasAttributeChangeListener(){
    @Override public void propertyChange(    ICanvasAttributePropertyChangeEvent e){
    }
    @Override public void elementTranslated(    ICanvasAttributeTranslationEvent e){
      linkDefinition.translate(e.getTranslationDelta());
    }
    @Override public void nodeResized(    ICanvasAttributeResizedEvent e){
    }
  }
;
  this.srcNodeListener=new ICanvasAttributeChangeListener(){
    @Override public void propertyChange(    ICanvasAttributePropertyChangeEvent e){
      if (e.getPropertyChange().equals(CanvasAttributePropertyChange.BOUNDS)) {
        if (!e.getAttribute().equals(parentAttribute)) {
          updateAnchorPoints();
        }
      }
    }
    @Override public void elementTranslated(    ICanvasAttributeTranslationEvent e){
    }
    @Override public void nodeResized(    ICanvasAttributeResizedEvent e){
    }
  }
;
  this.tgtNodeListener=new ICanvasAttributeChangeListener(){
    @Override public void propertyChange(    ICanvasAttributePropertyChangeEvent e){
      if (e.getPropertyChange().equals(CanvasAttributePropertyChange.BOUNDS)) {
        if (!e.getAttribute().equals(parentAttribute)) {
          updateAnchorPoints();
        }
      }
    }
    @Override public void elementTranslated(    ICanvasAttributeTranslationEvent e){
    }
    @Override public void nodeResized(    ICanvasAttributeResizedEvent e){
    }
  }
;
}