Program: 86848
Project: 86848
Buggy source:
/** 
 * Utility method which takes in a Class and a Parameterizable instance  and returns a List of Parameters based on the annotated   {@link Param}fields within the classToCheck or its superclasses. This is private as it exists only to support recursion in the above class. Made public again because of a dependency on BaseDataSetDefinition.
 * @param classToCheck - The class to look at for annotated fields.
 * @param classInstance - The instance to look at for default values.
 * @return - A List of Parameters based on the annotations in the passed classes
 */
@SuppressWarnings("String_Node_Str") public static List<Parameter> getAnnotatedParameters(Class<?> classToCheck,Parameterizable classInstance){
  List<Parameter> ret=new ArrayList<Parameter>();
  if (classToCheck != null) {
    for (    Field f : classToCheck.getDeclaredFields()) {
      Param ann=f.getAnnotation(Param.class);
      if (ann != null) {
        String name=(StringUtils.isEmpty(ann.name()) ? f.getName() : ann.name());
        String label=name;
        if (!StringUtils.isEmpty(ann.labelCode())) {
          label=Context.getMessageSourceService().getMessage(ann.labelCode());
        }
 else         if (!StringUtils.isEmpty(ann.labelText())) {
          label=ann.labelText();
        }
        Object defaultVal=null;
        if (classInstance != null) {
          try {
            String getterMethodName="String_Node_Str" + f.getName().substring(0,1).toUpperCase() + f.getName().substring(1);
            Method getterMethod=classInstance.getClass().getMethod(getterMethodName,(Class[])null);
            defaultVal=getterMethod.invoke(classInstance);
          }
 catch (          Exception e) {
            throw new APIException("String_Node_Str" + e);
          }
        }
        Parameter p=new Parameter(name,label,f.getType(),defaultVal,ann.required());
        ret.add(p);
        Class superclass=classToCheck.getSuperclass();
        if (superclass != null) {
          ret.addAll(getAnnotatedParameters(superclass,classInstance));
        }
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Utility method which takes in a Class and a Parameterizable instance  and returns a List of Parameters based on the annotated   {@link Param}fields within the classToCheck or its superclasses. This is private as it exists only to support recursion in the above class. Made public again because of a dependency on BaseDataSetDefinition.
 * @param classToCheck - The class to look at for annotated fields.
 * @param classInstance - The instance to look at for default values.
 * @return - A List of Parameters based on the annotations in the passed classes
 */
@SuppressWarnings("String_Node_Str") public static List<Parameter> getAnnotatedParameters(Class<?> classToCheck,Parameterizable classInstance){
  List<Parameter> ret=new ArrayList<Parameter>();
  if (classToCheck != null) {
    log.debug("String_Node_Str" + classToCheck.getName());
    for (    Field f : classToCheck.getDeclaredFields()) {
      Param ann=f.getAnnotation(Param.class);
      if (ann != null) {
        String name=(StringUtils.isEmpty(ann.name()) ? f.getName() : ann.name());
        String label=name;
        if (!StringUtils.isEmpty(ann.labelCode())) {
          label=Context.getMessageSourceService().getMessage(ann.labelCode());
        }
 else         if (!StringUtils.isEmpty(ann.labelText())) {
          label=ann.labelText();
        }
        Object defaultVal=null;
        if (classInstance != null) {
          try {
            String getterMethodName="String_Node_Str" + f.getName().substring(0,1).toUpperCase() + f.getName().substring(1);
            Method getterMethod=classInstance.getClass().getMethod(getterMethodName,(Class[])null);
            defaultVal=getterMethod.invoke(classInstance);
          }
 catch (          Exception e) {
            throw new APIException("String_Node_Str" + e);
          }
        }
        Parameter p=new Parameter(name,label,f.getType(),defaultVal,ann.required());
        ret.add(p);
        log.debug("String_Node_Str" + p);
      }
    }
    Class superclass=classToCheck.getSuperclass();
    if (superclass != null) {
      log.debug("String_Node_Str" + superclass);
      ret.addAll(getAnnotatedParameters(superclass,classInstance));
    }
  }
  return ret;
}