nus-yam/ex-repair huggingface dataset:
Program: 18886
Project: 18886
Buggy source:
/** 
 * Folds 'typeof(foo)' if foo is a literal, e.g. typeof("bar") --> "string" typeof(6) --> "number"
 */
private Node tryFoldTypeof(Node originalTypeofNode){
  Preconditions.checkArgument(originalTypeofNode.getType() == Token.TYPEOF);
  Node argumentNode=originalTypeofNode.getFirstChild();
  if (argumentNode == null || !NodeUtil.isLiteralValue(argumentNode)) {
    return originalTypeofNode;
  }
  String typeNameString=null;
switch (argumentNode.getType()) {
case Token.STRING:
    typeNameString="String_Node_Str";
  break;
case Token.NUMBER:
typeNameString="String_Node_Str";
break;
case Token.TRUE:
case Token.FALSE:
typeNameString="String_Node_Str";
break;
case Token.NULL:
case Token.OBJECTLIT:
case Token.ARRAYLIT:
typeNameString="String_Node_Str";
break;
case Token.VOID:
typeNameString="String_Node_Str";
break;
case Token.NAME:
if ("String_Node_Str".equals(argumentNode.getString())) {
typeNameString="String_Node_Str";
}
break;
}
if (typeNameString != null) {
Node newNode=Node.newString(typeNameString);
originalTypeofNode.getParent().replaceChild(originalTypeofNode,newNode);
reportCodeChange();
return newNode;
}
return originalTypeofNode;
}

Fixed version (ground truth):
/** 
 * Folds 'typeof(foo)' if foo is a literal, e.g. typeof("bar") --> "string" typeof(6) --> "number"
 */
private Node tryFoldTypeof(Node originalTypeofNode){
  Preconditions.checkArgument(originalTypeofNode.getType() == Token.TYPEOF);
  Node argumentNode=originalTypeofNode.getFirstChild();
  if (argumentNode == null || !NodeUtil.isLiteralValue(argumentNode,true)) {
    return originalTypeofNode;
  }
  String typeNameString=null;
switch (argumentNode.getType()) {
case Token.FUNCTION:
    typeNameString="String_Node_Str";
  break;
case Token.STRING:
typeNameString="String_Node_Str";
break;
case Token.NUMBER:
typeNameString="String_Node_Str";
break;
case Token.TRUE:
case Token.FALSE:
typeNameString="String_Node_Str";
break;
case Token.NULL:
case Token.OBJECTLIT:
case Token.ARRAYLIT:
typeNameString="String_Node_Str";
break;
case Token.VOID:
typeNameString="String_Node_Str";
break;
case Token.NAME:
if ("String_Node_Str".equals(argumentNode.getString())) {
typeNameString="String_Node_Str";
}
break;
}
if (typeNameString != null) {
Node newNode=Node.newString(typeNameString);
originalTypeofNode.getParent().replaceChild(originalTypeofNode,newNode);
reportCodeChange();
return newNode;
}
return originalTypeofNode;
}
Program: 18887
Project: 18887
Buggy source:
/** 
 * Try to fold   {@code left instanceof right} into {@code true}or   {@code false}.
 */
private Node tryFoldInstanceof(Node n,Node left,Node right){
  Preconditions.checkArgument(n.getType() == Token.INSTANCEOF);
  if (NodeUtil.isLiteralValue(left) && !NodeUtil.mayHaveSideEffects(right)) {
    Node replacementNode=null;
    if (NodeUtil.isImmutableValue(left)) {
      replacementNode=new Node(Token.FALSE);
    }
 else     if (right.getType() == Token.NAME && "String_Node_Str".equals(right.getString())) {
      replacementNode=new Node(Token.TRUE);
    }
    if (replacementNode != null) {
      n.getParent().replaceChild(n,replacementNode);
      reportCodeChange();
      return replacementNode;
    }
  }
  return n;
}

Fixed version (ground truth):
/** 
 * Try to fold   {@code left instanceof right} into {@code true}or   {@code false}.
 */
private Node tryFoldInstanceof(Node n,Node left,Node right){
  Preconditions.checkArgument(n.getType() == Token.INSTANCEOF);
  if (NodeUtil.isLiteralValue(left,true) && !NodeUtil.mayHaveSideEffects(right)) {
    Node replacementNode=null;
    if (NodeUtil.isImmutableValue(left)) {
      replacementNode=new Node(Token.FALSE);
    }
 else     if (right.getType() == Token.NAME && "String_Node_Str".equals(right.getString())) {
      replacementNode=new Node(Token.TRUE);
    }
    if (replacementNode != null) {
      n.getParent().replaceChild(n,replacementNode);
      reportCodeChange();
      return replacementNode;
    }
  }
  return n;
}
Program: 18889
Project: 18889
Buggy source:
/** 
 * Folds "typeof expression" based on the JSType of "expression" if the expression  has no side effects. <p>E.g., <pre> var x = 6; if (typeof(x) == "number") { } </pre> folds to <pre> var x = 6; if ("number" == "number") { } </pre> <p>This method doesn't fold literal values -- we leave that to PeepholeFoldConstants.
 */
private Node tryFoldTypeof(Node typeofNode){
  Preconditions.checkArgument(typeofNode.getType() == Token.TYPEOF);
  Preconditions.checkArgument(typeofNode.getFirstChild() != null);
  Node argumentNode=typeofNode.getFirstChild();
  if (!NodeUtil.isLiteralValue(argumentNode) && !NodeUtil.mayHaveSideEffects(argumentNode)) {
    JSType argumentType=argumentNode.getJSType();
    String typeName=null;
    if (argumentType != null) {
      if (argumentType.isObject() || argumentType.isNullType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isStringValueType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isNumberValueType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isBooleanValueType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isVoidType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isUnionType()) {
        typeName=null;
      }
      if (typeName != null) {
        Node newNode=Node.newString(typeName);
        typeofNode.getParent().replaceChild(typeofNode,newNode);
        reportCodeChange();
        return newNode;
      }
    }
  }
  return typeofNode;
}

Fixed version (ground truth):
/** 
 * Folds "typeof expression" based on the JSType of "expression" if the expression  has no side effects. <p>E.g., <pre> var x = 6; if (typeof(x) == "number") { } </pre> folds to <pre> var x = 6; if ("number" == "number") { } </pre> <p>This method doesn't fold literal values -- we leave that to PeepholeFoldConstants.
 */
