Program: 93359
Project: 93359
Buggy source:
private Optional<IType> resolveType(final ITypeName recType){
  ensureIsNotNull(recType);
  if (recType.isArrayType()) {
    System.err.println("String_Node_Str");
    return absent();
  }
  if (recType.isNestedType()) {
    final ITypeName declaringType=recType.getDeclaringType();
    final String simpleName=StringUtils.substringAfterLast(recType.getIdentifier(),"String_Node_Str");
    final IType parent=resolveType(declaringType).orNull();
    if (parent != null) {
      try {
        for (        final IType nested : parent.getTypes()) {
          final String key=nested.getKey();
          if (key.equals(recType.getIdentifier() + "String_Node_Str")) {
            return fromNullable(nested);
          }
        }
        for (        final IMethod m : parent.getMethods()) {
          for (          final IJavaElement children : m.getChildren()) {
            if (children instanceof IType) {
              final IType nested=(IType)children;
              if (nested.getKey().endsWith(simpleName + "String_Node_Str")) {
                return of(nested);
              }
              final String key=nested.getKey();
              if (key.equals(recType.getIdentifier() + "String_Node_Str")) {
                return fromNullable(nested);
              }
            }
          }
        }
      }
 catch (      final Exception x) {
        return absent();
      }
    }
    return absent();
  }
  final IType[] res=new IType[1];
  final IJavaSearchScope scope=SearchEngine.createWorkspaceScope();
  final SearchEngine search=new SearchEngine();
  final String srcTypeName=Names.vm2srcTypeName(recType.getIdentifier());
  final SearchPattern pattern=SearchPattern.createPattern(srcTypeName,IJavaSearchConstants.TYPE,IJavaSearchConstants.DECLARATIONS,SearchPattern.R_EXACT_MATCH);
  try {
    search.search(pattern,SearchUtils.getDefaultSearchParticipants(),scope,new SearchRequestor(){
      @Override public void acceptSearchMatch(      final SearchMatch match) throws CoreException {
        res[0]=(IType)match.getElement();
      }
    }
,null);
  }
 catch (  final CoreException e) {
    throwUnhandledException(e);
  }
  return fromNullable(res[0]);
}

Fixed version (ground truth):
private Optional<IType> resolveType(final ITypeName recType){
  ensureIsNotNull(recType);
  if (recType.isArrayType()) {
    System.err.println("String_Node_Str");
    return absent();
  }
  if (recType.isNestedType()) {
    final ITypeName declaringType=recType.getDeclaringType();
    final String simpleName=StringUtils.substringAfterLast(recType.getIdentifier(),"String_Node_Str");
    final IType parent=resolveType(declaringType).orNull();
    if (parent != null) {
      try {
        for (        final IType nested : parent.getTypes()) {
          final String key=nested.getKey();
          if (key.equals(recType.getIdentifier() + "String_Node_Str")) {
            return fromNullable(nested);
          }
        }
        for (        final IMethod m : parent.getMethods()) {
          for (          final IJavaElement children : m.getChildren()) {
            if (children instanceof IType) {
              final IType nested=(IType)children;
              if (nested.getKey().endsWith(simpleName + "String_Node_Str")) {
                return of(nested);
              }
              final String key=nested.getKey();
              if (key.equals(recType.getIdentifier() + "String_Node_Str")) {
                return fromNullable(nested);
              }
            }
          }
        }
      }
 catch (      final Exception x) {
        return absent();
      }
    }
    return absent();
  }
  final IType[] res=new IType[1];
  final IJavaSearchScope scope=SearchEngine.createWorkspaceScope();
  final SearchEngine search=new SearchEngine();
  final String srcTypeName=Names.vm2srcTypeName(recType.getIdentifier());
  final SearchPattern pattern=SearchPattern.createPattern(srcTypeName,IJavaSearchConstants.TYPE,IJavaSearchConstants.DECLARATIONS,SearchPattern.R_FULL_MATCH);
  try {
    search.search(pattern,SearchUtils.getDefaultSearchParticipants(),scope,new SearchRequestor(){
      @Override public void acceptSearchMatch(      final SearchMatch match) throws CoreException {
        IType element=(IType)match.getElement();
        if (toRecType(element).equals(recType)) {
          res[0]=element;
        }
      }
    }
,null);
  }
 catch (  final CoreException e) {
    throwUnhandledException(e);
  }
  return fromNullable(res[0]);
}