Program: 185592
Project: 185592
Buggy source:
public ITypeRequestor createRequestor(PossibleMatch possibleMatch,SearchPattern pattern,SearchRequestor requestor){
  if (pattern instanceof TypeReferencePattern) {
    return new TypeReferenceSearchRequestor((TypeReferencePattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof TypeDeclarationPattern) {
    return new TypeDeclarationSearchRequestor((TypeDeclarationPattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof FieldPattern) {
    return new FieldReferenceSearchRequestor((FieldPattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof MethodPattern) {
    return new MethodReferenceSearchRequestor((MethodPattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof LocalVariablePattern) {
    ILocalVariable localVar=(ILocalVariable)ReflectionUtils.getPrivateField(LocalVariablePattern.class,"String_Node_Str",pattern);
    int start;
    try {
      start=localVar.getSourceRange().getOffset();
    }
 catch (    JavaModelException e) {
      Util.log(e);
      start=-1;
    }
    return new LocalVariableReferenceRequestor(localVar.getElementName(),localVar.getParent(),requestor,possibleMatch.document.getParticipant(),start);
  }
 else   if (pattern instanceof ConstructorPattern) {
    return new ConstructorReferenceSearchRequestor((ConstructorPattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof OrPattern) {
    SearchPattern[] patterns=getPatterns((OrPattern)pattern);
    List<ITypeRequestor> requestors=new ArrayList<ITypeRequestor>(patterns.length);
    for (    SearchPattern orPattern : patterns) {
      if (orPattern != null) {
        ITypeRequestor maybeRequestor=createRequestor(possibleMatch,orPattern,requestor);
        if (maybeRequestor != null) {
          requestors.add(maybeRequestor);
        }
      }
    }
    return new OrPatternRequestor(requestors);
  }
  return null;
}

Fixed version (ground truth):
public ITypeRequestor createRequestor(PossibleMatch possibleMatch,SearchPattern pattern,SearchRequestor requestor){
  if (pattern instanceof TypeReferencePattern) {
    return new TypeReferenceSearchRequestor((TypeReferencePattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof TypeDeclarationPattern) {
    return new TypeDeclarationSearchRequestor((TypeDeclarationPattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof FieldPattern) {
    return new FieldReferenceSearchRequestor((FieldPattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof MethodPattern) {
    return new MethodReferenceSearchRequestor((MethodPattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof ConstructorPattern) {
    return new ConstructorReferenceSearchRequestor((ConstructorPattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof PackageReferencePattern) {
    return new PackageReferenceSearchRequestor((PackageReferencePattern)pattern,requestor,possibleMatch.document.getParticipant());
  }
 else   if (pattern instanceof LocalVariablePattern) {
    ILocalVariable localVar=(ILocalVariable)ReflectionUtils.getPrivateField(LocalVariablePattern.class,"String_Node_Str",pattern);
    int start;
    try {
      start=localVar.getSourceRange().getOffset();
    }
 catch (    JavaModelException e) {
      Util.log(e);
      start=-1;
    }
    return new LocalVariableReferenceRequestor(localVar.getElementName(),localVar.getParent(),requestor,possibleMatch.document.getParticipant(),start);
  }
 else   if (pattern instanceof OrPattern) {
    SearchPattern[] patterns=(SearchPattern[])ReflectionUtils.getPrivateField(OrPattern.class,"String_Node_Str",pattern);
    List<ITypeRequestor> requestors=new ArrayList<ITypeRequestor>(patterns.length);
    for (    SearchPattern orPattern : patterns) {
      if (orPattern != null) {
        ITypeRequestor maybeRequestor=createRequestor(possibleMatch,orPattern,requestor);
        if (maybeRequestor != null) {
          requestors.add(maybeRequestor);
        }
      }
    }
    return new OrPatternRequestor(requestors);
  }
  return null;
}