Program: 47982
Project: 47982
Buggy source:
/** 
 * Get the coverage   {@link hudson.model.HealthReport}.
 * @return The health report or <code>null</code> if health reporting is disabled.
 * @since 1.7
 */
public HealthReport getBuildHealth(){
  if (thresholds == null) {
    return null;
  }
  thresholds.ensureValid();
  int score=100;
  float percent;
  ArrayList<Localizable> reports=new ArrayList<Localizable>(5);
  if (clazz != null && thresholds.getMaxClass() > 0) {
    percent=clazz.getPercentageFloat();
    if (percent < thresholds.getMaxClass()) {
      reports.add(Messages._BuildAction_Classes(clazz,percent));
    }
    score=updateHealthScore(score,thresholds.getMinClass(),percent,thresholds.getMaxClass());
  }
  if (method != null && thresholds.getMaxMethod() > 0) {
    percent=method.getPercentageFloat();
    if (percent < thresholds.getMaxMethod()) {
      reports.add(Messages._BuildAction_Methods(method,percent));
    }
    score=updateHealthScore(score,thresholds.getMinMethod(),percent,thresholds.getMaxMethod());
  }
  if (line != null && thresholds.getMaxLine() > 0) {
    percent=line.getPercentageFloat();
    if (percent < thresholds.getMaxLine()) {
      reports.add(Messages._BuildAction_Lines(line,percent));
    }
    score=updateHealthScore(score,thresholds.getMinLine(),percent,thresholds.getMaxLine());
  }
  if (branch != null && thresholds.getMaxBranch() > 0) {
    percent=branch.getPercentageFloat();
    if (percent < thresholds.getMaxBranch()) {
      reports.add(Messages._BuildAction_Branches(branch,percent));
    }
    score=updateHealthScore(score,thresholds.getMinBranch(),percent,thresholds.getMaxBranch());
  }
  if (instruction != null && thresholds.getMaxInstruction() > 0) {
    percent=instruction.getPercentageFloat();
    if (percent < thresholds.getMaxInstruction()) {
      reports.add(Messages._BuildAction_Instructions(instruction,percent));
    }
    score=updateHealthScore(score,thresholds.getMinInstruction(),percent,thresholds.getMaxInstruction());
  }
  if (score == 100) {
    reports.add(Messages._BuildAction_Perfect());
  }
  Object[] args=reports.toArray(new Object[5]);
  for (int i=4; i >= 0; i--) {
    if (args[i] == null) {
      args[i]="String_Node_Str";
    }
 else {
      break;
    }
  }
  return new HealthReport(score,Messages._BuildAction_Description(args[0],args[1],args[2],args[3],args[4]));
}

Fixed version (ground truth):
/** 
 * Get the coverage   {@link hudson.model.HealthReport}.
 * @return The health report or <code>null</code> if health reporting is disabled.
 * @since 1.7
 */
public HealthReport getBuildHealth(){
  if (thresholds == null) {
    return null;
  }
  thresholds.ensureValid();
  int score=100;
  float percent;
  ArrayList<Localizable> reports=new ArrayList<>(5);
  if (clazz != null && thresholds.getMaxClass() > 0) {
    percent=clazz.getPercentageFloat();
    if (percent < thresholds.getMaxClass()) {
      reports.add(Messages._BuildAction_Classes(clazz,percent));
    }
    score=updateHealthScore(score,thresholds.getMinClass(),percent,thresholds.getMaxClass());
  }
  if (method != null && thresholds.getMaxMethod() > 0) {
    percent=method.getPercentageFloat();
    if (percent < thresholds.getMaxMethod()) {
      reports.add(Messages._BuildAction_Methods(method,percent));
    }
    score=updateHealthScore(score,thresholds.getMinMethod(),percent,thresholds.getMaxMethod());
  }
  if (line != null && thresholds.getMaxLine() > 0) {
    percent=line.getPercentageFloat();
    if (percent < thresholds.getMaxLine()) {
      reports.add(Messages._BuildAction_Lines(line,percent));
    }
    score=updateHealthScore(score,thresholds.getMinLine(),percent,thresholds.getMaxLine());
  }
  if (branch != null && thresholds.getMaxBranch() > 0) {
    percent=branch.getPercentageFloat();
    if (percent < thresholds.getMaxBranch()) {
      reports.add(Messages._BuildAction_Branches(branch,percent));
    }
    score=updateHealthScore(score,thresholds.getMinBranch(),percent,thresholds.getMaxBranch());
  }
  if (instruction != null && thresholds.getMaxInstruction() > 0) {
    percent=instruction.getPercentageFloat();
    if (percent < thresholds.getMaxInstruction()) {
      reports.add(Messages._BuildAction_Instructions(instruction,percent));
    }
    score=updateHealthScore(score,thresholds.getMinInstruction(),percent,thresholds.getMaxInstruction());
  }
  if (score == 100) {
    reports.add(Messages._BuildAction_Perfect());
  }
  Object[] args=reports.toArray(new Object[5]);
  for (int i=4; i >= 0; i--) {
    if (args[i] == null) {
      args[i]="String_Node_Str";
    }
 else {
      break;
    }
  }
  return new HealthReport(score,Messages._BuildAction_Description(args[0],args[1],args[2],args[3],args[4]));
}