Program: 119312
Project: 119312
Buggy source:
public void refreshNodes(boolean isClear){
  if (this.jobletContainer.getNode().isJoblet()) {
    boolean isRed=new JobletUtil().isRed(this.jobletContainer);
    Project refProject=ProjectManager.getInstance().getProject(this.jobletContainer.getProcess().getProperty().getItem());
    if (!ProjectManager.getInstance().isInCurrentMainProject(refProject)) {
      if (!this.jobletContainer.isCollapsed()) {
        isRed=true;
      }
    }
    if (this.jobletContainer.isCollapsed() && lastJobletRedState == isRed) {
      return;
    }
    lastJobletRedState=isRed;
    if (isSubjobDisplay) {
      if (isRed && rectFig != null) {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(red));
      }
 else       if (rectFig != null) {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(green));
      }
    }
 else {
      if (rectFig != null) {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
      }
    }
    if (isRed && outlineFigure != null) {
      outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(red));
    }
 else     if (outlineFigure != null) {
      outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(green));
    }
    if (!jobletContainer.isCollapsed()) {
      for (      Object ele : jobletContainer.getElements()) {
        if (ele instanceof Node) {
          ((Node)ele).setReadOnly(isRed);
        }
      }
    }
  }
 else   if (this.jobletContainer.getNode().isMapReduce()) {
    if (this.jobletContainer.getNode().isMapReduceStart() && mrFigures.isEmpty()) {
      initMRFigures();
    }
    if (!this.jobletContainer.getNode().isMapReduceStart() && !mrFigures.isEmpty()) {
      Iterator<Entry<String,SimpleHtmlFigure>> ite=mrFigures.entrySet().iterator();
      while (ite.hasNext()) {
        Entry<String,SimpleHtmlFigure> entry=ite.next();
        SimpleHtmlFigure value=entry.getValue();
        getChildren().remove(value);
      }
      mrFigures.clear();
    }
    if (!this.jobletContainer.getNode().isMapReduceStart()) {
      if (rectFig.isVisible()) {
        rectFig.setVisible(false);
      }
      if (outlineFigure.isVisible()) {
        outlineFigure.setVisible(false);
      }
      return;
    }
    if (rectFig != null) {
      if (isSubjobDisplay) {
        Color color=ColorUtils.getCacheColor(mrGroupColor);
        if (rectFig.getBackgroundColor() == null || !rectFig.getBackgroundColor().equals(color)) {
          rectFig.setBackgroundColor(color);
        }
      }
 else {
        Color color=ColorUtils.getCacheColor(white);
        if (rectFig.getBackgroundColor() == null || !rectFig.getBackgroundColor().equals(color)) {
          rectFig.setBackgroundColor(color);
        }
      }
      if (!rectFig.isVisible()) {
        rectFig.setVisible(true);
      }
    }
    if (outlineFigure != null && outlineFigure.isVisible()) {
      outlineFigure.setVisible(false);
    }
    Iterator<Entry<String,SimpleHtmlFigure>> ite=mrFigures.entrySet().iterator();
    while (ite.hasNext()) {
      Entry<String,SimpleHtmlFigure> entry=ite.next();
      String key=entry.getKey();
      SimpleHtmlFigure value=entry.getValue();
      Double percent=new Double(0);
      if (key.startsWith(KEY_MAP)) {
        percent=jobletContainer.getPercentMap() * 10;
        if (isSubjobDisplay && !value.isVisible()) {
          value.setVisible(true);
        }
      }
      if (key.startsWith(KEY_REDUCE)) {
        percent=jobletContainer.getPercentReduce() * 10;
        if (this.jobletContainer.isMRGroupContainesReduce() && isSubjobDisplay) {
          if (!value.isVisible()) {
            value.setVisible(true);
          }
        }
 else         if (value.isVisible()) {
          value.setVisible(false);
        }
      }
      if (value.isVisible()) {
        Integer i=Integer.parseInt(key.substring(key.indexOf("String_Node_Str") + 1)) + 1;
        boolean hun=percent.equals(new Double(10));
        Integer mrCount=this.jobletContainer.getNode().getMrJobInGroupCount();
        boolean refreshPro=hun && (mrCount.toString().equals(jobletContainer.getMrName()));
        if (i.toString().equals(jobletContainer.getMrName()) || isClear || refreshPro) {
          List object=value.getChildren();
          for (          Object o : object) {
            if (o instanceof RectangleFigure) {
              setProgressData((RectangleFigure)o,percent,8);
            }
          }
        }
      }
    }
  }
  initializejobletContainer(getBounds());
}

