Program: 59233
Project: 59233
Buggy source:
public void drawView(){
  HashMap<Integer,Pathway> pathwayLUT=((IPathwayManager)refGeneralManager.getSingelton().getPathwayManager()).getPathwayLUT();
  if (iPathwayId == 0) {
    Iterator<Pathway> iter=pathwayLUT.values().iterator();
    refCurrentPathway=iter.next();
  }
 else {
    refCurrentPathway=pathwayLUT.get(iPathwayId);
  }
  Vector<PathwayVertex> vertexList;
  Iterator<PathwayVertex> vertexIterator;
  PathwayVertex vertex;
  Vector<IPathwayVertexRep> vertexReps;
  Iterator<IPathwayVertexRep> vertexRepIterator;
  PathwayVertexRep vertexRep;
  Vector<APathwayEdge> edgeList;
  Iterator<APathwayEdge> edgeIterator;
  APathwayEdge edge;
  PathwayRelationEdge relationEdge;
  PathwayReactionEdge reactionEdge;
  vertexList=refCurrentPathway.getVertexList();
  vertexIterator=vertexList.iterator();
  while (vertexIterator.hasNext()) {
    vertex=vertexIterator.next();
    vertexReps=vertex.getVertexReps();
    vertexRepIterator=vertexReps.iterator();
    while (vertexRepIterator.hasNext()) {
      vertexRep=(PathwayVertexRep)vertexRepIterator.next();
      createVertex(vertex,vertexRep.getName(),vertexRep.getHeight(),vertexRep.getWidth(),vertexRep.getXPosition(),vertexRep.getYPosition(),vertexRep.getShapeType());
    }
  }
  edgeList=refCurrentPathway.getEdgeList();
  edgeIterator=edgeList.iterator();
  while (edgeIterator.hasNext()) {
    edge=edgeIterator.next();
    if (bShowRelationEdges == false)     break;
    if (edge.getClass().getName().equals("String_Node_Str")) {
      relationEdge=(PathwayRelationEdge)edge;
      if (relationEdge.getCompoundId() == -1) {
        createEdge(relationEdge.getElementId1(),relationEdge.getElementId2(),false,relationEdge);
      }
 else {
        createEdge(relationEdge.getElementId1(),relationEdge.getCompoundId(),false,relationEdge);
        if (relationEdge.getEdgeRelationType() == EdgeRelationType.maplink) {
          createEdge(relationEdge.getElementId2(),relationEdge.getCompoundId(),true,relationEdge);
        }
 else {
          createEdge(relationEdge.getCompoundId(),relationEdge.getElementId2(),false,relationEdge);
        }
      }
    }
  }
  vertexIterator=vertexList.iterator();
  while (vertexIterator.hasNext()) {
    vertex=vertexIterator.next();
    vertexReps=vertex.getVertexReps();
    vertexRepIterator=vertexReps.iterator();
    if (vertex.getVertexType() == PathwayVertexType.enzyme) {
      IPathwayElementManager pathwayElementManager=((IPathwayElementManager)refGeneralManager.getSingelton().getPathwayElementManager());
      System.out.println("String_Node_Str" + vertex.getVertexReactionName());
      edge=pathwayElementManager.getEdgeLUT().get(pathwayElementManager.getReactionName2EdgeIdLUT().get(vertex.getVertexReactionName()));
      if (edge != null) {
        if (bShowReactionEdges == false)         break;
        if (edge.getClass().getName().equals("String_Node_Str")) {
          reactionEdge=(PathwayReactionEdge)edge;
          createEdge(reactionEdge.getSubstrates().get(0),vertex.getElementId(),false,reactionEdge);
          createEdge(vertex.getElementId(),reactionEdge.getProducts().get(0),true,reactionEdge);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void drawView(){
  HashMap<Integer,Pathway> pathwayLUT=((IPathwayManager)refGeneralManager.getSingelton().getPathwayManager()).getPathwayLUT();
  if (iPathwayId == 0) {
    Iterator<Pathway> iter=pathwayLUT.values().iterator();
    refCurrentPathway=iter.next();
  }
 else {
    refCurrentPathway=pathwayLUT.get(iPathwayId);
  }
  Vector<PathwayVertex> vertexList;
  Iterator<PathwayVertex> vertexIterator;
  PathwayVertex vertex;
  Vector<IPathwayVertexRep> vertexReps;
  Iterator<IPathwayVertexRep> vertexRepIterator;
  PathwayVertexRep vertexRep;
  Vector<APathwayEdge> edgeList;
  Iterator<APathwayEdge> edgeIterator;
  APathwayEdge edge;
  PathwayRelationEdge relationEdge;
  PathwayReactionEdge reactionEdge;
  vertexList=refCurrentPathway.getVertexList();
  vertexIterator=vertexList.iterator();
  while (vertexIterator.hasNext()) {
    vertex=vertexIterator.next();
    vertexReps=vertex.getVertexReps();
    vertexRepIterator=vertexReps.iterator();
    while (vertexRepIterator.hasNext()) {
      vertexRep=(PathwayVertexRep)vertexRepIterator.next();
      createVertex(vertex,vertexRep.getName(),vertexRep.getHeight(),vertexRep.getWidth(),vertexRep.getXPosition(),vertexRep.getYPosition(),vertexRep.getShapeType());
    }
  }
  edgeList=refCurrentPathway.getEdgeList();
  edgeIterator=edgeList.iterator();
  while (edgeIterator.hasNext()) {
    edge=edgeIterator.next();
    if (bShowRelationEdges == false)     break;
    if (edge.getClass().getName().equals("String_Node_Str")) {
      relationEdge=(PathwayRelationEdge)edge;
      if (relationEdge.getCompoundId() == -1) {
        createEdge(relationEdge.getElementId1(),relationEdge.getElementId2(),false,relationEdge);
      }
 else {
        createEdge(relationEdge.getElementId1(),relationEdge.getCompoundId(),false,relationEdge);
        if (relationEdge.getEdgeRelationType() == EdgeRelationType.ECrel) {
          createEdge(relationEdge.getCompoundId(),relationEdge.getElementId2(),false,relationEdge);
        }
 else {
          createEdge(relationEdge.getElementId2(),relationEdge.getCompoundId(),true,relationEdge);
        }
      }
    }
  }
  vertexIterator=vertexList.iterator();
  while (vertexIterator.hasNext()) {
    vertex=vertexIterator.next();
    vertexReps=vertex.getVertexReps();
    vertexRepIterator=vertexReps.iterator();
    if (vertex.getVertexType() == PathwayVertexType.enzyme) {
      IPathwayElementManager pathwayElementManager=((IPathwayElementManager)refGeneralManager.getSingelton().getPathwayElementManager());
      System.out.println("String_Node_Str" + vertex.getVertexReactionName());
      edge=pathwayElementManager.getEdgeLUT().get(pathwayElementManager.getReactionName2EdgeIdLUT().get(vertex.getVertexReactionName()));
      if (edge != null) {
        if (bShowReactionEdges == false)         break;
        if (edge.getClass().getName().equals("String_Node_Str")) {
          reactionEdge=(PathwayReactionEdge)edge;
          createEdge(reactionEdge.getSubstrates().get(0),vertex.getElementId(),false,reactionEdge);
          createEdge(vertex.getElementId(),reactionEdge.getProducts().get(0),true,reactionEdge);
        }
      }
    }
  }
}