Program: 119303
Project: 119303
Buggy source:
public void initializejobletContainer(Rectangle rectangle){
  Point location=this.getLocation();
  if (location.equals(lastLocation)) {
    return;
  }
  lastLocation=location;
  collapseFigure.setCollapsed(jobletContainer.isCollapsed());
  collapseFigure.setVisible(this.jobletContainer.getNode().isJoblet());
  titleFigure.setText("String_Node_Str" + title + "String_Node_Str");
  Dimension preferedSize=titleFigure.getPreferredSize();
  preferedSize=preferedSize.getExpanded(0,3);
  collapseFigure.setLocation(new Point(location.x,location.y));
  collapseFigure.setSize(preferedSize.height,preferedSize.height);
  titleFigure.setSize(preferedSize.width,preferedSize.height - 2);
  titleFigure.setLocation(new Point((rectangle.width - preferedSize.width) / 2 + location.x,location.y));
  titleFigure.setVisible(showTitle);
  outlineFigure.setLocation(new Point(location.x,location.y));
  outlineFigure.setVisible(showTitle);
  outlineFigure.setForegroundColor(ColorUtils.getCacheColor(new RGB(220,120,120)));
  outlineFigure.setSize(rectangle.width,preferedSize.height);
  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();
  }
  Iterator<Entry<String,SimpleHtmlFigure>> ite=mrFigures.entrySet().iterator();
  int i=0;
  while (ite.hasNext()) {
    Entry<String,SimpleHtmlFigure> entry=ite.next();
    String key=entry.getKey();
    SimpleHtmlFigure value=entry.getValue();
    int progressHeight=value.getBounds().height + 3;
    Integer count=this.jobletContainer.getNode().getMrJobInGroupCount();
    i=Integer.parseInt(key.substring(key.indexOf("String_Node_Str") + 1));
    int mry=progressHeight * i;
    int proWidth=value.getBounds().width;
    int jcWidth=this.jobletContainer.getJobletContainerRectangle().width;
    if (isSubjobDisplay) {
      if (!this.jobletContainer.isMRGroupContainesReduce()) {
        if (key.startsWith(KEY_MAP)) {
          if (jcWidth > proWidth + 12) {
            value.setLocation(new Point(location.x + jcWidth / 2 - proWidth / 2 - 6,location.y + rectangle.height - count * progressHeight + mry));
          }
 else           if (jcWidth > proWidth) {
            value.setLocation(new Point(location.x + jcWidth / 2 - proWidth / 2,location.y + rectangle.height - count * progressHeight + mry));
          }
 else {
            value.setLocation(new Point(location.x,location.y + rectangle.height - count * progressHeight + mry));
          }
        }
      }
 else {
        if (jcWidth / 2 >= 120) {
          if (key.startsWith(KEY_MAP)) {
            value.setLocation(new Point(location.x + jcWidth / 2 - 120,location.y + rectangle.height - count * progressHeight + mry));
          }
          if (key.startsWith(KEY_REDUCE)) {
            value.setLocation(new Point(location.x + jcWidth / 2,location.y + rectangle.height - count * progressHeight + mry));
          }
        }
 else         if (jcWidth / 2 > proWidth) {
          if (key.startsWith(KEY_MAP)) {
            value.setLocation(new Point(location.x + jcWidth / 2 - proWidth,location.y + rectangle.height - count * progressHeight + mry));
          }
          if (key.startsWith(KEY_REDUCE)) {
            value.setLocation(new Point(location.x + jcWidth / 2,location.y + rectangle.height - count * progressHeight + mry));
          }
        }
 else {
          if (key.startsWith(KEY_MAP)) {
            value.setLocation(new Point(location.x,location.y + rectangle.height - count * progressHeight + mry));
          }
          if (key.startsWith(KEY_REDUCE)) {
            value.setLocation(new Point(location.x + 110,location.y + rectangle.height - count * progressHeight + mry));
          }
        }
      }
    }
  }
  rectFig.setLocation(new Point(location.x,location.y));
  rectFig.setSize(new Dimension(rectangle.width,rectangle.height));
  if (this.jobletContainer.getNode().isJoblet()) {
    if (new JobletUtil().isRed(this.jobletContainer)) {
      if (isSubjobDisplay) {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(red));
      }
 else {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
      }
      outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(red));
    }
 else {
      if (isSubjobDisplay) {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(green));
      }
 else {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
      }
      outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(green));
    }
  }
 else {
    if (isSubjobDisplay) {
      rectFig.setBackgroundColor(ColorUtils.getCacheColor(mrGroupColor));
    }
 else {
      rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
    }
    outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(mrGroupColor));
    if (!this.jobletContainer.getNode().isMapReduceStart()) {
      rectFig.setVisible(false);
      outlineFigure.setVisible(false);
    }
  }
  if (isSubjobDisplay) {
    rectFig.setForegroundColor(ColorUtils.getCacheColor(new RGB(220,120,120)));
  }
 else {
    rectFig.setForegroundColor(ColorUtils.getCacheColor(white));
  }
}

