Program: 58992
Project: 58992
Buggy source:
private synchronized void initializeNewPathways(final GL gl){
  if (!iAlUninitializedPathwayIDs.isEmpty() && arSlerpActions.isEmpty()) {
    int iTmpPathwayID=iAlUninitializedPathwayIDs.get(0);
    if (!generalManager.getPathwayManager().isPathwayVisible(iTmpPathwayID)) {
      ArrayList<Integer> iAlSetIDs=new ArrayList<Integer>();
      for (      ISet tmpSet : alSets) {
        iAlSetIDs.add(tmpSet.getID());
      }
      CmdCreateGLPathway cmdPathway=(CmdCreateGLPathway)generalManager.getCommandManager().createCommandByType(ECommandType.CREATE_GL_PATHWAY_3D);
      cmdPathway.setAttributes(iTmpPathwayID,iAlSetIDs,EProjectionMode.ORTHOGRAPHIC,-4,4,4,-4,-20,20);
      cmdPathway.doCommand();
      GLPathway pathway=(GLPathway)cmdPathway.getCreatedObject();
      int iGeneratedViewID=pathway.getID();
      ArrayList<Integer> arMediatorIDs=new ArrayList<Integer>();
      arMediatorIDs.add(iGeneratedViewID);
      generalManager.getEventPublisher().addSendersAndReceiversToMediator(generalManager.getEventPublisher().getItem(iMediatorID),arMediatorIDs,arMediatorIDs,EMediatorType.SELECTION_MEDIATOR,EMediatorUpdateType.MEDIATOR_DEFAULT);
      if (underInteractionLayer.containsElement(-1)) {
        SlerpAction slerpActionTransition=new SlerpAction(iGeneratedViewID,spawnLayer,underInteractionLayer);
        arSlerpActions.add(slerpActionTransition);
        pathway.initRemote(gl,iUniqueID,underInteractionLayer,pickingTriggerMouseAdapter,this);
        pathway.setDetailLevel(EDetailLevel.MEDIUM);
        pathway.broadcastElements(ESelectionType.ADD);
      }
 else       if (stackLayer.containsElement(-1)) {
        SlerpAction slerpActionTransition=new SlerpAction(iGeneratedViewID,spawnLayer,stackLayer);
        arSlerpActions.add(slerpActionTransition);
        pathway.initRemote(gl,iUniqueID,stackLayer,pickingTriggerMouseAdapter,this);
        pathway.setDetailLevel(EDetailLevel.LOW);
        pathway.broadcastElements(ESelectionType.ADD);
      }
 else       if (poolLayer.containsElement(-1)) {
        SlerpAction slerpActionTransition=new SlerpAction(iGeneratedViewID,spawnLayer,poolLayer);
        arSlerpActions.add(slerpActionTransition);
        pathway.initRemote(gl,iUniqueID,poolLayer,pickingTriggerMouseAdapter,this);
        pathway.setDetailLevel(EDetailLevel.VERY_LOW);
      }
 else {
        generalManager.getLogger().log(Level.SEVERE,"String_Node_Str");
        iAlUninitializedPathwayIDs.remove(0);
        for (        AGLEventListener eventListener : generalManager.getViewGLCanvasManager().getAllGLEventListeners()) {
          if (!eventListener.isRenderedRemote())           eventListener.enableBusyMode(false);
        }
        return;
      }
      spawnLayer.addElement(iGeneratedViewID);
    }
    iAlUninitializedPathwayIDs.remove(0);
    if (iAlUninitializedPathwayIDs.isEmpty()) {
      for (      AGLEventListener eventListener : generalManager.getViewGLCanvasManager().getAllGLEventListeners()) {
        if (!eventListener.isRenderedRemote())         eventListener.enableBusyMode(false);
      }
    }
 else {
      for (      AGLEventListener eventListener : generalManager.getViewGLCanvasManager().getAllGLEventListeners())       if (!eventListener.isRenderedRemote())       eventListener.enableBusyMode(true);
    }
  }
}

