Program: 57139
Project: 57139
Buggy source:
protected void updatePathwayPortals(){
  PathwayMultiFormInfo info=null;
  if (portalFocusWindow != null) {
    if (portalFocusWindow.info instanceof PathwayMultiFormInfo) {
      info=(PathwayMultiFormInfo)portalFocusWindow.info;
    }
  }
  if (info == null)   return;
  augmentation.clear();
  clearWindowStubSets();
  PathwayVertexRep lastNodeOfPrevSegment=null;
  for (  PathwayPath segment : pathSegments) {
    List<PathwayVertexRep> nodes=segment.getNodes();
    if (!nodes.isEmpty()) {
      if (lastNodeOfPrevSegment != null) {
        PathwayMultiFormInfo info1=getInfo(lastNodeOfPrevSegment);
        PathwayMultiFormInfo info2=getInfo(nodes.get(0));
        if (pathwayRow.getVisibility() == EVisibility.NONE || info1 == null || info2 == null)         continue;
        Rectangle2D loc1=getAbsoluteVertexLocation(getPathwayRepresentation(info1.multiFormRenderer,info1.multiFormRenderer.getActiveRendererID()),lastNodeOfPrevSegment,info1.container);
        Rectangle2D loc2=getAbsoluteVertexLocation(getPathwayRepresentation(info2.multiFormRenderer,info2.multiFormRenderer.getActiveRendererID()),nodes.get(0),info2.container);
        augmentation.add(new LinkRenderer(this,true,loc1,loc2,info1,info2,1,false,false,false,true,lastNodeOfPrevSegment,nodes.get(0),connectionBandRenderer));
      }
      lastNodeOfPrevSegment=nodes.get(nodes.size() - 1);
    }
  }
  for (  PathwayMultiFormInfo i : pathwayInfos) {
    if (i.getCurrentEmbeddingID() == EEmbeddingID.PATHWAY_LEVEL1) {
      highlightPathwayNodePortals(i);
    }
  }
  for (  PathwayVertexRep vertexRep : info.pathway.vertexSet()) {
    if (info.getCurrentEmbeddingID() == EEmbeddingID.PATHWAY_LEVEL1 && vertexRep.getType() == EPathwayVertexType.map) {
      addPortalHighlightRenderer(vertexRep,info);
      continue;
    }
    Pair<Rectangle2D,Boolean> sourcePair=getPortalLocation(vertexRep,info);
    for (    PathwayMultiFormInfo i : pathwayInfos) {
      if (info != i) {
        addLinkRenderers(vertexRep,info,i,sourcePair);
      }
 else {
      }
    }
  }
}

Fixed version (ground truth):
protected void updatePathwayPortals(){
  PathwayMultiFormInfo info=null;
  if (portalFocusWindow != null) {
    if (portalFocusWindow.info instanceof PathwayMultiFormInfo) {
      info=(PathwayMultiFormInfo)portalFocusWindow.info;
    }
  }
  if (info == null)   return;
  augmentation.clear();
  clearWindowStubSets();
  PathwayVertexRep lastNodeOfPrevSegment=null;
  for (  PathwayPath segment : pathSegments) {
    List<PathwayVertexRep> nodes=segment.getNodes();
    if (!nodes.isEmpty()) {
      if (lastNodeOfPrevSegment != null) {
        PathwayMultiFormInfo info1=getInfo(lastNodeOfPrevSegment);
        PathwayMultiFormInfo info2=getInfo(nodes.get(0));
        if (pathwayRow.getVisibility() == EVisibility.NONE || info1 == null || info2 == null)         continue;
        Rectangle2D loc1=getAbsoluteVertexLocation(getPathwayRepresentation(info1.multiFormRenderer,info1.multiFormRenderer.getActiveRendererID()),lastNodeOfPrevSegment,info1.container);
        Rectangle2D loc2=getAbsoluteVertexLocation(getPathwayRepresentation(info2.multiFormRenderer,info2.multiFormRenderer.getActiveRendererID()),nodes.get(0),info2.container);
        augmentation.add(new LinkRenderer(this,true,loc1,loc2,info1,info2,1,false,false,false,true,lastNodeOfPrevSegment,nodes.get(0),connectionBandRenderer));
      }
      lastNodeOfPrevSegment=nodes.get(nodes.size() - 1);
    }
  }
  if (pathwayRow.getVisibility() != EVisibility.NONE) {
    for (    PathwayMultiFormInfo i : pathwayInfos) {
      if (i.getCurrentEmbeddingID() == EEmbeddingID.PATHWAY_LEVEL1) {
        highlightPathwayNodePortals(i);
      }
    }
  }
  for (  PathwayVertexRep vertexRep : info.pathway.vertexSet()) {
    Pair<Rectangle2D,Boolean> sourcePair=getPortalLocation(vertexRep,info);
    for (    PathwayMultiFormInfo i : pathwayInfos) {
      if (info != i) {
        addLinkRenderers(vertexRep,info,i,sourcePair);
      }
 else {
      }
    }
  }
}