Program: 57254
Project: 57254
Buggy source:
public static void renderEdge(GL2 gl,ALinearizableNode node1,ALinearizableNode node2,Vec3f node1ConnectionPoint,Vec3f node2ConnectionPoint,float zCoordinate,boolean isVerticalConnection,PixelGLConverter pixelGLConverter,CaleydoTextRenderer textRenderer,PathSizeConfiguration sizeConfig){
  List<PathwayVertexRep> node1VertexReps=node1.getVertexReps();
  List<PathwayVertexRep> node2VertexReps=node2.getVertexReps();
  PathwayGraph pathway=null;
  DefaultEdge edge=null;
  PathwayVertexRep vertexRep1=null;
  for (  PathwayVertexRep node1VertexRep : node1VertexReps) {
    for (    PathwayVertexRep node2VertexRep : node2VertexReps) {
      if (node1VertexRep.getPathway() == node2VertexRep.getPathway()) {
        pathway=node1VertexRep.getPathway();
        vertexRep1=node1VertexRep;
        edge=pathway.getEdge(node1VertexRep,node2VertexRep);
        if (edge == null) {
          edge=pathway.getEdge(node2VertexRep,node1VertexRep);
        }
        if (edge != null)         break;
      }
    }
    if (edge != null)     break;
  }
  if (edge == null || pathway == null || vertexRep1 == null)   return;
  ConnectionLineRenderer connectionRenderer=new ConnectionLineRenderer();
  List<Vec3f> linePoints=new ArrayList<Vec3f>();
  boolean isNode1Target=pathway.getEdgeTarget(edge) == vertexRep1;
  Vec3f sourceConnectionPoint=(isNode1Target) ? node2ConnectionPoint : node1ConnectionPoint;
  Vec3f targetConnectionPoint=(isNode1Target) ? node1ConnectionPoint : node2ConnectionPoint;
  sourceConnectionPoint.setZ(zCoordinate);
  targetConnectionPoint.setZ(zCoordinate);
  linePoints.add(sourceConnectionPoint);
  linePoints.add(targetConnectionPoint);
  if (edge instanceof PathwayReactionEdgeRep) {
    PathwayReactionEdgeRep reactionEdge=(PathwayReactionEdgeRep)edge;
    ClosedArrowRenderer arrowRenderer=new ClosedArrowRenderer(pixelGLConverter);
    LineEndArrowRenderer lineEndArrowRenderer=new LineEndArrowRenderer(false,arrowRenderer);
    connectionRenderer.addAttributeRenderer(lineEndArrowRenderer);
    if (reactionEdge.getType() == EPathwayReactionEdgeType.reversible) {
      arrowRenderer=new ClosedArrowRenderer(pixelGLConverter);
      lineEndArrowRenderer=new LineEndArrowRenderer(true,arrowRenderer);
      connectionRenderer.addAttributeRenderer(lineEndArrowRenderer);
    }
  }
 else {
    if (edge instanceof PathwayRelationEdgeRep) {
      PathwayRelationEdgeRep relationEdgeRep=(PathwayRelationEdgeRep)edge;
      ArrayList<EPathwayRelationEdgeSubType> subtypes=relationEdgeRep.getRelationSubTypes();
      float spacing=pixelGLConverter.getGLHeightForPixelHeight(3);
      for (      EPathwayRelationEdgeSubType subtype : subtypes) {
switch (subtype) {
case compound:
          break;
case hidden_compound:
        break;
case activation:
      connectionRenderer.addAttributeRenderer(createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig));
    break;
case inhibition:
  connectionRenderer.addAttributeRenderer(createDefaultLineEndStaticLineRenderer(isVerticalConnection,pixelGLConverter,sizeConfig));
if (isVerticalConnection) {
  targetConnectionPoint.setY(targetConnectionPoint.y() + ((isNode1Target) ? -spacing : spacing));
}
 else {
  targetConnectionPoint.setX(targetConnectionPoint.x() + ((isNode1Target) ? spacing : -spacing));
}
break;
case expression:
connectionRenderer.addAttributeRenderer(createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig));
if (vertexRep1.getType() == EPathwayVertexType.gene && vertexRep1.getType() == EPathwayVertexType.gene) {
connectionRenderer.addAttributeRenderer(createDefaultLabelOnLineRenderer("String_Node_Str",pixelGLConverter,textRenderer,sizeConfig));
}
break;
case repression:
connectionRenderer.addAttributeRenderer(createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig));
connectionRenderer.addAttributeRenderer(createDefaultLineEndStaticLineRenderer(isVerticalConnection,pixelGLConverter,sizeConfig));
targetConnectionPoint.setY(targetConnectionPoint.y() + ((isNode1Target) ? -spacing : spacing));
break;
case indirect_effect:
connectionRenderer.addAttributeRenderer(createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig));
connectionRenderer.setLineStippled(true);
break;
case state_change:
connectionRenderer.setLineStippled(true);
break;
case binding_association:
break;
case dissociation:
connectionRenderer.addAttributeRenderer(createDefaultOrthogonalLineCrossingRenderer(pixelGLConverter,sizeConfig));
break;
case missing_interaction:
connectionRenderer.addAttributeRenderer(createDefaultLineCrossingRenderer(pixelGLConverter,sizeConfig));
break;
case phosphorylation:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.phosphorylation.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
case dephosphorylation:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.dephosphorylation.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
case glycosylation:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.glycosylation.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
case ubiquitination:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.ubiquitination.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
case methylation:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.methylation.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
}
}
}
}
connectionRenderer.renderLine(gl,linePoints);
}

