Program: 152017
Project: 152017
Buggy source:
/** 
 * Finds all configs and resources referenced by the supplied property of the supplied object and places them in the given sets.  This is not without side effects: when it finds arguments in references that don't correspond to matching parameters, it strips them out.
 */
protected void getReferences(ConfigManager cfgmgr,Object object,Property property){
  Object value=property.get(object);
  if (value == null) {
    return;
  }
  Editable annotation=property.getAnnotation();
  String editor=annotation.editor();
  if (editor.equals("String_Node_Str")) {
    _resources.add((String)value);
    return;
  }
  if (editor.equals("String_Node_Str")) {
    @SuppressWarnings("String_Node_Str") ConfigGroup<ManagedConfig> group=(ConfigGroup<ManagedConfig>)cfgmgr.getGroup(annotation.mode());
    if (group != null) {
      _configs.add(new ConfigId(group.getConfigClass(),(String)value));
    }
    return;
  }
  Class<?> type=property.getType();
  if (ConfigReference.class.equals(type)) {
    Class<?> clazz=property.getArgumentType(ConfigReference.class);
    if (clazz == null && (object instanceof DerivedConfig)) {
      clazz=((DerivedConfig)object).cclass;
    }
    @SuppressWarnings("String_Node_Str") Class<ManagedConfig> cclass=(Class<ManagedConfig>)clazz;
    @SuppressWarnings("String_Node_Str") ConfigReference<ManagedConfig> ref=(ConfigReference<ManagedConfig>)value;
    _configs.add(new ConfigId(cclass,ref.getName()));
    ArgumentMap args=ref.getArguments();
    if (args.isEmpty()) {
      return;
    }
    ManagedConfig config=cfgmgr.getRawConfig(cclass,ref.getName());
    if (!(config instanceof ParameterizedConfig)) {
      return;
    }
    ParameterizedConfig pconfig=(ParameterizedConfig)config;
    for (Iterator<Map.Entry<String,Object>> it=args.entrySet().iterator(); it.hasNext(); ) {
      Map.Entry<String,Object> entry=it.next();
      Parameter param=pconfig.getParameter(entry.getKey());
      if (param == null) {
        it.remove();
        continue;
      }
      Property prop=param.getArgumentProperty(pconfig);
      if (prop != null) {
        getReferences(cfgmgr,args,prop);
      }
    }
    return;
  }
  if ((type.isArray() || List.class.isAssignableFrom(type)) && (ConfigReference.class.equals(property.getComponentType()))) {
    @SuppressWarnings("String_Node_Str") List<ConfigReference> list=type.isArray() ? Arrays.asList((ConfigReference[])value) : (List<ConfigReference>)value;
    Type ctype=property.getGenericComponentType();
    if (!(ctype instanceof ParameterizedType)) {
      output("String_Node_Str");
      return;
    }
    @SuppressWarnings("String_Node_Str") Class<ManagedConfig> cclass=(Class<ManagedConfig>)((ParameterizedType)ctype).getActualTypeArguments()[0];
    for (    ConfigReference raw : list) {
      _configs.add(new ConfigId(cclass,raw.getName()));
    }
    return;
  }
  getReferences(cfgmgr,value);
}

Fixed version (ground truth):
/** 
 * Finds all configs and resources referenced by the supplied property of the supplied object and places them in the given sets.  This is not without side effects: when it finds arguments in references that don't correspond to matching parameters, it strips them out.
 */
protected void getReferences(ConfigManager cfgmgr,Object object,Property property){
  Object value=property.get(object);
  if (value == null) {
    return;
  }
  Editable annotation=property.getAnnotation();
  String editor=annotation.editor();
  if (editor.equals("String_Node_Str")) {
    _resources.add((String)value);
    return;
  }
  if (editor.equals("String_Node_Str")) {
    @SuppressWarnings("String_Node_Str") ConfigGroup<ManagedConfig> group=(ConfigGroup<ManagedConfig>)cfgmgr.getGroup(annotation.mode());
    if (group != null) {
      _configs.add(new ConfigId(group.getConfigClass(),(String)value));
    }
    return;
  }
  Class<?> type=property.getType();
  if (ConfigReference.class.equals(type)) {
    Class<?> clazz=property.getArgumentType(ConfigReference.class);
    if (clazz == null && (object instanceof DerivedConfig)) {
      clazz=((DerivedConfig)object).cclass;
    }
    @SuppressWarnings("String_Node_Str") Class<ManagedConfig> cclass=(Class<ManagedConfig>)clazz;
    @SuppressWarnings("String_Node_Str") ConfigReference<ManagedConfig> ref=(ConfigReference<ManagedConfig>)value;
    _configs.add(new ConfigId(cclass,ref.getName()));
    ArgumentMap args=ref.getArguments();
    if (args.isEmpty()) {
      return;
    }
    ManagedConfig config=cfgmgr.getRawConfig(cclass,ref.getName());
    if (!(config instanceof ParameterizedConfig)) {
      args.clear();
      return;
    }
    ParameterizedConfig pconfig=(ParameterizedConfig)config;
    for (Iterator<Map.Entry<String,Object>> it=args.entrySet().iterator(); it.hasNext(); ) {
      Map.Entry<String,Object> entry=it.next();
      Parameter param=pconfig.getParameter(entry.getKey());
      if (param == null) {
        it.remove();
        continue;
      }
      Property prop=param.getArgumentProperty(pconfig);
      if (prop != null) {
        getReferences(cfgmgr,args,prop);
      }
    }
    return;
  }
  if ((type.isArray() || List.class.isAssignableFrom(type)) && (ConfigReference.class.equals(property.getComponentType()))) {
    @SuppressWarnings("String_Node_Str") List<ConfigReference> list=type.isArray() ? Arrays.asList((ConfigReference[])value) : (List<ConfigReference>)value;
    Type ctype=property.getGenericComponentType();
    if (!(ctype instanceof ParameterizedType)) {
      output("String_Node_Str");
      return;
    }
    @SuppressWarnings("String_Node_Str") Class<ManagedConfig> cclass=(Class<ManagedConfig>)((ParameterizedType)ctype).getActualTypeArguments()[0];
    for (    ConfigReference raw : list) {
      _configs.add(new ConfigId(cclass,raw.getName()));
    }
    return;
  }
  getReferences(cfgmgr,value);
}