Fixed version (ground truth):
public void initializejobletContainer(Rectangle rectangle){
  Point location=this.getLocation();
  if (location.equals(lastLocation)) {
  }
  lastLocation=location;
  collapseFigure.setCollapsed(jobletContainer.isCollapsed());
  collapseFigure.setVisible(this.jobletContainer.getNode().isJoblet());
  titleFigure.setText("String_Node_Str" + title + "String_Node_Str");
  Dimension preferedSize=titleFigure.getPreferredSize();
  preferedSize=preferedSize.getExpanded(0,3);
  collapseFigure.setLocation(new Point(location.x,location.y));
  collapseFigure.setSize(preferedSize.height,preferedSize.height);
  titleFigure.setSize(preferedSize.width,preferedSize.height - 2);
  titleFigure.setLocation(new Point((rectangle.width - preferedSize.width) / 2 + location.x,location.y));
  titleFigure.setVisible(showTitle);
  outlineFigure.setLocation(new Point(location.x,location.y));
  outlineFigure.setVisible(showTitle);
  outlineFigure.setForegroundColor(ColorUtils.getCacheColor(new RGB(220,120,120)));
  outlineFigure.setSize(rectangle.width,preferedSize.height);
  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();
  }
  Iterator<Entry<String,SimpleHtmlFigure>> ite=mrFigures.entrySet().iterator();
  int i=0;
  while (ite.hasNext()) {
    Entry<String,SimpleHtmlFigure> entry=ite.next();
    String key=entry.getKey();
    SimpleHtmlFigure value=entry.getValue();
    int progressHeight=value.getBounds().height + 3;
    Integer count=this.jobletContainer.getNode().getMrJobInGroupCount();
    i=Integer.parseInt(key.substring(key.indexOf("String_Node_Str") + 1));
    int mry=progressHeight * i;
    int proWidth=value.getBounds().width;
    int jcWidth=this.jobletContainer.getJobletContainerRectangle().width;
    if (isSubjobDisplay) {
      if (!this.jobletContainer.isMRGroupContainesReduce()) {
        if (key.startsWith(KEY_MAP)) {
          if (jcWidth > proWidth + 12) {
            value.setLocation(new Point(location.x + jcWidth / 2 - proWidth / 2 - 6,location.y + rectangle.height - count * progressHeight + mry));
          }
 else           if (jcWidth > proWidth) {
            value.setLocation(new Point(location.x + jcWidth / 2 - proWidth / 2,location.y + rectangle.height - count * progressHeight + mry));
          }
 else {
            value.setLocation(new Point(location.x,location.y + rectangle.height - count * progressHeight + mry));
          }
        }
      }
 else {
        if (jcWidth / 2 >= 120) {
          if (key.startsWith(KEY_MAP)) {
            value.setLocation(new Point(location.x + jcWidth / 2 - 120,location.y + rectangle.height - count * progressHeight + mry));
          }
          if (key.startsWith(KEY_REDUCE)) {
            value.setLocation(new Point(location.x + jcWidth / 2,location.y + rectangle.height - count * progressHeight + mry));
          }
        }
 else         if (jcWidth / 2 > proWidth) {
          if (key.startsWith(KEY_MAP)) {
            value.setLocation(new Point(location.x + jcWidth / 2 - proWidth,location.y + rectangle.height - count * progressHeight + mry));
          }
          if (key.startsWith(KEY_REDUCE)) {
            value.setLocation(new Point(location.x + jcWidth / 2,location.y + rectangle.height - count * progressHeight + mry));
          }
        }
 else {
          if (key.startsWith(KEY_MAP)) {
            value.setLocation(new Point(location.x,location.y + rectangle.height - count * progressHeight + mry));
          }
          if (key.startsWith(KEY_REDUCE)) {
            value.setLocation(new Point(location.x + 110,location.y + rectangle.height - count * progressHeight + mry));
          }
        }
      }
    }
  }
  rectFig.setLocation(new Point(location.x,location.y));
  rectFig.setSize(new Dimension(rectangle.width,rectangle.height));
  if (this.jobletContainer.getNode().isJoblet()) {
    if (new JobletUtil().isRed(this.jobletContainer)) {
      if (isSubjobDisplay) {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(red));
      }
 else {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
      }
      outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(red));
    }
 else {
      if (isSubjobDisplay) {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(green));
      }
 else {
        rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
      }
      outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(green));
    }
  }
 else {
    if (isSubjobDisplay) {
      rectFig.setBackgroundColor(ColorUtils.getCacheColor(mrGroupColor));
    }
 else {
      rectFig.setBackgroundColor(ColorUtils.getCacheColor(white));
    }
    outlineFigure.setBackgroundColor(ColorUtils.getCacheColor(mrGroupColor));
    if (!this.jobletContainer.getNode().isMapReduceStart()) {
      rectFig.setVisible(false);
      outlineFigure.setVisible(false);
    }
  }
  if (isSubjobDisplay) {
    rectFig.setForegroundColor(ColorUtils.getCacheColor(new RGB(220,120,120)));
  }
 else {
    rectFig.setForegroundColor(ColorUtils.getCacheColor(white));
  }
}