Program: 177204
Project: 177204
Buggy source:
/** 
 * Sets up the controller for servicing the specified REST endpoints.
 * @throws org.springframework.beans.BeansException If there was a problem setting it up.
 */
@Override protected void initApplicationContext() throws BeansException {
  super.initApplicationContext();
  Map<Class,Object> class2instances=new HashMap<Class,Object>();
  if (endpointClasses != null) {
    for (    Class endpointClass : endpointClasses) {
      Collection<Class> endpointTypes=findEndpointTypes(endpointClass);
      if (endpointTypes.isEmpty()) {
        throw new ApplicationContextException("String_Node_Str" + endpointClass.getName() + "String_Node_Str");
      }
      for (      Class endpointType : endpointTypes) {
        Method[] restMethods=endpointType.getDeclaredMethods();
        for (        Method restMethod : restMethods) {
          int modifiers=restMethod.getModifiers();
          if ((Modifier.isPublic(modifiers)) && (restMethod.isAnnotationPresent(Verb.class)) && (!isImplMethod(restMethod,endpointTypes))) {
            VerbType verb=restMethod.getAnnotation(Verb.class).value();
            Noun nounInfo=restMethod.getAnnotation(Noun.class);
            String context=nounInfo.context();
            if ("String_Node_Str".equals(context)) {
              if (endpointType.isAnnotationPresent(NounContext.class)) {
                context=((NounContext)endpointType.getAnnotation(NounContext.class)).value();
              }
 else {
                context="String_Node_Str";
              }
            }
            String noun=restMethod.isAnnotationPresent(Noun.class) ? nounInfo.value() : restMethod.getName();
            RESTResource resource=getRESTResource(context,noun);
            if (resource == null) {
              resource=new RESTResource(noun,context);
              RESTResources.add(resource);
            }
            Object endpoint=class2instances.get(endpointType);
            if (endpoint == null) {
              endpoint=loadEndpointBean(endpointType,endpointClass);
              class2instances.put(endpointType,endpoint);
            }
            if (!resource.addOperation(verb,endpoint,restMethod)) {
              RESTOperation duplicateOperation=resource.getOperation(verb);
              throw new ApplicationContextException("String_Node_Str" + noun + "String_Node_Str"+ context+ "String_Node_Str"+ verb+ "String_Node_Str"+ restMethod.getDeclaringClass().getName()+ "String_Node_Str"+ restMethod.getName()+ "String_Node_Str"+ duplicateOperation.method.getDeclaringClass().getName()+ "String_Node_Str"+ duplicateOperation.method.getName()+ "String_Node_Str");
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets up the controller for servicing the specified REST endpoints.
 * @throws org.springframework.beans.BeansException If there was a problem setting it up.
 */
@Override protected void initApplicationContext() throws BeansException {
  super.initApplicationContext();
  Map<Class,Object> class2instances=new HashMap<Class,Object>();
  if (endpointClasses != null) {
    for (    Class endpointClass : endpointClasses) {
      Collection<Class> endpointTypes=findEndpointTypes(endpointClass);
      if (endpointTypes.isEmpty()) {
        throw new ApplicationContextException("String_Node_Str" + endpointClass.getName() + "String_Node_Str");
      }
      for (      Class endpointType : endpointTypes) {
        Method[] restMethods=endpointType.getDeclaredMethods();
        for (        Method restMethod : restMethods) {
          int modifiers=restMethod.getModifiers();
          if ((Modifier.isPublic(modifiers)) && (restMethod.isAnnotationPresent(Verb.class)) && (!isImplMethod(restMethod,endpointTypes))) {
            VerbType verb=restMethod.getAnnotation(Verb.class).value();
            Noun nounInfo=restMethod.getAnnotation(Noun.class);
            String context=nounInfo.context();
            if ("String_Node_Str".equals(context)) {
              if (endpointType.isAnnotationPresent(NounContext.class)) {
                context=((NounContext)endpointType.getAnnotation(NounContext.class)).value();
              }
 else {
                context="String_Node_Str";
              }
            }
            String noun=restMethod.isAnnotationPresent(Noun.class) ? nounInfo.value() : restMethod.getName();
            RESTResource resource=getRESTResource(noun,context);
            if (resource == null) {
              resource=new RESTResource(noun,context);
              RESTResources.add(resource);
            }
            Object endpoint=class2instances.get(endpointType);
            if (endpoint == null) {
              endpoint=loadEndpointBean(endpointType,endpointClass);
              class2instances.put(endpointType,endpoint);
            }
            if (!resource.addOperation(verb,endpoint,restMethod)) {
              RESTOperation duplicateOperation=resource.getOperation(verb);
              throw new ApplicationContextException("String_Node_Str" + noun + "String_Node_Str"+ context+ "String_Node_Str"+ verb+ "String_Node_Str"+ restMethod.getDeclaringClass().getName()+ "String_Node_Str"+ restMethod.getName()+ "String_Node_Str"+ duplicateOperation.method.getDeclaringClass().getName()+ "String_Node_Str"+ duplicateOperation.method.getName()+ "String_Node_Str");
            }
          }
        }
      }
    }
  }
}