Program: 58077
Project: 58077
Buggy source:
private void renderDimensionGroupConnections(GL2 gl){
  gl.glColor4f(1,1,0,1f);
  gl.glLineWidth(4);
  List<GLBrick> leftBricks=leftDimGroup.getBricks();
  List<GLBrick> rightBricks=rightDimGroup.getBricks();
  SimilarityMap similarityMap=relationAnalyzer.getSimilarityMap(leftDimGroup.getSetID());
  if (similarityMap == null)   return;
  VASimilarity<ContentVirtualArray,ContentGroupList> vaSimilarityMap=similarityMap.getVASimilarity(rightDimGroup.getSetID());
  if (vaSimilarityMap == null)   return;
  for (  GLBrick leftBrick : leftBricks) {
    GroupSimilarity<ContentVirtualArray,ContentGroupList> leftGroupSimilarity=vaSimilarityMap.getGroupSimilarity(leftDimGroup.getSetID(),leftBrick.getGroupID());
    float[] leftSimilarities=leftGroupSimilarity.getSimilarities();
    float leftSimilarityOffsetY=0;
    float rightSimilarityOffsetY=0;
    for (    GLBrick rightBrick : rightBricks) {
      float leftSimilarityRatioY=leftSimilarities[rightBrick.getGroupID()];
      leftSimilarityOffsetY+=leftSimilarityRatioY;
      GroupSimilarity<ContentVirtualArray,ContentGroupList> rightGroupSimilarity=vaSimilarityMap.getGroupSimilarity(rightDimGroup.getSetID(),rightBrick.getGroupID());
      float[] rightSimilarities=rightGroupSimilarity.getSimilarities();
      float rightSimilarityRatioY=rightSimilarities[leftBrick.getGroupID()];
      rightSimilarityOffsetY+=rightSimilarityRatioY;
      ElementLayout leftBrickElementLayout=leftBrick.getLayout();
      ElementLayout leftBrickWrappingLayout=leftBrick.getWrappingLayout();
      ElementLayout rightBrickElementLayout=rightBrick.getLayout();
      ElementLayout rightBrickWrappingLayout=rightBrick.getWrappingLayout();
      gl.glBegin(GL2.GL_LINES);
      gl.glVertex2f(0,leftBrickWrappingLayout.getAbsoluteTranslateY() + leftBrickElementLayout.getSizeScaledY() * leftSimilarityOffsetY);
      gl.glVertex2f(x,rightBrickWrappingLayout.getAbsoluteTranslateY() + rightBrickElementLayout.getSizeScaledY() * rightSimilarityOffsetY);
      gl.glEnd();
    }
  }
}

Fixed version (ground truth):
private void renderDimensionGroupConnections(GL2 gl){
  gl.glColor4f(1,1,0,1f);
  gl.glLineWidth(4);
  List<GLBrick> leftBricks=leftDimGroup.getBricks();
  List<GLBrick> rightBricks=rightDimGroup.getBricks();
  SimilarityMap similarityMap=relationAnalyzer.getSimilarityMap(leftDimGroup.getSetID());
  if (similarityMap == null)   return;
  VASimilarity<ContentVirtualArray,ContentGroupList> vaSimilarityMap=similarityMap.getVASimilarity(rightDimGroup.getSetID());
  if (vaSimilarityMap == null)   return;
  for (  GLBrick leftBrick : leftBricks) {
    ElementLayout leftBrickElementLayout=leftBrick.getWrappingLayout();
    GroupSimilarity<ContentVirtualArray,ContentGroupList> leftGroupSimilarity=vaSimilarityMap.getGroupSimilarity(leftDimGroup.getSetID(),leftBrick.getGroupID());
    float[] leftSimilarities=leftGroupSimilarity.getSimilarities();
    float leftSimilarityOffsetY=0;
    float rightSimilarityOffsetY=0;
    for (    GLBrick rightBrick : rightBricks) {
      ElementLayout rightBrickElementLayout=rightBrick.getWrappingLayout();
      float leftSimilarityRatioY=leftSimilarities[rightBrick.getGroupID()];
      leftSimilarityOffsetY+=leftSimilarityRatioY;
      GroupSimilarity<ContentVirtualArray,ContentGroupList> rightGroupSimilarity=vaSimilarityMap.getGroupSimilarity(rightDimGroup.getSetID(),rightBrick.getGroupID());
      float[] rightSimilarities=rightGroupSimilarity.getSimilarities();
      float rightSimilarityRatioY=rightSimilarities[leftBrick.getGroupID()];
      rightSimilarityOffsetY+=rightSimilarityRatioY;
      gl.glBegin(GL2.GL_LINES);
      gl.glVertex2f(0,leftBrickElementLayout.getTranslateY() + leftBrickElementLayout.getSizeScaledY() * leftSimilarityOffsetY);
      gl.glVertex2f(x,rightBrickElementLayout.getTranslateY() + rightBrickElementLayout.getSizeScaledY() * rightSimilarityOffsetY);
      gl.glEnd();
    }
  }
}