Program: 60441
Project: 60441
Buggy source:
private JpaFinderProxy.FinderDescriptor getFinderDescriptor(MethodInvocation invocation){
  Method method=invocation.getMethod();
  JpaFinderProxy.FinderDescriptor finderDescriptor=finderCache.get(method);
  if (null != finderDescriptor) {
    return finderDescriptor;
  }
  finderDescriptor=new JpaFinderProxy.FinderDescriptor();
  finderDescriptor.returnClass=invocation.getMethod().getReturnType();
  finderDescriptor.returnType=determineReturnType(finderDescriptor.returnClass);
  Finder finder=invocation.getMethod().getAnnotation(Finder.class);
  String query=finder.query();
  if (!"String_Node_Str".equals(query.trim())) {
    finderDescriptor.setQuery(query);
  }
 else {
    finderDescriptor.setNamedQuery(finder.namedQuery());
  }
  Annotation[][] parameterAnnotations=method.getParameterAnnotations();
  Object[] discoveredAnnotations=new Object[parameterAnnotations.length];
  for (int i=0; i < parameterAnnotations.length; i++) {
    Annotation[] annotations=parameterAnnotations[i];
    for (    Annotation annotation : annotations) {
      Class<? extends Annotation> annotationType=annotation.annotationType();
      if (Named.class.equals(annotationType)) {
        discoveredAnnotations[i]=annotation;
        finderDescriptor.isBindAsRawParameters=false;
        break;
      }
 else       if (FirstResult.class.equals(annotationType)) {
        discoveredAnnotations[i]=annotation;
        break;
      }
 else       if (MaxResults.class.equals(annotationType)) {
        discoveredAnnotations[i]=annotation;
        break;
      }
    }
  }
  finderDescriptor.parameterAnnotations=discoveredAnnotations;
  if (JpaFinderProxy.ReturnType.COLLECTION.equals(finderDescriptor.returnType) && finderDescriptor.returnClass != Collection.class) {
    System.out.println("String_Node_Str" + finderDescriptor.returnClass);
    finderDescriptor.returnCollectionType=finder.returnAs();
    try {
      finderDescriptor.returnCollectionTypeConstructor=finderDescriptor.returnCollectionType.getConstructor();
      finderDescriptor.returnCollectionTypeConstructor.setAccessible(true);
    }
 catch (    NoSuchMethodException e) {
      throw new RuntimeException("String_Node_Str" + finderDescriptor.returnCollectionType,e);
    }
  }
  cacheFinderDescriptor(method,finderDescriptor);
  return finderDescriptor;
}

Fixed version (ground truth):
private JpaFinderProxy.FinderDescriptor getFinderDescriptor(MethodInvocation invocation){
  Method method=invocation.getMethod();
  JpaFinderProxy.FinderDescriptor finderDescriptor=finderCache.get(method);
  if (null != finderDescriptor) {
    return finderDescriptor;
  }
  finderDescriptor=new JpaFinderProxy.FinderDescriptor();
  finderDescriptor.returnClass=invocation.getMethod().getReturnType();
  finderDescriptor.returnType=determineReturnType(finderDescriptor.returnClass);
  Finder finder=invocation.getMethod().getAnnotation(Finder.class);
  String query=finder.query();
  if (!"String_Node_Str".equals(query.trim())) {
    finderDescriptor.setQuery(query);
  }
 else {
    finderDescriptor.setNamedQuery(finder.namedQuery());
  }
  Annotation[][] parameterAnnotations=method.getParameterAnnotations();
  Object[] discoveredAnnotations=new Object[parameterAnnotations.length];
  for (int i=0; i < parameterAnnotations.length; i++) {
    Annotation[] annotations=parameterAnnotations[i];
    for (    Annotation annotation : annotations) {
      Class<? extends Annotation> annotationType=annotation.annotationType();
      if (Named.class.equals(annotationType) || javax.inject.Named.class.equals(annotationType)) {
        discoveredAnnotations[i]=annotation;
        finderDescriptor.isBindAsRawParameters=false;
        break;
      }
 else       if (FirstResult.class.equals(annotationType)) {
        discoveredAnnotations[i]=annotation;
        break;
      }
 else       if (MaxResults.class.equals(annotationType)) {
        discoveredAnnotations[i]=annotation;
        break;
      }
    }
  }
  finderDescriptor.parameterAnnotations=discoveredAnnotations;
  if (JpaFinderProxy.ReturnType.COLLECTION.equals(finderDescriptor.returnType) && finderDescriptor.returnClass != Collection.class) {
    finderDescriptor.returnCollectionType=finder.returnAs();
    try {
      finderDescriptor.returnCollectionTypeConstructor=finderDescriptor.returnCollectionType.getConstructor();
      finderDescriptor.returnCollectionTypeConstructor.setAccessible(true);
    }
 catch (    NoSuchMethodException e) {
      throw new RuntimeException("String_Node_Str" + finderDescriptor.returnCollectionType,e);
    }
  }
  cacheFinderDescriptor(method,finderDescriptor);
  return finderDescriptor;
}