Fixed version (ground truth):
public void refreshNodes(boolean isClear){
  if (this.jobletContainer.getNode().isJoblet()) {
    refreshForJoblet();
  }
 else   if (this.jobletContainer.getNode().isMapReduce()) {
    if (this.jobletContainer.getNode().isMapReduceStart() && mrFigures.isEmpty()) {
      initMRFigures();
    }
    if (!this.jobletContainer.getNode().isMapReduceStart() && !mrFigures.isEmpty()) {
      Iterator<Entry<String,SimpleHtmlFigure>> ite=mrFigures.entrySet().iterator();
      while (ite.hasNext()) {
        Entry<String,SimpleHtmlFigure> entry=ite.next();
        SimpleHtmlFigure value=entry.getValue();
        getChildren().remove(value);
      }
      mrFigures.clear();
    }
    if (!this.jobletContainer.getNode().isMapReduceStart()) {
      if (rectFig.isVisible()) {
        rectFig.setVisible(false);
      }
      if (outlineFigure.isVisible()) {
        outlineFigure.setVisible(false);
      }
      return;
    }
    if (rectFig != null) {
      if (isSubjobDisplay) {
        Color color=ColorUtils.getCacheColor(mrGroupColor);
        if (rectFig.getBackgroundColor() == null || !rectFig.getBackgroundColor().equals(color)) {
          rectFig.setBackgroundColor(color);
        }
      }
 else {
        Color color=ColorUtils.getCacheColor(white);
        if (rectFig.getBackgroundColor() == null || !rectFig.getBackgroundColor().equals(color)) {
          rectFig.setBackgroundColor(color);
        }
      }
      if (!rectFig.isVisible()) {
        rectFig.setVisible(true);
      }
    }
    if (outlineFigure != null && outlineFigure.isVisible()) {
      outlineFigure.setVisible(false);
    }
    Iterator<Entry<String,SimpleHtmlFigure>> ite=mrFigures.entrySet().iterator();
    while (ite.hasNext()) {
      Entry<String,SimpleHtmlFigure> entry=ite.next();
      String key=entry.getKey();
      SimpleHtmlFigure value=entry.getValue();
      Double percent=new Double(0);
      if (key.startsWith(KEY_MAP)) {
        percent=jobletContainer.getPercentMap() * 10;
        if (isSubjobDisplay && !value.isVisible()) {
          value.setVisible(true);
        }
      }
      if (key.startsWith(KEY_REDUCE)) {
        percent=jobletContainer.getPercentReduce() * 10;
        if (this.jobletContainer.isMRGroupContainesReduce() && isSubjobDisplay) {
          if (!value.isVisible()) {
            value.setVisible(true);
          }
        }
 else         if (value.isVisible()) {
          value.setVisible(false);
        }
      }
      if (value.isVisible()) {
        Integer i=Integer.parseInt(key.substring(key.indexOf("String_Node_Str") + 1)) + 1;
        boolean hun=percent.equals(new Double(10));
        Integer mrCount=this.jobletContainer.getNode().getMrJobInGroupCount();
        boolean refreshPro=hun && (mrCount.toString().equals(jobletContainer.getMrName()));
        if (i.toString().equals(jobletContainer.getMrName()) || isClear || refreshPro) {
          List object=value.getChildren();
          for (          Object o : object) {
            if (o instanceof RectangleFigure) {
              setProgressData((RectangleFigure)o,percent,8);
            }
          }
        }
      }
    }
  }
}