Program: 57147
Project: 57147
Buggy source:
protected void renderStubRight2RightSide(GL2 gl,Rectangle2D loc,Rectangle2D locTarget,boolean isWindow,PathwayMultiFormInfo info,PathwayMultiFormInfo infoTarget,boolean start){
  if (this.isAngleTooSmall) {
    renderRightOffsetStub(gl,loc,locTarget,isWindow,info,infoTarget,start);
    return;
  }
  xS=(float)loc.getX() + (float)loc.getWidth();
  yS=(float)loc.getY() + (float)loc.getHeight() / 2.0f;
  xE=(float)locTarget.getX() + (float)locTarget.getWidth();
  yE=(float)locTarget.getY() + (float)locTarget.getHeight() / 2.0f;
  float red=bandColor[0];
  float green=bandColor[1];
  float blue=bandColor[2];
  boolean renderStub=true;
  float stubConnectionPointS_X=0.0f;
  float stubConnectionPointS_Y=0.0f;
  float stubConnectionPointE_X=0.0f;
  float stubConnectionPointE_Y=0.0f;
  if (isWindow && !this.drawLink) {
    Pair<PathwayMultiFormInfo,PathwayMultiFormInfo> windowPair=new Pair<PathwayMultiFormInfo,PathwayMultiFormInfo>(info,infoTarget);
    if (this.view.containsWindowsStub(windowPair))     renderStub=false;
    float windowCenterX=(infoTarget.window.getAbsoluteLocation().get(0) + (infoTarget.window.getSize().get(0) / 2.0f));
    float windowCenterY=(infoTarget.window.getAbsoluteLocation().get(1) + (infoTarget.window.getSize().get(1) / 2.0f));
    Vec2f dirToWindowCenter=new Vec2f(windowCenterX - xS,windowCenterY - yS);
    dirToWindowCenter.normalize();
    Vec2f normalVecCenterVec=rotateVec2(dirToWindowCenter,(float)Math.PI / 2f);
    float glBandWidthOffsetX_CenterVec=normalVecCenterVec.get(0) * bandWidth / 2.0f;
    float glBandWidthOffsetY_CenterVec=normalVecCenterVec.get(1) * bandWidth / 2.0f;
    stubConnectionPointE_X=xS + (dirToWindowCenter.get(0) * (stubLength)) - glBandWidthOffsetX_CenterVec;
    stubConnectionPointE_Y=yS + (dirToWindowCenter.get(1) * (stubLength)) + glBandWidthOffsetY_CenterVec;
    stubConnectionPointS_X=xS + (dirToWindowCenter.get(0) * (stubLength)) + glBandWidthOffsetX_CenterVec;
    stubConnectionPointS_Y=yS + (dirToWindowCenter.get(1) * (stubLength)) - glBandWidthOffsetY_CenterVec;
  }
 else {
    Vec2f dirNorm=new Vec2f(xE - xS,yE - yS);
    dirNorm.normalize();
    Vec2f normalVec=rotateVec2(dirNorm,(float)Math.PI / 2f);
    float glBandWidthOffsetX=normalVec.get(0) * bandWidth / 2.0f;
    float glBandWidthOffsetY=normalVec.get(1) * bandWidth / 2.0f;
    stubConnectionPointS_X=xS + (dirNorm.get(0) * (stubLength)) - glBandWidthOffsetX;
    stubConnectionPointS_Y=yS + (dirNorm.get(1) * (stubLength)) - glBandWidthOffsetY;
    stubConnectionPointE_X=xS + (dirNorm.get(0) * (stubLength)) + glBandWidthOffsetX;
    stubConnectionPointE_Y=yS + (dirNorm.get(1) * (stubLength)) + glBandWidthOffsetY;
  }
  float p00X=xS;
  float p00Y=yS - (float)loc.getHeight() / 2.0f;
  float p01X=xS;
  float p01Y=yS + (float)loc.getHeight() / 2.0f;
  if (fadeToOpacity < linkOpacity && !renderStub)   return;
  gl.glBegin(GL2.GL_LINES);
  gl.glColor4f(red,green,blue,this.outlineOpacity);
  gl.glVertex3f(p00X,p00Y,z);
  gl.glColor4f(red,green,blue,fadeToOpacity);
  gl.glVertex3f(stubConnectionPointS_X,stubConnectionPointS_Y,z);
  gl.glColor4f(red,green,blue,this.outlineOpacity);
  gl.glVertex3f(p01X,p01Y,z);
  gl.glColor4f(red,green,blue,fadeToOpacity);
  gl.glVertex3f(stubConnectionPointE_X,stubConnectionPointE_Y,z);
  gl.glEnd();
  gl.glBegin(GL2.GL_QUADS);
  gl.glColor4f(red,green,blue,linkOpacity);
  gl.glVertex3f(p00X,p00Y,z);
  gl.glVertex3f(p01X,p01Y,z);
  gl.glColor4f(red,green,blue,fadeToOpacity);
  gl.glVertex3f(stubConnectionPointE_X,stubConnectionPointE_Y,z);
  gl.glVertex3f(stubConnectionPointS_X,stubConnectionPointS_Y,z);
  gl.glEnd();
  if (start) {
    stubConnectionPoint1_X=stubConnectionPointS_X;
    stubConnectionPoint1_Y=stubConnectionPointS_Y;
    stubConnectionPoint2_X=stubConnectionPointE_X;
    stubConnectionPoint2_Y=stubConnectionPointE_Y;
  }
 else {
    stubConnectionPoint3_X=stubConnectionPointS_X;
    stubConnectionPoint3_Y=stubConnectionPointS_Y;
    stubConnectionPoint4_X=stubConnectionPointE_X;
    stubConnectionPoint4_Y=stubConnectionPointE_Y;
  }
}