private Node tryFoldTypeof(Node typeofNode){
  Preconditions.checkArgument(typeofNode.getType() == Token.TYPEOF);
  Preconditions.checkArgument(typeofNode.getFirstChild() != null);
  Node argumentNode=typeofNode.getFirstChild();
  if (!NodeUtil.isLiteralValue(argumentNode,true) && !NodeUtil.mayHaveSideEffects(argumentNode)) {
    JSType argumentType=argumentNode.getJSType();
    String typeName=null;
    if (argumentType != null) {
      if (argumentType.isObject() || argumentType.isNullType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isStringValueType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isNumberValueType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isBooleanValueType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isVoidType()) {
        typeName="String_Node_Str";
      }
 else       if (argumentType.isUnionType()) {
        typeName=null;
      }
      if (typeName != null) {
        Node newNode=Node.newString(typeName);
        typeofNode.getParent().replaceChild(typeofNode,newNode);
        reportCodeChange();
        return newNode;
      }
    }
  }
  return typeofNode;
}
Program: 18892
Project: 18892
Buggy source:
/** 
 * Look at all the property assigns to all variables in the given scope. These may or may not count as references. For example, <code> var x = {}; x.foo = 3; // not a reference. var y = foo(); y.foo = 3; // is a reference. </code>
 */