Fixed version (ground truth):
private synchronized void initializeNewPathways(final GL gl){
  if (!iAlUninitializedPathwayIDs.isEmpty() && arSlerpActions.isEmpty()) {
    int iTmpPathwayID=iAlUninitializedPathwayIDs.get(0);
    if (!generalManager.getPathwayManager().isPathwayVisible(iTmpPathwayID)) {
      ArrayList<Integer> iAlSetIDs=new ArrayList<Integer>();
      for (      ISet tmpSet : alSets) {
        if (tmpSet.getSetType() != ESetType.GENE_EXPRESSION_DATA)         continue;
        iAlSetIDs.add(tmpSet.getID());
      }
      CmdCreateGLPathway cmdPathway=(CmdCreateGLPathway)generalManager.getCommandManager().createCommandByType(ECommandType.CREATE_GL_PATHWAY_3D);
      cmdPathway.setAttributes(iTmpPathwayID,iAlSetIDs,EProjectionMode.ORTHOGRAPHIC,-4,4,4,-4,-20,20);
      cmdPathway.doCommand();
      GLPathway pathway=(GLPathway)cmdPathway.getCreatedObject();
      int iGeneratedViewID=pathway.getID();
      ArrayList<Integer> arMediatorIDs=new ArrayList<Integer>();
      arMediatorIDs.add(iGeneratedViewID);
      generalManager.getEventPublisher().addSendersAndReceiversToMediator(generalManager.getEventPublisher().getItem(iMediatorID),arMediatorIDs,arMediatorIDs,EMediatorType.SELECTION_MEDIATOR,EMediatorUpdateType.MEDIATOR_DEFAULT);
      if (underInteractionLayer.containsElement(-1)) {
        SlerpAction slerpActionTransition=new SlerpAction(iGeneratedViewID,spawnLayer,underInteractionLayer);
        arSlerpActions.add(slerpActionTransition);
        pathway.initRemote(gl,iUniqueID,underInteractionLayer,pickingTriggerMouseAdapter,this);
        pathway.setDetailLevel(EDetailLevel.MEDIUM);
        pathway.broadcastElements(ESelectionType.ADD);
      }
 else       if (stackLayer.containsElement(-1)) {
        SlerpAction slerpActionTransition=new SlerpAction(iGeneratedViewID,spawnLayer,stackLayer);
        arSlerpActions.add(slerpActionTransition);
        pathway.initRemote(gl,iUniqueID,stackLayer,pickingTriggerMouseAdapter,this);
        pathway.setDetailLevel(EDetailLevel.LOW);
        pathway.broadcastElements(ESelectionType.ADD);
      }
 else       if (poolLayer.containsElement(-1)) {
        SlerpAction slerpActionTransition=new SlerpAction(iGeneratedViewID,spawnLayer,poolLayer);
        arSlerpActions.add(slerpActionTransition);
        pathway.initRemote(gl,iUniqueID,poolLayer,pickingTriggerMouseAdapter,this);
        pathway.setDetailLevel(EDetailLevel.VERY_LOW);
      }
 else {
        generalManager.getLogger().log(Level.SEVERE,"String_Node_Str");
        iAlUninitializedPathwayIDs.remove(0);
        for (        AGLEventListener eventListener : generalManager.getViewGLCanvasManager().getAllGLEventListeners()) {
          if (!eventListener.isRenderedRemote())           eventListener.enableBusyMode(false);
        }
        return;
      }
      spawnLayer.addElement(iGeneratedViewID);
    }
    iAlUninitializedPathwayIDs.remove(0);
    if (iAlUninitializedPathwayIDs.isEmpty()) {
      for (      AGLEventListener eventListener : generalManager.getViewGLCanvasManager().getAllGLEventListeners()) {
        if (!eventListener.isRenderedRemote())         eventListener.enableBusyMode(false);
      }
    }
 else {
      for (      AGLEventListener eventListener : generalManager.getViewGLCanvasManager().getAllGLEventListeners())       if (!eventListener.isRenderedRemote())       eventListener.enableBusyMode(true);
    }
  }
}