Fixed version (ground truth):
protected void renderStubRight2RightSide(GL2 gl,Rectangle2D loc,Rectangle2D locTarget,boolean isWindow,PathwayMultiFormInfo info,PathwayMultiFormInfo infoTarget,boolean start){
  if (this.isAngleTooSmall) {
    renderRightOffsetStub(gl,loc,locTarget,isWindow,info,infoTarget,start);
    return;
  }
  xS=(float)loc.getX() + (float)loc.getWidth();
  yS=(float)loc.getY() + (float)loc.getHeight() / 2.0f;
  xE=(float)locTarget.getX() + (float)locTarget.getWidth();
  yE=(float)locTarget.getY() + (float)locTarget.getHeight() / 2.0f;
  float red=bandColor[0];
  float green=bandColor[1];
  float blue=bandColor[2];
  boolean renderStub=true;
  float stubConnectionPointS_X=0.0f;
  float stubConnectionPointS_Y=0.0f;
  float stubConnectionPointE_X=0.0f;
  float stubConnectionPointE_Y=0.0f;
  float p00X=xS;
  float p00Y=yS - (float)loc.getHeight() / 2.0f;
  float p01X=xS;
  float p01Y=yS + (float)loc.getHeight() / 2.0f;
  if (isWindow) {
    Pair<PathwayMultiFormInfo,PathwayMultiFormInfo> windowPair=new Pair<PathwayMultiFormInfo,PathwayMultiFormInfo>(info,infoTarget);
    if (this.view.containsWindowsStub(windowPair))     renderStub=false;
    float windowCenterX=(infoTarget.window.getAbsoluteLocation().get(0) + (infoTarget.window.getSize().get(0) / 2.0f));
    float windowCenterY=(infoTarget.window.getAbsoluteLocation().get(1) + (infoTarget.window.getSize().get(1) / 2.0f));
    Vec2f dirToWindowCenter=new Vec2f(windowCenterX - xS,windowCenterY - yS);
    dirToWindowCenter.normalize();
    if (this.drawLink) {
      Vec2f dirNorm=new Vec2f(xE - xS,yE - yS);
      dirNorm.normalize();
      dirToWindowCenter=dirNorm;
    }
    Vec2f normalVecCenterVec=rotateVec2(dirToWindowCenter,(float)Math.PI / 2f);
    float glBandWidthOffsetX_CenterVec=normalVecCenterVec.get(0) * bandWidth / 2.0f;
    float glBandWidthOffsetY_CenterVec=normalVecCenterVec.get(1) * bandWidth / 2.0f;
    stubConnectionPointE_X=xS + (dirToWindowCenter.get(0) * (stubLength)) - glBandWidthOffsetX_CenterVec;
    stubConnectionPointE_Y=yS + (dirToWindowCenter.get(1) * (stubLength)) - glBandWidthOffsetY_CenterVec;
    stubConnectionPointS_X=xS + (dirToWindowCenter.get(0) * (stubLength)) + glBandWidthOffsetX_CenterVec;
    stubConnectionPointS_Y=yS + (dirToWindowCenter.get(1) * (stubLength)) + glBandWidthOffsetY_CenterVec;
  }
 else {
    Vec2f dirNorm=new Vec2f(xE - xS,yE - yS);
    dirNorm.normalize();
    Vec2f normalVec=rotateVec2(dirNorm,(float)Math.PI / 2f);
    float glBandWidthOffsetX=normalVec.get(0) * bandWidth / 2.0f;
    float glBandWidthOffsetY=normalVec.get(1) * bandWidth / 2.0f;
    stubConnectionPointS_X=xS + (dirNorm.get(0) * (stubLength)) - glBandWidthOffsetX;
    stubConnectionPointS_Y=yS + (dirNorm.get(1) * (stubLength)) - glBandWidthOffsetY;
    stubConnectionPointE_X=xS + (dirNorm.get(0) * (stubLength)) + glBandWidthOffsetX;
    stubConnectionPointE_Y=yS + (dirNorm.get(1) * (stubLength)) + glBandWidthOffsetY;
  }
  if (fadeToOpacity < linkOpacity && !renderStub)   return;
  gl.glBegin(GL2.GL_LINES);
  gl.glColor4f(red,green,blue,this.outlineOpacity);
  gl.glVertex3f(p00X,p00Y,z);
  gl.glColor4f(red,green,blue,fadeToOpacity);
  gl.glVertex3f(stubConnectionPointS_X,stubConnectionPointS_Y,z);
  gl.glColor4f(red,green,blue,this.outlineOpacity);
  gl.glVertex3f(p01X,p01Y,z);
  gl.glColor4f(red,green,blue,fadeToOpacity);
  gl.glVertex3f(stubConnectionPointE_X,stubConnectionPointE_Y,z);
  gl.glEnd();
  gl.glBegin(GL2.GL_QUADS);
  gl.glColor4f(red,green,blue,linkOpacity);
  gl.glVertex3f(p00X,p00Y,z);
  gl.glVertex3f(p01X,p01Y,z);
  gl.glColor4f(red,green,blue,fadeToOpacity);
  gl.glVertex3f(stubConnectionPointE_X,stubConnectionPointE_Y,z);
  gl.glVertex3f(stubConnectionPointS_X,stubConnectionPointS_Y,z);
  gl.glEnd();
  if (start) {
    stubConnectionPoint1_X=stubConnectionPointS_X;
    stubConnectionPoint1_Y=stubConnectionPointS_Y;
    stubConnectionPoint2_X=stubConnectionPointE_X;
    stubConnectionPoint2_Y=stubConnectionPointE_Y;
  }
 else {
    stubConnectionPoint3_X=stubConnectionPointS_X;
    stubConnectionPoint3_Y=stubConnectionPointS_Y;
    stubConnectionPoint4_X=stubConnectionPointE_X;
    stubConnectionPoint4_Y=stubConnectionPointE_Y;
  }
}