Fixed version (ground truth):
public static void renderEdge(GL2 gl,ALinearizableNode node1,ALinearizableNode node2,Vec3f node1ConnectionPoint,Vec3f node2ConnectionPoint,float zCoordinate,boolean isVerticalConnection,PixelGLConverter pixelGLConverter,CaleydoTextRenderer textRenderer,PathSizeConfiguration sizeConfig){
  List<PathwayVertexRep> node1VertexReps=node1.getVertexReps();
  List<PathwayVertexRep> node2VertexReps=node2.getVertexReps();
  PathwayGraph pathway=null;
  DefaultEdge edge=null;
  PathwayVertexRep vertexRep1=null;
  for (  PathwayVertexRep node1VertexRep : node1VertexReps) {
    for (    PathwayVertexRep node2VertexRep : node2VertexReps) {
      if (node1VertexRep.getPathway() == node2VertexRep.getPathway()) {
        pathway=node1VertexRep.getPathway();
        vertexRep1=node1VertexRep;
        edge=pathway.getEdge(node1VertexRep,node2VertexRep);
        if (edge == null) {
          edge=pathway.getEdge(node2VertexRep,node1VertexRep);
        }
        if (edge != null)         break;
      }
    }
    if (edge != null)     break;
  }
  if (edge == null || pathway == null || vertexRep1 == null)   return;
  ConnectionLineRenderer connectionRenderer=new ConnectionLineRenderer();
  List<Vec3f> linePoints=new ArrayList<Vec3f>();
  boolean isNode1Target=pathway.getEdgeTarget(edge) == vertexRep1;
  Vec3f sourceConnectionPoint=(isNode1Target) ? node2ConnectionPoint : node1ConnectionPoint;
  Vec3f targetConnectionPoint=(isNode1Target) ? node1ConnectionPoint : node2ConnectionPoint;
  sourceConnectionPoint.setZ(zCoordinate);
  targetConnectionPoint.setZ(zCoordinate);
  linePoints.add(sourceConnectionPoint);
  linePoints.add(targetConnectionPoint);
  if (edge instanceof PathwayReactionEdgeRep) {
    PathwayReactionEdgeRep reactionEdge=(PathwayReactionEdgeRep)edge;
    LineEndArrowRenderer lineEndArrowRenderer=createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig);
    connectionRenderer.addAttributeRenderer(lineEndArrowRenderer);
    if (reactionEdge.getType() == EPathwayReactionEdgeType.reversible) {
      lineEndArrowRenderer=createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig);
      connectionRenderer.addAttributeRenderer(lineEndArrowRenderer);
    }
  }
 else {
    if (edge instanceof PathwayRelationEdgeRep) {
      PathwayRelationEdgeRep relationEdgeRep=(PathwayRelationEdgeRep)edge;
      ArrayList<EPathwayRelationEdgeSubType> subtypes=relationEdgeRep.getRelationSubTypes();
      float spacing=pixelGLConverter.getGLHeightForPixelHeight(3);
      for (      EPathwayRelationEdgeSubType subtype : subtypes) {
switch (subtype) {
case compound:
          break;
case hidden_compound:
        break;
case activation:
      connectionRenderer.addAttributeRenderer(createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig));
    break;
case inhibition:
  connectionRenderer.addAttributeRenderer(createDefaultLineEndStaticLineRenderer(isVerticalConnection,pixelGLConverter,sizeConfig));
if (isVerticalConnection) {
  targetConnectionPoint.setY(targetConnectionPoint.y() + ((isNode1Target) ? -spacing : spacing));
}
 else {
  targetConnectionPoint.setX(targetConnectionPoint.x() + ((isNode1Target) ? spacing : -spacing));
}
break;
case expression:
connectionRenderer.addAttributeRenderer(createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig));
if (vertexRep1.getType() == EPathwayVertexType.gene && vertexRep1.getType() == EPathwayVertexType.gene) {
connectionRenderer.addAttributeRenderer(createDefaultLabelOnLineRenderer("String_Node_Str",pixelGLConverter,textRenderer,sizeConfig));
}
break;
case repression:
connectionRenderer.addAttributeRenderer(createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig));
connectionRenderer.addAttributeRenderer(createDefaultLineEndStaticLineRenderer(isVerticalConnection,pixelGLConverter,sizeConfig));
targetConnectionPoint.setY(targetConnectionPoint.y() + ((isNode1Target) ? -spacing : spacing));
break;
case indirect_effect:
connectionRenderer.addAttributeRenderer(createDefaultLineEndArrowRenderer(pixelGLConverter,sizeConfig));
connectionRenderer.setLineStippled(true);
break;
case state_change:
connectionRenderer.setLineStippled(true);
break;
case binding_association:
break;
case dissociation:
connectionRenderer.addAttributeRenderer(createDefaultOrthogonalLineCrossingRenderer(pixelGLConverter,sizeConfig));
break;
case missing_interaction:
connectionRenderer.addAttributeRenderer(createDefaultLineCrossingRenderer(pixelGLConverter,sizeConfig));
break;
case phosphorylation:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.phosphorylation.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
case dephosphorylation:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.dephosphorylation.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
case glycosylation:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.glycosylation.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
case ubiquitination:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.ubiquitination.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
case methylation:
connectionRenderer.addAttributeRenderer(createDefaultLabelAboveLineRenderer(EPathwayRelationEdgeSubType.methylation.getSymbol(),pixelGLConverter,textRenderer,sizeConfig));
break;
}
}
}
}
connectionRenderer.renderLine(gl,linePoints);
}