private void interpretAssigns(Scope scope){
  for (Iterator<Var> it=scope.getVars(); it.hasNext(); ) {
    Var var=it.next();
    if (!referenced.contains(var)) {
      boolean assignedToUnknownValue=false;
      boolean hasPropertyAssign=false;
      if (var.getParentNode().getType() == Token.VAR) {
        Node value=var.getInitialValue();
        assignedToUnknownValue=value != null && !NodeUtil.isLiteralValue(value);
      }
 else {
        assignedToUnknownValue=true;
      }
      for (      Assign assign : assigns.get(var)) {
        if (assign.isPropertyAssign) {
          hasPropertyAssign=true;
        }
 else         if (!NodeUtil.isLiteralValue(assign.assignNode.getLastChild())) {
          assignedToUnknownValue=true;
        }
      }
      if (assignedToUnknownValue && hasPropertyAssign) {
        markReferencedVar(var);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Look at all the property assigns to all variables in the given scope. These may or may not count as references. For example, <code> var x = {}; x.foo = 3; // not a reference. var y = foo(); y.foo = 3; // is a reference. </code>
 */
private void interpretAssigns(Scope scope){
  for (Iterator<Var> it=scope.getVars(); it.hasNext(); ) {
    Var var=it.next();
    if (!referenced.contains(var)) {
      boolean assignedToUnknownValue=false;
      boolean hasPropertyAssign=false;
      if (var.getParentNode().getType() == Token.VAR) {
        Node value=var.getInitialValue();
        assignedToUnknownValue=value != null && !NodeUtil.isLiteralValue(value,true);
      }
 else {
        assignedToUnknownValue=true;
      }
      for (      Assign assign : assigns.get(var)) {
        if (assign.isPropertyAssign) {
          hasPropertyAssign=true;
        }
 else         if (!NodeUtil.isLiteralValue(assign.assignNode.getLastChild(),true)) {
          assignedToUnknownValue=true;
        }
      }
      if (assignedToUnknownValue && hasPropertyAssign) {
        markReferencedVar(var);
      }
    }
  }
}
Program: 18893
Project: 18893
Buggy source:
public void assertNotLiteral(Node n){
  assertFalse(NodeUtil.isLiteralValue(n));
  assertFalse(NodeUtil.isImmutableValue(n));
}

Fixed version (ground truth):
public void assertNotLiteral(Node n){
  assertFalse(NodeUtil.isLiteralValue(n,true));
  assertFalse(NodeUtil.isLiteralValue(n,false));
  assertFalse(NodeUtil.isImmutableValue(n));
}
Program: 18894
Project: 18894
Buggy source:
public void assertLiteralButNotImmutable(Node n){
  assertTrue(NodeUtil.isLiteralValue(n));
  assertFalse(NodeUtil.isImmutableValue(n));
}

Fixed version (ground truth):
public void assertLiteralButNotImmutable(Node n){
  assertTrue(NodeUtil.isLiteralValue(n,true));
  assertTrue(NodeUtil.isLiteralValue(n,false));
  assertFalse(NodeUtil.isImmutableValue(n));
}
Program: 18896
Project: 18896
Buggy source:
public void assertLiteralAndImmutable(Node n){
  assertTrue(NodeUtil.isLiteralValue(n));
  assertTrue(NodeUtil.isImmutableValue(n));
}

Fixed version (ground truth):
public void assertLiteralAndImmutable(Node n){
  assertTrue(NodeUtil.isLiteralValue(n,true));
  assertTrue(NodeUtil.isLiteralValue(n,false));
  assertTrue(NodeUtil.isImmutableValue(n));
}
Program: 18897
Project: 18897
Buggy source:
public void testFoldTypeof(){
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  foldSame("String_Node_Str");
  foldSame("String_Node_Str");
}

Fixed version (ground truth):
public void testFoldTypeof(){
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  foldSame("String_Node_Str");
  foldSame("String_Node_Str");
}
Program: 18898
Project: 18898
Buggy source:
public void testFoldInstanceOf(){
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  foldSame("String_Node_Str");
  foldSame("String_Node_Str");
  foldSame("String_Node_Str");
}

Fixed version (ground truth):
public void testFoldInstanceOf(){
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
  foldSame("String_Node_Str");
  foldSame("String_Node_Str");
  foldSame("String_Node_Str");
  fold("String_Node_Str","String_Node_Str");
}
Program: 18899
Project: 18899
Buggy source:
/** 
 * Returns a version of   {@code type} that is restricted by some knowledgeabout the result of the  {@code typeof} operation..<p> The behavior of the  {@code typeof} operator can be summarized by thefollowing table: <table> <tr><th>type</th><th>result</th></tr> <tr><td> {@code undefined}</td><td>"undefined"</td></tr> <tr><td>  {@code null}</td><td>"object"</td></tr> <tr><td>  {@code boolean}</td><td>"boolean"</td></tr> <tr><td>  {@code number}</td><td>"number"</td></tr> <tr><td>  {@code string}</td><td>"string"</td></tr> <tr><td>  {@code Object} (which doesn't implement [[Call]])</td><td>"object"</td></tr> <tr><td> {@code Object} (which implements [[Call]])</td><td>"function"</td></tr> </table>
 * @param type the type to restrict
 * @param value A value known to be equal or not equal to the result of the{@code typeof} operation
 * @param resultEqualsValue {@code true} if the {@code typeOf} result is knownto equal  {@code value};   {@code false} if it is known <em>not</em> toequal  {@code value}
 * @return the restricted type or null if no version of the type matches therestriction
 */
JSType getRestrictedByTypeOfResult(JSType type,String value,boolean resultEqualsValue){
  return type == null ? null : type.visit(new RestrictByOneTypeOfResultVisitor(value,resultEqualsValue));
}

Fixed version (ground truth):
/** 
 * Returns a version of   {@code type} that is restricted by some knowledgeabout the result of the  {@code typeof} operation.<p> The behavior of the  {@code typeof} operator can be summarized by thefollowing table: <table> <tr><th>type</th><th>result</th></tr> <tr><td> {@code undefined}</td><td>"undefined"</td></tr> <tr><td>  {@code null}</td><td>"object"</td></tr> <tr><td>  {@code boolean}</td><td>"boolean"</td></tr> <tr><td>  {@code number}</td><td>"number"</td></tr> <tr><td>  {@code string}</td><td>"string"</td></tr> <tr><td>  {@code Object} (which doesn't implement [[Call]])</td><td>"object"</td></tr> <tr><td> {@code Object} (which implements [[Call]])</td><td>"function"</td></tr> </table>
 * @param type the type to restrict
 * @param value A value known to be equal or not equal to the result of the{@code typeof} operation
 * @param resultEqualsValue {@code true} if the {@code typeOf} result is knownto equal  {@code value};   {@code false} if it is known <em>not</em> toequal  {@code value}
 * @return the restricted type or null if no version of the type matches therestriction
 */
JSType getRestrictedByTypeOfResult(JSType type,String value,boolean resultEqualsValue){
  if (type == null) {
    if (resultEqualsValue) {
      JSType result=getNativeTypeForTypeOf(value);
      return result == null ? getNativeType(UNKNOWN_TYPE) : result;
    }
 else {
      return null;
    }
  }
  return type.visit(new RestrictByOneTypeOfResultVisitor(value,resultEqualsValue));
}
Program: 18900
Project: 18900
Buggy source:
/** 
 * Declares a refined type in   {@code scope} for the name represented by{@code node}. It must be possible to refine the type of the given node in the given scope, as determined by   {@link #getTypeIfRefinable}.
 */
protected void declareNameInScope(FlowScope scope,Node node,JSType type){
switch (node.getType()) {
case Token.NAME:
    scope.inferSlotType(node.getString(),type);
  break;
case Token.GETPROP:
String qualifiedName=node.getQualifiedName();
Preconditions.checkNotNull(qualifiedName);
JSType origType=node.getJSType();
origType=origType == null ? getNativeType(UNKNOWN_TYPE) : origType;
scope.inferQualifiedSlot(qualifiedName,origType,type);
break;
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Declares a refined type in   {@code scope} for the name represented by{@code node}. It must be possible to refine the type of the given node in the given scope, as determined by   {@link #getTypeIfRefinable}.
 */
protected void declareNameInScope(FlowScope scope,Node node,JSType type){
switch (node.getType()) {
case Token.NAME:
    scope.inferSlotType(node.getString(),type);
  break;
case Token.GETPROP:
String qualifiedName=node.getQualifiedName();
Preconditions.checkNotNull(qualifiedName);
JSType origType=node.getJSType();
origType=origType == null ? getNativeType(UNKNOWN_TYPE) : origType;
scope.inferQualifiedSlot(qualifiedName,origType,type);
break;
default :
throw new IllegalArgumentException("String_Node_Str" + node.toStringTree());
}
}
Program: 18901
Project: 18901
Buggy source:
@Override protected JSType caseTopType(JSType topType){
  if (resultEqualsValue) {
    if (value.equals("String_Node_Str")) {
      return getNativeType(NUMBER_TYPE);
    }
 else     if (value.equals("String_Node_Str")) {
      return getNativeType(BOOLEAN_TYPE);
    }
 else     if (value.equals("String_Node_Str")) {
      return getNativeType(STRING_TYPE);
    }
 else     if (value.equals("String_Node_Str")) {
      return getNativeType(VOID_TYPE);
    }
 else     if (value.equals("String_Node_Str")) {
      return getNativeType(U2U_CONSTRUCTOR_TYPE);
    }
  }
  return topType;
}

Fixed version (ground truth):
@Override protected JSType caseTopType(JSType topType){
  JSType result=topType;
  if (resultEqualsValue) {
    JSType typeByName=getNativeTypeForTypeOf(value);
    if (typeByName != null) {
      result=typeByName;
    }
  }
  return result;
}
Program: 18902
Project: 18902
Buggy source:
public JSType apply(TypeRestriction p){
  Visitor<JSType> visitor=p.outcome ? restrictToObjectVisitor : restrictToNotObjectVisitor;
  return p.type == null ? null : p.type.visit(visitor);
}

Fixed version (ground truth):
public JSType apply(TypeRestriction p){
  if (p.type == null) {
    return p.outcome ? getNativeType(OBJECT_TYPE) : null;
  }
  Visitor<JSType> visitor=p.outcome ? restrictToObjectVisitor : restrictToNotObjectVisitor;
  return p.type.visit(visitor);
}
Program: 18903
Project: 18903
Buggy source:
public FlowScope getPreciserScopeKnowingConditionOutcome(Node condition,FlowScope blindScope,boolean outcome){
  if (condition.getType() == CALL && condition.getChildCount() == 2) {
    Node callee=condition.getFirstChild();
    Node param=condition.getLastChild();
    if (callee.getType() == GETPROP) {
      JSType paramType=getTypeIfRefinable(param,blindScope);
      if (paramType != null) {
        Node left=callee.getFirstChild();
        Node right=callee.getLastChild();
        if (left.getType() == NAME && "String_Node_Str".equals(left.getString()) && right.getType() == STRING) {
          Function<TypeRestriction,JSType> restricter=restricters.get(right.getString());
          if (restricter != null) {
            return restrictParameter(param,paramType,blindScope,restricter,outcome);
          }
        }
      }
    }
  }
  return nextPreciserScopeKnowingConditionOutcome(condition,blindScope,outcome);
}

Fixed version (ground truth):
@Override public FlowScope getPreciserScopeKnowingConditionOutcome(Node condition,FlowScope blindScope,boolean outcome){
  if (condition.getType() == CALL && condition.getChildCount() == 2) {
    Node callee=condition.getFirstChild();
    Node param=condition.getLastChild();
    if (callee.getType() == GETPROP && param.isQualifiedName()) {
      JSType paramType=getTypeIfRefinable(param,blindScope);
      Node left=callee.getFirstChild();
      Node right=callee.getLastChild();
      if (left.getType() == NAME && "String_Node_Str".equals(left.getString()) && right.getType() == STRING) {
        Function<TypeRestriction,JSType> restricter=restricters.get(right.getString());
        if (restricter != null) {
          return restrictParameter(param,paramType,blindScope,restricter,outcome);
        }
      }
    }
  }
  return nextPreciserScopeKnowingConditionOutcome(condition,blindScope,outcome);
}
Program: 18905
Project: 18905
Buggy source:
private FlowScope traverseName(Node n,FlowScope scope){
  String varName=n.getString();
  Node value=n.getFirstChild();
  JSType type=n.getJSType();
  if (value != null) {
    scope=traverse(value,scope);
    updateScopeForTypeChange(scope,n,n.getJSType(),getJSType(value));
    return scope;
  }
 else {
    StaticSlot<JSType> var=scope.getSlot(varName);
    if (var != null && !(var.isTypeInferred() && unflowableVarNames.contains(varName))) {
      type=var.getType();
      if (type == null) {
        type=getNativeType(UNKNOWN_TYPE);
      }
    }
  }
  n.setJSType(type);
  return scope;
}

Fixed version (ground truth):
private FlowScope traverseName(Node n,FlowScope scope){
  String varName=n.getString();
  Node value=n.getFirstChild();
  JSType type=n.getJSType();
  if (value != null) {
    scope=traverse(value,scope);
    updateScopeForTypeChange(scope,n,n.getJSType(),getJSType(value));
    return scope;
  }
 else {
    StaticSlot<JSType> var=scope.getSlot(varName);
    if (var != null) {
      boolean isInferred=var.isTypeInferred();
      boolean unflowable=isInferred && unflowableVarNames.contains(varName);
      boolean nonLocalInferredSlot=isInferred && syntacticScope.getParent() != null && var == syntacticScope.getParent().getSlot(varName);
      if (!unflowable && !nonLocalInferredSlot) {
        type=var.getType();
        if (type == null) {
          type=getNativeType(UNKNOWN_TYPE);
        }
      }
    }
  }
  n.setJSType(type);
  return scope;
}
Program: 18906
Project: 18906
Buggy source:
private List<JspcWorker> initJspcWorkers(StringBuilder classpathStr,String[] jspFiles,List<String> jspFilesList) throws JasperException, IOException {
  List<JspcWorker> workers=new ArrayList<>();
  int minItem=jspFiles.length / threads;
  int maxItem=minItem + 1;
  int threadsWithMaxItems=jspFiles.length - threads * minItem;
  int start=0;
  JspCContextAccessor topJspC=initJspc(classpathStr,-1,null);
  for (int index=0; index < threads; index++) {
    int itemsCount=(index < threadsWithMaxItems ? maxItem : minItem);
    int end=start + itemsCount;
    List<String> jspFilesSubList=jspFilesList.subList(start,end);
    JspC firstJspC=initJspc(classpathStr,index,topJspC);
    JspcWorker worker=new JspcWorker(firstJspC,jspFilesSubList);
    workers.add(worker);
    start=end;
    getLog().info("String_Node_Str" + (index + 1) + "String_Node_Str"+ jspFilesSubList.size());
  }
  return workers;
}

Fixed version (ground truth):
private List<JspcWorker> initJspcWorkers(StringBuilder classpathStr,String[] jspFiles,List<String> jspFilesList) throws JasperException, IOException {
  List<JspcWorker> workers=new ArrayList<>();
  int minItem=jspFiles.length / threads;
  int maxItem=minItem + 1;
  int threadsWithMaxItems=jspFiles.length - threads * minItem;
  int start=0;
  JspCContextAccessor topJspC=initJspc(classpathStr,-1,null);
  for (int index=0; index < threads; index++) {
    int threadNumber=index + 1;
    int itemsCount=(index < threadsWithMaxItems ? maxItem : minItem);
    int end=start + itemsCount;
    List<String> jspFilesSubList=jspFilesList.subList(start,end);
    if (jspFilesSubList.isEmpty()) {
      getLog().info("String_Node_Str" + threadNumber + "String_Node_Str");
    }
 else {
      JspC firstJspC=initJspc(classpathStr,index,topJspC);
      JspcWorker worker=new JspcWorker(firstJspC,jspFilesSubList);
      workers.add(worker);
      start=end;
      getLog().info("String_Node_Str" + threadNumber + "String_Node_Str"+ jspFilesSubList.size());
    }
  }
  return workers;
}
Program: 18907
Project: 18907
Buggy source:
private JspCContextAccessor initJspc(StringBuilder classpathStr,int threadIndex,JspCContextAccessor topJspC) throws IOException, JasperException {
  JspCContextAccessor jspc=new JspCContextAccessor();
  jspc.setWebXmlFragment(getwebXmlFragmentFilename(threadIndex));
  jspc.setUriroot(webAppSourceDirectory);
  jspc.setPackage(packageRoot);
  jspc.setOutputDir(generatedClasses);
  jspc.setValidateXml(validateXml);
  jspc.setClassPath(classpathStr.toString());
  jspc.setCompile(true);
  jspc.setSmapSuppressed(suppressSmap);
  jspc.setSmapDumped(!suppressSmap);
  jspc.setJavaEncoding(javaEncoding);
  jspc.setFailOnError(stopAtFirstError);
  jspc.setPoolingEnabled(enableJspTagPooling);
  jspc.setTrimSpaces(trimSpaces);
  jspc.setGenStringAsCharArray(genStringAsCharArray);
  jspc.setCompilerSourceVM(compilerVersion);
  jspc.setCompilerTargetVM(compilerVersion);
  jspc.setcompilerClass(compilerClass);
  jspc.setResourcesCache(resourcesCache);
  if (topJspC == null) {
    jspc.initClassLoader();
    jspc.initServletContext();
  }
 else {
    jspc.initContext(topJspC);
  }
  getLog().info("String_Node_Str" + StringUtils.join(includes,"String_Node_Str"));
  if (excludes != null) {
    getLog().info("String_Node_Str" + StringUtils.join(excludes,"String_Node_Str"));
  }
  if (verbose) {
    jspc.setVerbose(99);
  }
 else {
    jspc.setVerbose(0);
  }
  return jspc;
}

Fixed version (ground truth):
private JspCContextAccessor initJspc(StringBuilder classpathStr,int threadIndex,JspCContextAccessor topJspC) throws IOException, JasperException {
  JspCContextAccessor jspc=new JspCContextAccessor();
  jspc.setWebXmlFragment(getwebXmlFragmentFilename(threadIndex));
  jspc.setUriroot(webAppSourceDirectory);
  jspc.setPackage(packageRoot);
  jspc.setOutputDir(generatedClasses);
  jspc.setValidateXml(validateXml);
  jspc.setClassPath(classpathStr.toString());
  jspc.setCompile(true);
  jspc.setSmapSuppressed(suppressSmap);
  jspc.setSmapDumped(!suppressSmap);
  jspc.setJavaEncoding(javaEncoding);
  jspc.setFailOnError(stopAtFirstError);
  jspc.setPoolingEnabled(enableJspTagPooling);
  jspc.setTrimSpaces(trimSpaces);
  jspc.setGenStringAsCharArray(genStringAsCharArray);
  jspc.setCompilerSourceVM(compilerVersion);
  jspc.setCompilerTargetVM(compilerVersion);
  jspc.setcompilerClass(compilerClass);
  jspc.setResourcesCache(resourcesCache);
  if (topJspC == null) {
    jspc.initClassLoader();
    jspc.initServletContext();
  }
 else {
    jspc.initContext(topJspC);
  }
  if (topJspC != null) {
    getLog().info("String_Node_Str" + StringUtils.join(includes,"String_Node_Str"));
    if (excludes != null) {
      getLog().info("String_Node_Str" + StringUtils.join(excludes,"String_Node_Str"));
    }
  }
  if (verbose) {
    jspc.setVerbose(99);
  }
 else {
    jspc.setVerbose(0);
  }
  return jspc;
}
Program: 18908
Project: 18908
Buggy source:
/** 
 * Set up the execution classpath for Jasper. <p> Put everything in the classesDirectory and all of the dependencies on the classpath.
 * @param urls a list to which to add the urls of the dependencies
 * @throws IOException
 */
private void setUpClassPath(List<URL> urls) throws IOException {
  String classesDir=classesDirectory.getCanonicalPath();
  classesDir=classesDir + (classesDir.endsWith(File.pathSeparator) ? "String_Node_Str" : File.separator);
  urls.add(new File(classesDir).toURI().toURL());
  if (getLog().isDebugEnabled()) {
    getLog().debug("String_Node_Str" + classesDir);
  }
  for (Iterator<?> iter=project.getArtifacts().iterator(); iter.hasNext(); ) {
    Artifact artifact=(Artifact)iter.next();
    if (!Artifact.SCOPE_TEST.equals(artifact.getScope())) {
      String filePath=artifact.getFile().getCanonicalPath();
      if (getLog().isDebugEnabled()) {
        getLog().debug("String_Node_Str" + filePath);
      }
      urls.add(artifact.getFile().toURI().toURL());
    }
  }
}

Fixed version (ground truth):
/** 
 * Set up the execution classpath for Jasper. <p> Put everything in the classesDirectory and all of the dependencies on the classpath.
 * @param urls a list to which to add the urls of the dependencies
 * @throws IOException
 */
private void setUpClassPath(List<URL> urls) throws IOException {
  String classesDir=classesDirectory.getCanonicalPath();
  classesDir=classesDir + (classesDir.endsWith(File.pathSeparator) ? "String_Node_Str" : File.separator);
  urls.add(new File(classesDir).toURL());
  if (getLog().isDebugEnabled()) {
    getLog().debug("String_Node_Str" + classesDir);
  }
  for (Iterator<?> iter=project.getArtifacts().iterator(); iter.hasNext(); ) {
    Artifact artifact=(Artifact)iter.next();
    if (!Artifact.SCOPE_TEST.equals(artifact.getScope())) {
      String filePath=artifact.getFile().getCanonicalPath();
      if (getLog().isDebugEnabled()) {
        getLog().debug("String_Node_Str" + filePath);
      }
      urls.add(artifact.getFile().toURL());
    }
  }
}
Program: 18909
Project: 18909
Buggy source:
private List<JspcWorker> initJspcWorkers(StringBuilder classpathStr,String[] jspFiles,List<String> jspFilesList){
  List<JspcWorker> workers=new ArrayList<>();
  int minItem=jspFiles.length / threads;
  int maxItem=minItem + 1;
  int threadsWithMaxItems=jspFiles.length - threads * minItem;
  int start=0;
  for (int index=0; index < threads; index++) {
    int itemsCount=(index < threadsWithMaxItems ? maxItem : minItem);
    int end=start + itemsCount;
    List<String> jspFilesSubList=jspFilesList.subList(start,end);
    JspcWorker worker=new JspcWorker(initJspc(classpathStr,index),jspFilesSubList);
    workers.add(worker);
    start=end;
    getLog().info("String_Node_Str" + (index + 1) + "String_Node_Str"+ jspFilesSubList.size());
  }
  return workers;
}

Fixed version (ground truth):
private List<JspcWorker> initJspcWorkers(StringBuilder classpathStr,String[] jspFiles,List<String> jspFilesList) throws JasperException, IOException {
  List<JspcWorker> workers=new ArrayList<>();
  int minItem=jspFiles.length / threads;
  int maxItem=minItem + 1;
  int threadsWithMaxItems=jspFiles.length - threads * minItem;
  int start=0;
  JspCContextAccessor topJspC=initJspc(classpathStr,-1,null);
  for (int index=0; index < threads; index++) {
    int itemsCount=(index < threadsWithMaxItems ? maxItem : minItem);
    int end=start + itemsCount;
    List<String> jspFilesSubList=jspFilesList.subList(start,end);
    JspC firstJspC=initJspc(classpathStr,index,topJspC);
    JspcWorker worker=new JspcWorker(firstJspC,jspFilesSubList);
    workers.add(worker);
    start=end;
    getLog().info("String_Node_Str" + (index + 1) + "String_Node_Str"+ jspFilesSubList.size());
  }
  return workers;
}
Program: 18910
Project: 18910
Buggy source:
private JspC initJspc(StringBuilder classpathStr,int threadIndex){
  JspC jspc=new JspC();
  jspc.setWebXmlFragment(getwebXmlFragmentFilename(threadIndex));
  jspc.setUriroot(webAppSourceDirectory);
  jspc.setPackage(packageRoot);
  jspc.setOutputDir(generatedClasses);
  jspc.setValidateXml(validateXml);
  jspc.setClassPath(classpathStr.toString());
  jspc.setCompile(true);
  jspc.setSmapSuppressed(suppressSmap);
  jspc.setSmapDumped(!suppressSmap);
  jspc.setJavaEncoding(javaEncoding);
  jspc.setFailOnError(stopAtFirstError);
  jspc.setPoolingEnabled(enableJspTagPooling);
  jspc.setTrimSpaces(trimSpaces);
  jspc.setGenStringAsCharArray(genStringAsCharArray);
  jspc.setCompilerSourceVM(compilerVersion);
  jspc.setCompilerTargetVM(compilerVersion);
  getLog().info("String_Node_Str" + StringUtils.join(includes,"String_Node_Str"));
  if (excludes != null) {
    getLog().info("String_Node_Str" + StringUtils.join(excludes,"String_Node_Str"));
  }
  if (verbose) {
    jspc.setVerbose(99);
  }
 else {
    jspc.setVerbose(0);
  }
  return jspc;
}

Fixed version (ground truth):
private JspCContextAccessor initJspc(StringBuilder classpathStr,int threadIndex,JspCContextAccessor topJspC) throws IOException, JasperException {
  JspCContextAccessor jspc=new JspCContextAccessor();
  jspc.setWebXmlFragment(getwebXmlFragmentFilename(threadIndex));
  jspc.setUriroot(webAppSourceDirectory);
  jspc.setPackage(packageRoot);
  jspc.setOutputDir(generatedClasses);
  jspc.setValidateXml(validateXml);
  jspc.setClassPath(classpathStr.toString());
  jspc.setCompile(true);
  jspc.setSmapSuppressed(suppressSmap);
  jspc.setSmapDumped(!suppressSmap);
  jspc.setJavaEncoding(javaEncoding);
  jspc.setFailOnError(stopAtFirstError);
  jspc.setPoolingEnabled(enableJspTagPooling);
  jspc.setTrimSpaces(trimSpaces);
  jspc.setGenStringAsCharArray(genStringAsCharArray);
  jspc.setCompilerSourceVM(compilerVersion);
  jspc.setCompilerTargetVM(compilerVersion);
  if (topJspC == null) {
    jspc.initClassLoader();
    jspc.initServletContext();
  }
 else {
    jspc.setContext(topJspC.getContext());
  }
  getLog().info("String_Node_Str" + StringUtils.join(includes,"String_Node_Str"));
  if (excludes != null) {
    getLog().info("String_Node_Str" + StringUtils.join(excludes,"String_Node_Str"));
  }
  if (verbose) {
    jspc.setVerbose(99);
  }
 else {
    jspc.setVerbose(0);
  }
  return jspc;
}
Program: 18911
Project: 18911
Buggy source:
@Test public void should_return_webfrag_equal_to_reference_when_executeMojo_on_project_one_jsp_with_no_options() throws Exception {
  File oneJspProject=new File("String_Node_Str");
  Path expectedWebfrag=Paths.get("String_Node_Str");
  rule.executeMojo(oneJspProject,"String_Node_Str");
  Path webfrag=Paths.get("String_Node_Str");
  assertThat(Files.readAllBytes(webfrag)).isEqualTo(Files.readAllBytes(expectedWebfrag));
}

Fixed version (ground truth):
@Test public void should_return_webfrag_equal_to_reference_when_executeMojo_on_project_one_jsp_with_no_options() throws Exception {
  File oneJspProject=new File("String_Node_Str");
  Path expectedWebfrag=Paths.get("String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  rule.executeMojo(oneJspProject,"String_Node_Str");
  Path webfrag=Paths.get("String_Node_Str");
  byte[] actualWebfrag=Files.readAllBytes(webfrag);
  byte[] expectedWebFrag=Files.readAllBytes(expectedWebfrag);
  String actualWebFragStr=new String(actualWebfrag).replaceAll("String_Node_Str","String_Node_Str");
  String expectedWebFragStr=new String(expectedWebFrag);
  assertThat(actualWebFragStr).isEqualTo(expectedWebFragStr);
}
Program: 18912
Project: 18912
Buggy source:
private List<JspcWorker> initJspcWorkers(StringBuilder classpathStr,String[] jspFiles,List<String> jspFilesList){
  List<JspcWorker> workers=new ArrayList<>();
  int minItem=jspFiles.length / threads;
  int maxItem=minItem + 1;
  int threadsWithMaxItems=jspFiles.length - threads * minItem;
  int start=0;
  for (int index=0; index < threads; index++) {
    int itemsCount=(index < threadsWithMaxItems ? maxItem : minItem);
    int end=start + itemsCount;
    List<String> jspFilesSubList=jspFilesList.subList(start,end);
    JspcWorker worker=new JspcWorker(initJspc(classpathStr,index),jspFilesSubList);
    workers.add(worker);
    start=end;
    getLog().info("String_Node_Str" + (index + 1) + "String_Node_Str"+ jspFilesSubList.size());
  }
  return workers;
}

Fixed version (ground truth):
private List<JspcWorker> initJspcWorkers(StringBuilder classpathStr,String[] jspFiles,List<String> jspFilesList) throws JasperException, IOException {
  List<JspcWorker> workers=new ArrayList<>();
  int minItem=jspFiles.length / threads;
  int maxItem=minItem + 1;
  int threadsWithMaxItems=jspFiles.length - threads * minItem;
  int start=0;
  JspCContextAccessor topJspC=initJspc(classpathStr,-1,null);
  for (int index=0; index < threads; index++) {
    int itemsCount=(index < threadsWithMaxItems ? maxItem : minItem);
    int end=start + itemsCount;
    List<String> jspFilesSubList=jspFilesList.subList(start,end);
    JspC firstJspC=initJspc(classpathStr,index,topJspC);
    JspcWorker worker=new JspcWorker(firstJspC,jspFilesSubList);
    workers.add(worker);
    start=end;
    getLog().info("String_Node_Str" + (index + 1) + "String_Node_Str"+ jspFilesSubList.size());
  }
  return workers;
}
Program: 18913
Project: 18913
Buggy source:
private JspC initJspc(StringBuilder classpathStr,int threadIndex){
  JspC jspc=new JspC();
  jspc.setWebXmlFragment(getwebXmlFragmentFilename(threadIndex));
  jspc.setUriroot(webAppSourceDirectory);
  jspc.setPackage(packageRoot);
  jspc.setOutputDir(generatedClasses);
  jspc.setValidateXml(validateXml);
  jspc.setClassPath(classpathStr.toString());
  jspc.setCompile(true);
  jspc.setSmapSuppressed(suppressSmap);
  jspc.setSmapDumped(!suppressSmap);
  jspc.setJavaEncoding(javaEncoding);
  jspc.setFailOnError(stopAtFirstError);
  jspc.setPoolingEnabled(enableJspTagPooling);
  jspc.setTrimSpaces(trimSpaces);
  jspc.setGenStringAsCharArray(genStringAsCharArray);
  jspc.setCompilerSourceVM(compilerVersion);
  jspc.setCompilerTargetVM(compilerVersion);
  getLog().info("String_Node_Str" + StringUtils.join(includes,"String_Node_Str"));
  if (excludes != null) {
    getLog().info("String_Node_Str" + StringUtils.join(excludes,"String_Node_Str"));
  }
  if (verbose) {
    jspc.setVerbose(99);
  }
 else {
    jspc.setVerbose(0);
  }
  return jspc;
}

Fixed version (ground truth):
private JspCContextAccessor initJspc(StringBuilder classpathStr,int threadIndex,JspCContextAccessor topJspC) throws IOException, JasperException {
  JspCContextAccessor jspc=new JspCContextAccessor();
  jspc.setWebXmlFragment(getwebXmlFragmentFilename(threadIndex));
  jspc.setUriroot(webAppSourceDirectory);
  jspc.setPackage(packageRoot);
  jspc.setOutputDir(generatedClasses);
  jspc.setValidateXml(validateXml);
  jspc.setClassPath(classpathStr.toString());
  jspc.setCompile(true);
  jspc.setSmapSuppressed(suppressSmap);
  jspc.setSmapDumped(!suppressSmap);
  jspc.setJavaEncoding(javaEncoding);
  jspc.setFailOnError(stopAtFirstError);
  jspc.setPoolingEnabled(enableJspTagPooling);
  jspc.setTrimSpaces(trimSpaces);
  jspc.setGenStringAsCharArray(genStringAsCharArray);
  jspc.setCompilerSourceVM(compilerVersion);
  jspc.setCompilerTargetVM(compilerVersion);
  if (topJspC == null) {
    jspc.initClassLoader();
    jspc.initServletContext();
  }
 else {
    jspc.initContext(topJspC);
  }
  getLog().info("String_Node_Str" + StringUtils.join(includes,"String_Node_Str"));
  if (excludes != null) {
    getLog().info("String_Node_Str" + StringUtils.join(excludes,"String_Node_Str"));
  }
  if (verbose) {
    jspc.setVerbose(99);
  }
 else {
    jspc.setVerbose(0);
  }
  return jspc;
}
Program: 18914
Project: 18914
Buggy source:
@Test public void should_return_webfrag_equal_to_reference_when_executeMojo_on_project_one_jsp_with_no_options() throws Exception {
  File oneJspProject=new File("String_Node_Str");
  Path expectedWebfrag=Paths.get("String_Node_Str");
  rule.executeMojo(oneJspProject,"String_Node_Str");
  Path webfrag=Paths.get("String_Node_Str");
  assertThat(Files.readAllBytes(webfrag)).isEqualTo(Files.readAllBytes(expectedWebfrag));
}

Fixed version (ground truth):
@Test public void should_return_webfrag_equal_to_reference_when_executeMojo_on_project_one_jsp_with_no_options() throws Exception {
  File oneJspProject=new File("String_Node_Str");
  Path expectedWebfrag=Paths.get("String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  rule.executeMojo(oneJspProject,"String_Node_Str");
  Path webfrag=Paths.get("String_Node_Str");
  byte[] actualWebfrag=Files.readAllBytes(webfrag);
  byte[] expectedWebFrag=Files.readAllBytes(expectedWebfrag);
  String actualWebFragStr=new String(actualWebfrag).replaceAll("String_Node_Str","String_Node_Str");
  String expectedWebFragStr=new String(expectedWebFrag);
  assertThat(actualWebFragStr).isEqualTo(expectedWebFragStr);
}
Program: 18916
Project: 18916
Buggy source:
protected void printImages(Set<? extends Image> images,String indent,PrintStream out){
  out.println(String.format(IMAGEFORMAT,indent,"String_Node_Str","String_Node_Str","String_Node_Str"));
  for (  Image image : images) {
    String id=image.getId();
    String location=image.getLocation() != null ? image.getLocation().getId() : "String_Node_Str";
    String description=image.getDescription();
    out.println(String.format(IMAGEFORMAT,indent,id,location,description));
    cacheProvider.getProviderCacheForType("String_Node_Str").put(image.getProviderId(),image.getId());
  }
}

Fixed version (ground truth):
protected void printImages(Set<? extends Image> images,String indent,PrintStream out){
  out.println(String.format(IMAGEFORMAT,indent,"String_Node_Str","String_Node_Str","String_Node_Str"));
  for (  Image image : images) {
    String id=image.getId();
    String location=image.getLocation() != null ? image.getLocation().getId() : "String_Node_Str";
    String description=image.getDescription();
    out.println(String.format(IMAGEFORMAT,indent,id,location,description));
    cacheProvider.getProviderCacheForType(Constants.IMAGE_CACHE).put(image.getProviderId(),image.getId());
  }
}
Program: 18917
Project: 18917
Buggy source:
protected void printNodes(Set<? extends ComputeMetadata> nodes,String indent,PrintStream out){
  out.println(String.format(NODEFORMAT,indent,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  for (  ComputeMetadata metadata : nodes) {
    NodeMetadata node=(NodeMetadata)metadata;
    out.println(String.format(NODEFORMAT,indent,node.getId(),node.getLocation().getId(),node.getHardware().getId(),node.getGroup(),node.getState().toString().toLowerCase()));
    cacheProvider.getProviderCacheForType("String_Node_Str").put(node.getProviderId(),node.getId());
    cacheProvider.getProviderCacheForType("String_Node_Str").put(node.getProviderId(),node.getGroup());
  }
}

Fixed version (ground truth):
protected void printNodes(Set<? extends ComputeMetadata> nodes,String indent,PrintStream out){
  out.println(String.format(NODEFORMAT,indent,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  for (  ComputeMetadata metadata : nodes) {
    NodeMetadata node=(NodeMetadata)metadata;
    out.println(String.format(NODEFORMAT,indent,node.getId(),node.getLocation().getId(),node.getHardware().getId(),node.getGroup(),node.getState().toString().toLowerCase()));
    cacheProvider.getProviderCacheForType(Constants.GROUP).put(node.getProviderId(),node.getGroup());
  }
}
Program: 18918
Project: 18918
Buggy source:
protected Set<? extends Location> getAllLocations(ComputeService computeService){
  Set<Location> all=new HashSet<Location>();
  for (  Location loc : computeService.listAssignableLocations()) {
    for (Location p=loc; p != null; p=p.getParent()) {
      all.add(p);
      cacheProvider.getProviderCacheForType("String_Node_Str").put(computeService.getContext().getProviderSpecificContext().getId(),p.getId());
    }
  }
  return all;
}

Fixed version (ground truth):
protected Set<? extends Location> getAllLocations(ComputeService computeService){
  Set<Location> all=new HashSet<Location>();
  for (  Location loc : computeService.listAssignableLocations()) {
    for (Location p=loc; p != null; p=p.getParent()) {
      all.add(p);
      cacheProvider.getProviderCacheForType(Constants.LOCATION_CACHE).put(computeService.getContext().getProviderSpecificContext().getId(),p.getId());
    }
  }
  return all;
}
Program: 18919
Project: 18919
Buggy source:
protected void printHardwares(Set<? extends Hardware> hardwares,String indent,PrintStream out){
  out.println(String.format(HARDWAREFORMAT,indent,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  for (  Hardware hardware : hardwares) {
    out.println(String.format(HARDWAREFORMAT,indent,hardware.getId(),getCpuUnits(hardware),getCpuCores(hardware),getMemory(hardware)));
  }
}

Fixed version (ground truth):
protected void printHardwares(Set<? extends Hardware> hardwares,String indent,PrintStream out){
  out.println(String.format(HARDWAREFORMAT,indent,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  for (  Hardware hardware : hardwares) {
    out.println(String.format(HARDWAREFORMAT,indent,hardware.getId(),getCpuUnits(hardware),getCpuCores(hardware),getMemory(hardware)));
    cacheProvider.getProviderCacheForType(Constants.HARDWARE_CACHE).put(hardware.getProviderId(),hardware.getId());
  }
}
Program: 18920
Project: 18920
Buggy source:
@Override protected Object doExecute() throws Exception {
  Set<? extends NodeMetadata> nodeMetadatas=getComputeService().destroyNodesMatching(new Predicate<NodeMetadata>(){
    @Override public boolean apply(    @Nullable NodeMetadata input){
      return input.getGroup().contains(group);
    }
  }
);
  if (nodeMetadatas != null && !nodeMetadatas.isEmpty()) {
    System.out.println("String_Node_Str");
    printNodes(nodeMetadatas,"String_Node_Str",System.out);
  }
  return null;
}

Fixed version (ground truth):
@Override protected Object doExecute() throws Exception {
  Set<? extends NodeMetadata> nodeMetadatas=getComputeService().destroyNodesMatching(new Predicate<NodeMetadata>(){
    @Override public boolean apply(    @Nullable NodeMetadata input){
      return input.getGroup().contains(group);
    }
  }
);
  if (nodeMetadatas != null && !nodeMetadatas.isEmpty()) {
    System.out.println("String_Node_Str");
    printNodes(nodeMetadatas,"String_Node_Str",System.out);
  }
  for (  NodeMetadata node : nodeMetadatas) {
    cacheProvider.getProviderCacheForType(Constants.ACTIVE_NODE_CACHE).remove(getComputeService().getContext().getProviderSpecificContext().getId(),node.getId());
    cacheProvider.getProviderCacheForType(Constants.INACTIVE_NODE_CACHE).remove(getComputeService().getContext().getProviderSpecificContext().getId(),node.getId());
    cacheProvider.getProviderCacheForType(Constants.SUSPENDED_NODE_CACHE).remove(getComputeService().getContext().getProviderSpecificContext().getId(),node.getId());
  }
  return null;
}
Program: 18922
Project: 18922
Buggy source:
@Override protected Object doExecute() throws Exception {
  Set<? extends NodeMetadata> nodeMetadatas=getComputeService().destroyNodesMatching(new Predicate<NodeMetadata>(){
    @Override public boolean apply(    @Nullable NodeMetadata input){
      return true;
    }
  }
);
  if (nodeMetadatas != null && !nodeMetadatas.isEmpty()) {
    System.out.println("String_Node_Str");
    printNodes(nodeMetadatas,"String_Node_Str",System.out);
  }
  return null;
}

Fixed version (ground truth):
@Override protected Object doExecute() throws Exception {
  Set<? extends NodeMetadata> nodeMetadatas=getComputeService().destroyNodesMatching(new Predicate<NodeMetadata>(){
    @Override public boolean apply(    @Nullable NodeMetadata input){
      return true;
    }
  }
);
  if (nodeMetadatas != null && !nodeMetadatas.isEmpty()) {
    System.out.println("String_Node_Str");
    printNodes(nodeMetadatas,"String_Node_Str",System.out);
  }
  for (  NodeMetadata node : nodeMetadatas) {
    cacheProvider.getProviderCacheForType(Constants.ACTIVE_NODE_CACHE).remove(getComputeService().getContext().getProviderSpecificContext().getId(),node.getId());
    cacheProvider.getProviderCacheForType(Constants.INACTIVE_NODE_CACHE).remove(getComputeService().getContext().getProviderSpecificContext().getId(),node.getId());
    cacheProvider.getProviderCacheForType(Constants.SUSPENDED_NODE_CACHE).remove(getComputeService().getContext().getProviderSpecificContext().getId(),node.getId());
  }
  return null;
}