nus-yam/ex-repair huggingface dataset:
Program: 185367
Project: 185367
Buggy source:
/** 
 * Finds param with DelegatesTo.Target annotation that has matching value string.
 */
private int indexOfDelegatesToTarget(Parameter[] parameters,String target){
  for (int i=0, n=parameters.length; i < n; i+=1) {
    List<AnnotationNode> annotations=parameters[i].getAnnotations();
    if (annotations != null && !annotations.isEmpty()) {
      for (      AnnotationNode annotation : annotations) {
        if (annotation.getClassNode().getName().equals("String_Node_Str")) {
          if (annotation.getMember("String_Node_Str") instanceof ConstantExpression) {
            String value=annotation.getMember("String_Node_Str").getText();
            if (value.equals(target)) {
              return i;
            }
          }
        }
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Finds param with DelegatesTo.Target annotation that has matching value string.
 */
private static int indexOfDelegatesToTarget(Parameter[] parameters,String target,CompilerConfiguration config){
  for (int i=0, n=parameters.length; i < n; i+=1) {
    List<AnnotationNode> annotations=parameters[i].getAnnotations();
    if (annotations != null && !annotations.isEmpty()) {
      for (      AnnotationNode annotation : annotations) {
        if (annotation.getClassNode().getName().equals("String_Node_Str")) {
          String value=(String)evaluateExpression(castX(STRING_CLASS_NODE,annotation.getMember("String_Node_Str")),config);
          if (value.equals(target)) {
            return i;
          }
        }
      }
    }
  }
  return -1;
}
Program: 185369
Project: 185369
Buggy source:
void bubbleUpdates(){
  if (dirtyNames != null && !dirtyNames.isEmpty() && !isTerminal() && !isTopLevel()) {
    for (    String name : dirtyNames) {
      VariableInfo info=nameVariableMap.get(name);
      parent.updateVariable(name,info.type,info.declaringType);
    }
    dirtyNames=null;
  }
}

Fixed version (ground truth):
void bubbleUpdates(){
  if (dirtyNames != null && !dirtyNames.isEmpty() && !isTerminal() && !isTopLevel()) {
    for (    String name : dirtyNames) {
      VariableInfo info=nameVariableMap.get(name);
      parent.updateVariable(name,info.type,info.declaringType);
    }
  }
  dirtyNames=null;
}
Program: 185370
Project: 185370
Buggy source:
@Test public void testLocalVar8a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar8a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185371
Project: 185371
Buggy source:
@Test @Ignore("String_Node_Str") public void testLocalVar9a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar9a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185372
Project: 185372
Buggy source:
@Test @Ignore("String_Node_Str") public void testInstanceOf11(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  int start=contents.indexOf("String_Node_Str");
  int end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testInstanceOf11(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  int start=contents.indexOf("String_Node_Str");
  int end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
  start=contents.indexOf("String_Node_Str",end + 1);
  end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
}
Program: 185373
Project: 185373
Buggy source:
@Test @Ignore("String_Node_Str") public void testLocalVar7a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar7a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185374
Project: 185374
Buggy source:
@Test @Ignore("String_Node_Str") public void testLocalVar11(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar11(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185375
Project: 185375
Buggy source:
@Test @Ignore("String_Node_Str") public void testLocalVar10(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar10(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185376
Project: 185376
Buggy source:
@Test @Ignore("String_Node_Str") public void testLocalVar7(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar7(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185377
Project: 185377
Buggy source:
@Test @Ignore("String_Node_Str") public void testLocalVar9(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar9(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185378
Project: 185378
Buggy source:
@Test public void testLocalVar8(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar8(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185379
Project: 185379
Buggy source:
@Test @Ignore("String_Node_Str") public void testLocalVar10a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar10a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185380
Project: 185380
Buggy source:
@Override public void visitIfElse(IfStatement node){
  node.getBooleanExpression().visit(this);
  Map<String,ClassNode[]> types=inferInstanceOfType(node.getBooleanExpression(),scopes.getLast());
  scopes.add(new VariableScope(scopes.getLast(),node.getIfBlock(),false));
  for (  Map.Entry<String,ClassNode[]> entry : types.entrySet()) {
    if (entry.getValue().length > 0 && entry.getValue()[0] != null) {
      scopes.getLast().updateVariableSoft(entry.getKey(),entry.getValue()[0]);
    }
  }
  node.getIfBlock().visit(this);
  scopes.removeLast().bubbleUpdates();
  scopes.add(new VariableScope(scopes.getLast(),node.getElseBlock(),false));
  for (  Map.Entry<String,ClassNode[]> entry : types.entrySet()) {
    if (entry.getValue().length > 1 && entry.getValue()[1] != null) {
      scopes.getLast().updateVariableSoft(entry.getKey(),entry.getValue()[1]);
    }
  }
  node.getElseBlock().visit(this);
  scopes.removeLast().bubbleUpdates();
}

Fixed version (ground truth):
@Override public void visitIfElse(IfStatement node){
  scopes.add(new VariableScope(scopes.getLast(),node,false){
    @Override public void updateVariable(    String name,    ClassNode type,    ClassNode declaringType){
      type=WideningCategories.lowestUpperBound(type,lookupName(name).type);
      super.updateVariable(name,type,declaringType);
    }
  }
);
  node.getBooleanExpression().visit(this);
  Map<String,ClassNode[]> types=inferInstanceOfType(node.getBooleanExpression(),scopes.getLast());
  scopes.add(new VariableScope(scopes.getLast(),node.getIfBlock(),false));
  for (  Map.Entry<String,ClassNode[]> entry : types.entrySet()) {
    if (entry.getValue().length > 0 && entry.getValue()[0] != null) {
      scopes.getLast().updateVariableSoft(entry.getKey(),entry.getValue()[0]);
    }
  }
  node.getIfBlock().visit(this);
  VariableScope trueScope=scopes.removeLast();
  scopes.add(new VariableScope(scopes.getLast(),node.getElseBlock(),false));
  for (  Map.Entry<String,ClassNode[]> entry : types.entrySet()) {
    if (entry.getValue().length > 1 && entry.getValue()[1] != null) {
      scopes.getLast().updateVariableSoft(entry.getKey(),entry.getValue()[1]);
    }
  }
  node.getElseBlock().visit(this);
  VariableScope falseScope=scopes.removeLast();
  trueScope.bubbleUpdates();
  falseScope.bubbleUpdates();
  scopes.removeLast().bubbleUpdates();
}
Program: 185381
Project: 185381
Buggy source:
@Test public void testDGSMDeclaring3(){
  String contents="String_Node_Str";
  String target="String_Node_Str";
  int start=contents.lastIndexOf(target), until=start + target.length();
  assertUnknownConfidence(contents,start,until,"String_Node_Str",false);
}

Fixed version (ground truth):
@Test public void testDGSMDeclaring3(){
  String contents="String_Node_Str";
  String target="String_Node_Str";
  int start=contents.lastIndexOf(target), until=start + target.length();
  assertDeclaringType(contents,start,until,"String_Node_Str");
}
Program: 185382
Project: 185382
Buggy source:
@Test public void testDGMDeclaring3(){
  String contents="String_Node_Str";
  String str="String_Node_Str";
  int start=contents.lastIndexOf(str);
  int end=start + str.length();
  assertDeclaringType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDGMDeclaring3(){
  String contents="String_Node_Str";
  String target="String_Node_Str";
  int start=contents.lastIndexOf(target), until=start + target.length();
  assertDeclaringType(contents,start,until,"String_Node_Str");
}
Program: 185383
Project: 185383
Buggy source:
@Test public void testDGMDeclaring2(){
  String contents="String_Node_Str";
  String str="String_Node_Str";
  int start=contents.lastIndexOf(str);
  int end=start + str.length();
  assertDeclaringType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDGMDeclaring2(){
  String contents="String_Node_Str";
  String target="String_Node_Str";
  int start=contents.lastIndexOf(target), until=start + target.length();
  assertDeclaringType(contents,start,until,"String_Node_Str");
}
Program: 185384
Project: 185384
Buggy source:
@Test public void testDGMDeclaring(){
  String contents="String_Node_Str";
  String str="String_Node_Str";
  int start=contents.lastIndexOf(str);
  int end=start + str.length();
  assertDeclaringType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDGMDeclaring(){
  String contents="String_Node_Str";
  String target="String_Node_Str";
  int start=contents.lastIndexOf(target), until=start + target.length();
  assertDeclaringType(contents,start,until,"String_Node_Str");
}
Program: 185385
Project: 185385
Buggy source:
protected static boolean isCompatibleCategoryMethod(MethodNode method,ClassNode firstArgumentType){
  if (method.isStatic()) {
    Parameter[] paramters=method.getParameters();
    if (paramters != null && paramters.length > 0) {
      ClassNode parameterType=paramters[0].getType();
      if (VariableScope.DGSM_CLASS_NODE.equals(method.getDeclaringClass())) {
        parameterType=VariableScope.newClassClassNode(parameterType);
      }
      if (isTypeCompatible(firstArgumentType,parameterType)) {
        return !isDefaultGroovyMethod(method) || !GroovyUtils.isDeprecated(method);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
protected static boolean isCompatibleCategoryMethod(MethodNode method,ClassNode firstArgumentType){
  if (method.isStatic()) {
    Parameter[] paramters=method.getParameters();
    if (paramters != null && paramters.length > 0) {
      ClassNode parameterType=paramters[0].getType();
      if (VariableScope.CLASS_CLASS_NODE.equals(firstArgumentType) && VariableScope.DGSM_CLASS_NODE.equals(method.getDeclaringClass())) {
        parameterType=VariableScope.newClassClassNode(parameterType);
      }
      if (isTypeCompatible(firstArgumentType,parameterType)) {
        return !isDefaultGroovyMethod(method) || !GroovyUtils.isDeprecated(method);
      }
    }
  }
  return false;
}
Program: 185387
Project: 185387
Buggy source:
@Test public void testDelegatesToValue4(){
  String contents="String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int start=contents.lastIndexOf(toFind);
  int end=start + toFind.length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDelegatesToValue4(){
  String contents="String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int offset=contents.lastIndexOf(toFind);
  assertType(contents,offset,offset + toFind.length(),"String_Node_Str");
}
Program: 185388
Project: 185388
Buggy source:
@Test public void testDelegatesToValue5(){
  String contents="String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int start=contents.lastIndexOf(toFind);
  int end=start + toFind.length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDelegatesToValue5(){
  String contents="String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int offset=contents.lastIndexOf(toFind);
  assertType(contents,offset,offset + toFind.length(),"String_Node_Str");
}
Program: 185389
Project: 185389
Buggy source:
@Test public void testDelegatesToValue2(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int start=contents.lastIndexOf(toFind);
  int end=start + toFind.length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDelegatesToValue2(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int offset=contents.lastIndexOf(toFind);
  assertType(contents,offset,offset + toFind.length(),"String_Node_Str");
}
Program: 185390
Project: 185390
Buggy source:
@Test public void testDelegatesToValue3(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int start=contents.lastIndexOf(toFind);
  int end=start + toFind.length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDelegatesToValue3(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int offset=contents.lastIndexOf(toFind);
  assertType(contents,offset,offset + toFind.length(),"String_Node_Str");
}
Program: 185391
Project: 185391
Buggy source:
@Test public void testDelegatesToValue(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int start=contents.lastIndexOf(toFind);
  int end=start + toFind.length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDelegatesToValue(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int offset=contents.lastIndexOf(toFind);
  assertType(contents,offset,offset + toFind.length(),"String_Node_Str");
}
Program: 185392
Project: 185392
Buggy source:
@Test public void testDelegatesToValue6(){
  String contents="String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int start=contents.lastIndexOf(toFind);
  int end=start + toFind.length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testDelegatesToValue6(){
  String contents="String_Node_Str" + "String_Node_Str";
  String toFind="String_Node_Str";
  int offset=contents.lastIndexOf(toFind);
  assertType(contents,offset,offset + toFind.length(),"String_Node_Str");
}
Program: 185393
Project: 185393
Buggy source:
/** 
 * Updates the identifier if it exists in this scope or a parent scope. Otherwise does nothing
 * @param name identifier to update
 * @param type type of identifier
 * @param declaringType declaring type of identifier
 * @return true iff the variable exists in scope and was updated
 */
public boolean updateVariable(String name,ClassNode type,ClassNode declaringType){
  return internalUpdateVariable(name,type,declaringType);
}

Fixed version (ground truth):
/** 
 * Updates the identifier if it exists in this scope or a parent scope. Otherwise does nothing
 * @param name identifier to update
 * @param type type of identifier
 * @param declaringType declaring type of identifier
 */
public void updateVariable(String name,ClassNode type,ClassNode declaringType){
  updateVariableImpl(name,type,declaringType);
}
Program: 185395
Project: 185395
Buggy source:
/** 
 * Updates the type info of this variable if it already exists in scope, or just adds it if it doesn't
 */
public void updateOrAddVariable(String name,ClassNode type,ClassNode declaringType){
  if (!internalUpdateVariable(name,type,declaringType)) {
    addVariable(name,type,declaringType);
  }
}

Fixed version (ground truth):
/** 
 * Updates the type info of this variable if it already exists in scope, or just adds it if it doesn't
 */
public void updateOrAddVariable(String name,ClassNode type,ClassNode declaringType){
  if (!updateVariableImpl(name,type,declaringType)) {
    addVariable(name,type,declaringType);
  }
}
Program: 185396
Project: 185396
Buggy source:
private static PropertyNode createPropertyNodeForMethodNode(MethodNode methodNode){
  ClassNode propertyType=methodNode.getReturnType();
  String methodName=methodNode.getName();
  StringBuffer propertyName=new StringBuffer();
  propertyName.append(Character.toLowerCase(methodName.charAt(3)));
  if (methodName.length() > 4) {
    propertyName.append(methodName.substring(4));
  }
  int mods=methodNode.getModifiers();
  ClassNode declaringClass=methodNode.getDeclaringClass();
  PropertyNode property=new PropertyNode(propertyName.toString(),mods,propertyType,declaringClass,null,null,null);
  property.setDeclaringClass(declaringClass);
  property.getField().setDeclaringClass(declaringClass);
  return property;
}

Fixed version (ground truth):
private static PropertyNode createPropertyNodeForMethodNode(MethodNode methodNode){
  String methodName=methodNode.getName();
  String propertyName=Introspector.decapitalize(methodName.substring(methodName.startsWith("String_Node_Str") ? 2 : 3));
  return new PropertyNode(propertyName,methodNode.getModifiers(),methodNode.getReturnType(),methodNode.getDeclaringClass(),null,null,null);
}
Program: 185397
Project: 185397
Buggy source:
public static boolean isVoidOrObject(ClassNode type){
  return type != null && (type.getName().equals(VOID_CLASS_NODE.getName()) || type.getName().equals(VOID_WRAPPER_CLASS_NODE.getName()) || type.getName().equals(OBJECT_CLASS_NODE.getName()));
}

Fixed version (ground truth):
public static boolean isVoidOrObject(ClassNode type){
  return VOID_CLASS_NODE.equals(type) || OBJECT_CLASS_NODE.equals(type);
}
Program: 185398
Project: 185398
Buggy source:
protected void assertType(String contents,int exprStart,int exprEnd,String expectedType,String extraDocSnippet,boolean forceWorkingCopy){
  GroovyCompilationUnit unit=createUnit("String_Node_Str",contents);
  assertType(unit,exprStart,exprEnd,expectedType,extraDocSnippet,forceWorkingCopy);
}

Fixed version (ground truth):
public static void assertType(GroovyCompilationUnit unit,int exprStart,int exprEnd,String expectedType,String extraDocSnippet,boolean forceWorkingCopy){
  SearchRequestor requestor=doVisit(exprStart,exprEnd,unit,forceWorkingCopy);
  Assert.assertNotNull("String_Node_Str",requestor.node);
  if (!expectedType.equals(printTypeName(requestor.result.type))) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + expectedType + "String_Node_Str");
    sb.append("String_Node_Str" + printTypeName(requestor.result.type) + "String_Node_Str");
    sb.append("String_Node_Str" + printTypeName(requestor.result.declaringType) + "String_Node_Str");
    sb.append("String_Node_Str" + requestor.node + "String_Node_Str");
    sb.append("String_Node_Str" + requestor.result.confidence + "String_Node_Str");
    Assert.fail(sb.toString());
  }
  if (extraDocSnippet != null && (requestor.result.extraDoc == null || !requestor.result.extraDoc.replace("String_Node_Str","String_Node_Str").contains(extraDocSnippet))) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    sb.append("String_Node_Str" + extraDocSnippet + "String_Node_Str");
    sb.append("String_Node_Str" + requestor.result.extraDoc + "String_Node_Str");
    sb.append("String_Node_Str" + requestor.node + "String_Node_Str");
    sb.append("String_Node_Str" + requestor.result.confidence + "String_Node_Str");
    Assert.fail(sb.toString());
  }
}
Program: 185399
Project: 185399
Buggy source:
protected void assertTypeOneOf(String contents,int start,int end,String... expectedTypes) throws Throwable {
  boolean ok=false;
  Throwable error=null;
  for (int i=0; !ok && i < expectedTypes.length; i++) {
    try {
      assertType(contents,start,end,expectedTypes[i]);
      ok=true;
    }
 catch (    Throwable e) {
      error=e;
    }
  }
  if (!ok) {
    if (error != null) {
      throw error;
    }
 else {
      fail("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
protected void assertTypeOneOf(String contents,int start,int end,String... expectedTypes) throws Throwable {
  boolean ok=false;
  Throwable error=null;
  for (int i=0; !ok && i < expectedTypes.length; i++) {
    try {
      assertType(contents,start,end,expectedTypes[i]);
      ok=true;
    }
 catch (    Throwable e) {
      error=e;
    }
  }
  if (!ok) {
    if (error != null) {
      throw error;
    }
 else {
      Assert.fail("String_Node_Str");
    }
  }
}
Program: 185400
Project: 185400
Buggy source:
protected void assertUnknownConfidence(String contents,int exprStart,int exprEnd,String expectedDeclaringType,boolean forceWorkingCopy){
  GroovyCompilationUnit unit=createUnit("String_Node_Str",contents);
  SearchRequestor requestor=doVisit(exprStart,exprEnd,unit,forceWorkingCopy);
  assertNotNull("String_Node_Str",requestor.node);
  if (requestor.result.confidence != TypeConfidence.UNKNOWN) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str" + requestor.result.confidence + "String_Node_Str");
    sb.append("String_Node_Str" + expectedDeclaringType + "String_Node_Str");
    sb.append("String_Node_Str" + printTypeName(requestor.result.type) + "String_Node_Str");
    sb.append("String_Node_Str" + printTypeName(requestor.result.declaringType) + "String_Node_Str");
    sb.append("String_Node_Str" + requestor.node + "String_Node_Str");
    fail(sb.toString());
  }
}

Fixed version (ground truth):
protected void assertUnknownConfidence(String contents,int exprStart,int exprEnd,String expectedDeclaringType,boolean forceWorkingCopy){
  GroovyCompilationUnit unit=createUnit("String_Node_Str",contents);
  SearchRequestor requestor=doVisit(exprStart,exprEnd,unit,forceWorkingCopy);
  Assert.assertNotNull("String_Node_Str",requestor.node);
  if (requestor.result.confidence != TypeConfidence.UNKNOWN) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str" + requestor.result.confidence + "String_Node_Str");
    sb.append("String_Node_Str" + expectedDeclaringType + "String_Node_Str");
    sb.append("String_Node_Str" + printTypeName(requestor.result.type) + "String_Node_Str");
    sb.append("String_Node_Str" + printTypeName(requestor.result.declaringType) + "String_Node_Str");
    sb.append("String_Node_Str" + requestor.node + "String_Node_Str");
    Assert.fail(sb.toString());
  }
}
Program: 185401
Project: 185401
Buggy source:
/** 
 * Asserts that the declaration returned at the selection is deprecated Checks only for the deprecated flag, (and so will only succeed for deprecated DSLDs).  Could change this in the future
 */
protected void assertDeprecated(String contents,int exprStart,int exprEnd){
  GroovyCompilationUnit unit=createUnit("String_Node_Str",contents);
  SearchRequestor requestor=doVisit(exprStart,exprEnd,unit,false);
  assertNotNull("String_Node_Str",requestor.node);
  assertTrue("String_Node_Str" + requestor.result.declaration,GroovyUtils.isDeprecated(requestor.result.declaration));
}

Fixed version (ground truth):
/** 
 * Asserts that the declaration returned at the selection is deprecated Checks only for the deprecated flag, (and so will only succeed for deprecated DSLDs).  Could change this in the future
 */
protected void assertDeprecated(String contents,int exprStart,int exprEnd){
  GroovyCompilationUnit unit=createUnit("String_Node_Str",contents);
  SearchRequestor requestor=doVisit(exprStart,exprEnd,unit,false);
  Assert.assertNotNull("String_Node_Str",requestor.node);
  Assert.assertTrue("String_Node_Str" + requestor.result.declaration,GroovyUtils.isDeprecated(requestor.result.declaration));
}
Program: 185404
Project: 185404
Buggy source:
@Test public void testListRemove(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str") + 2;
  MethodNode m=assertDeclaration(contents,offset,offset + "String_Node_Str".length(),"String_Node_Str","String_Node_Str",DeclarationKind.METHOD);
  assertEquals("String_Node_Str","String_Node_Str",printTypeName(m.getParameters()[0].getType()));
}

Fixed version (ground truth):
@Test public void testListRemove(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str") + 2;
  MethodNode m=assertDeclaration(contents,offset,offset + "String_Node_Str".length(),"String_Node_Str","String_Node_Str",DeclarationKind.METHOD);
  Assert.assertEquals("String_Node_Str","String_Node_Str",printTypeName(m.getParameters()[0].getType()));
}
Program: 185405
Project: 185405
Buggy source:
@Test public void testMethodOverloadsAndPerfectArgumentMatching(){
  createJavaUnit("String_Node_Str","String_Node_Str");
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  MethodNode m=assertDeclaration(contents,offset,offset + 4,"String_Node_Str","String_Node_Str",DeclarationKind.METHOD);
  assertTrue("String_Node_Str",m.getParameters().length == 3 && m.getParameters()[2].getType().getNameWithoutPackage().equals("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testMethodOverloadsAndPerfectArgumentMatching(){
  createJavaUnit("String_Node_Str","String_Node_Str");
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  MethodNode m=assertDeclaration(contents,offset,offset + 4,"String_Node_Str","String_Node_Str",DeclarationKind.METHOD);
  Assert.assertTrue("String_Node_Str",m.getParameters().length == 3 && m.getParameters()[2].getType().getNameWithoutPackage().equals("String_Node_Str"));
}
Program: 185406
Project: 185406
Buggy source:
@Test public void testMethodOverloadsAndImperfectArgumentMatching(){
  createJavaUnit("String_Node_Str","String_Node_Str");
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  MethodNode m=assertDeclaration(contents,offset,offset + 4,"String_Node_Str","String_Node_Str",DeclarationKind.METHOD);
  assertEquals("String_Node_Str",3,m.getParameters().length);
}

Fixed version (ground truth):
@Test public void testMethodOverloadsAndImperfectArgumentMatching(){
  createJavaUnit("String_Node_Str","String_Node_Str");
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  MethodNode m=assertDeclaration(contents,offset,offset + 4,"String_Node_Str","String_Node_Str",DeclarationKind.METHOD);
  Assert.assertEquals("String_Node_Str",3,m.getParameters().length);
}
Program: 185407
Project: 185407
Buggy source:
@Test public void testListSort2(){
  String contents="String_Node_Str";
  int offset=contents.lastIndexOf("String_Node_Str");
  assertType(contents,offset,offset + 4,"String_Node_Str");
  MethodNode m=assertDeclaration(contents,offset,offset + 4,"String_Node_Str","String_Node_Str",DeclarationKind.METHOD);
  assertEquals("String_Node_Str","String_Node_Str",printTypeName(m.getParameters()[0].getType()));
}

Fixed version (ground truth):
@Test public void testListSort2(){
  String contents="String_Node_Str";
  int offset=contents.lastIndexOf("String_Node_Str");
  assertType(contents,offset,offset + 4,"String_Node_Str");
  MethodNode m=assertDeclaration(contents,offset,offset + 4,"String_Node_Str","String_Node_Str",DeclarationKind.METHOD);
  Assert.assertEquals("String_Node_Str","String_Node_Str",printTypeName(m.getParameters()[0].getType()));
}
Program: 185408
Project: 185408
Buggy source:
public final ReferenceBinding getGroovyLangMetaClassBinding(){
  CompilationUnitScope unitScope=compilationUnitScope();
  unitScope.recordQualifiedReference(GROOVY_LANG_METACLASS);
  return unitScope.environment.getResolvedType(GROOVY_LANG_METACLASS,this);
}

Fixed version (ground truth):
public final ReferenceBinding getGroovyLangMetaClassBinding(){
  CompilationUnitScope unitScope=compilationUnitScope();
  unitScope.recordQualifiedReference(GroovyCompilationUnitScope.GROOVY_LANG_METACLASS);
  return unitScope.environment.getResolvedType(GroovyCompilationUnitScope.GROOVY_LANG_METACLASS,this);
}
Program: 185410
Project: 185410
Buggy source:
@Test @Ignore("String_Node_Str") public void testLocalVar8a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar8a(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185411
Project: 185411
Buggy source:
@Test public void testLocalVar14(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar14(){
  String contents="String_Node_Str" + "String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185412
Project: 185412
Buggy source:
@Test public void testLocalVar12(){
  String contents="String_Node_Str" + "String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar12(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}
Program: 185413
Project: 185413
Buggy source:
@Test @Ignore("String_Node_Str") public void testLocalVar8(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testLocalVar8(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int offset=contents.indexOf("String_Node_Str");
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
  offset=contents.indexOf("String_Node_Str",offset + 1);
  assertType(contents,offset,offset + 1,"String_Node_Str");
}