Program: 185402
Project: 185402
Buggy source:
protected void assertDeclaringType(String contents,int exprStart,int exprEnd,String expectedDeclaringType,boolean forceWorkingCopy,boolean expectingUnknown){
  GroovyCompilationUnit unit=createUnit("String_Node_Str",contents);
  SearchRequestor requestor=doVisit(exprStart,exprEnd,unit,forceWorkingCopy);
  assertNotNull("String_Node_Str",requestor.node);
  if (!expectedDeclaringType.equals(requestor.getDeclaringTypeName())) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    sb.append("String_Node_Str").append(expectedDeclaringType).append("String_Node_Str");
    sb.append("String_Node_Str").append(printTypeName(requestor.result.type)).append("String_Node_Str");
    sb.append("String_Node_Str").append(printTypeName(requestor.result.declaringType)).append("String_Node_Str");
    sb.append("String_Node_Str").append(requestor.node);
    fail(sb.toString());
  }
  if (expectingUnknown) {
    if (requestor.result.confidence != TypeConfidence.UNKNOWN) {
      StringBuilder sb=new StringBuilder();
      sb.append("String_Node_Str").append(requestor.result.confidence).append("String_Node_Str");
      sb.append("String_Node_Str").append(expectedDeclaringType).append("String_Node_Str");
      sb.append("String_Node_Str").append(printTypeName(requestor.result.type)).append("String_Node_Str");
      sb.append("String_Node_Str").append(printTypeName(requestor.result.declaringType)).append("String_Node_Str");
      sb.append("String_Node_Str").append(requestor.node);
      fail(sb.toString());
    }
  }
 else {
    if (requestor.result.confidence == TypeConfidence.UNKNOWN) {
      StringBuilder sb=new StringBuilder();
      sb.append("String_Node_Str");
      sb.append("String_Node_Str").append(expectedDeclaringType).append("String_Node_Str");
      sb.append("String_Node_Str").append(printTypeName(requestor.result.type)).append("String_Node_Str");
      sb.append("String_Node_Str").append(printTypeName(requestor.result.declaringType)).append("String_Node_Str");
      sb.append("String_Node_Str").append(requestor.node);
      fail(sb.toString());
    }
  }
}

Fixed version (ground truth):
protected void assertDeclaringType(String contents,int exprStart,int exprEnd,String expectedDeclaringType,boolean forceWorkingCopy,boolean expectingUnknown){
  GroovyCompilationUnit unit=createUnit("String_Node_Str",contents);
  SearchRequestor requestor=doVisit(exprStart,exprEnd,unit,forceWorkingCopy);
  Assert.assertNotNull("String_Node_Str",requestor.node);
  if (!expectedDeclaringType.equals(requestor.getDeclaringTypeName())) {
    StringBuilder sb=new StringBuilder();
    sb.append("String_Node_Str");
    sb.append("String_Node_Str").append(expectedDeclaringType).append("String_Node_Str");
    sb.append("String_Node_Str").append(printTypeName(requestor.result.type)).append("String_Node_Str");
    sb.append("String_Node_Str").append(printTypeName(requestor.result.declaringType)).append("String_Node_Str");
    sb.append("String_Node_Str").append(requestor.node);
    Assert.fail(sb.toString());
  }
  if (expectingUnknown) {
    if (requestor.result.confidence != TypeConfidence.UNKNOWN) {
      StringBuilder sb=new StringBuilder();
      sb.append("String_Node_Str").append(requestor.result.confidence).append("String_Node_Str");
      sb.append("String_Node_Str").append(expectedDeclaringType).append("String_Node_Str");
      sb.append("String_Node_Str").append(printTypeName(requestor.result.type)).append("String_Node_Str");
      sb.append("String_Node_Str").append(printTypeName(requestor.result.declaringType)).append("String_Node_Str");
      sb.append("String_Node_Str").append(requestor.node);
      Assert.fail(sb.toString());
    }
  }
 else {
    if (requestor.result.confidence == TypeConfidence.UNKNOWN) {
      StringBuilder sb=new StringBuilder();
      sb.append("String_Node_Str");
      sb.append("String_Node_Str").append(expectedDeclaringType).append("String_Node_Str");
      sb.append("String_Node_Str").append(printTypeName(requestor.result.type)).append("String_Node_Str");
      sb.append("String_Node_Str").append(printTypeName(requestor.result.declaringType)).append("String_Node_Str");
      sb.append("String_Node_Str").append(requestor.node);
      Assert.fail(sb.toString());
    }
  }
}