Program: 152045
Project: 152045
Buggy source:
/** 
 * Updates the state of the interface based on the current value.
 * @param transfer if true, attempt to transfer values from the existing set of editors intothe current arguments.
 */
protected void update(ConfigReference value,boolean transfer){
  if (_listenee != null) {
    _listenee.removeListener(this);
    _listenee=null;
  }
  boolean enable=(value != null);
  if (_edit != null) {
    _edit.setEnabled(enable);
  }
  if (_clear != null) {
    _clear.setEnabled(enable);
  }
  if (!enable) {
    _config.setText(_msgs.get("String_Node_Str"));
    _arguments.removeAll();
    return;
  }
  String name=value.getName();
  _config.setText(name.substring(name.lastIndexOf('/') + 1));
  @SuppressWarnings("String_Node_Str") Class<ManagedConfig> clazz=(Class<ManagedConfig>)_property.getArgumentType(ConfigReference.class);
  ManagedConfig config=_ctx.getConfigManager().getConfig(clazz,name);
  if (!(config instanceof ParameterizedConfig)) {
    _arguments.removeAll();
    value.getArguments().clear();
    if (config == null) {
      _config.setForeground(Color.red);
    }
    return;
  }
  _config.setForeground(_content.getForeground());
  int ocount=_arguments.getComponentCount();
  HashMap<String,PropertyEditor> oeditors=new HashMap<String,PropertyEditor>();
  if (transfer) {
    for (int ii=0; ii < ocount; ii++) {
      PropertyEditor editor=(PropertyEditor)_arguments.getComponent(ii);
      oeditors.put(editor.getProperty().getName(),editor);
    }
  }
  int idx=0;
  Object nargs=value.getArguments();
  ParameterizedConfig pconfig=(ParameterizedConfig)config;
  for (  Parameter parameter : pconfig.parameters) {
    Property property=parameter.getArgumentProperty(pconfig);
    if (property == null) {
      continue;
    }
    PropertyEditor editor=null;
    if (idx < ocount) {
      PropertyEditor oeditor=(PropertyEditor)_arguments.getComponent(idx);
      if (oeditor.getProperty().equals(property)) {
        if (transfer) {
          property.set(nargs,property.get(oeditor.getObject()));
        }
        editor=oeditor;
      }
 else {
        _arguments.remove(idx);
      }
    }
    if (editor == null) {
      editor=PropertyEditor.createEditor(_ctx,property,_lineage);
      editor.addChangeListener(this);
      _arguments.add(editor,idx);
      PropertyEditor oeditor=oeditors.get(parameter.name);
      if (oeditor != null) {
        Property oproperty=oeditor.getProperty();
        if (property.getGenericType().equals(oproperty.getGenericType())) {
          Object ovalue=oproperty.get(oeditor.getObject());
          if (property.isLegalValue(ovalue)) {
            property.set(nargs,ovalue);
          }
        }
      }
    }
    editor.setObject(nargs);
    idx++;
  }
  while (ocount > idx) {
    _arguments.remove(--ocount);
  }
  for (Iterator<String> it=value.getArguments().keySet().iterator(); it.hasNext(); ) {
    if (pconfig.getParameter(it.next()) == null) {
      it.remove();
    }
  }
  (_listenee=pconfig).addListener(this);
}

Fixed version (ground truth):
/** 
 * Updates the state of the interface based on the current value.
 * @param transfer if true, attempt to transfer values from the existing set of editors intothe current arguments.
 */
protected void update(ConfigReference value,boolean transfer){
  if (_listenee != null) {
    _listenee.removeListener(this);
    _listenee=null;
  }
  boolean enable=(value != null);
  if (_edit != null) {
    _edit.setEnabled(enable);
  }
  if (_clear != null) {
    _clear.setEnabled(enable);
  }
  if (!enable) {
    _config.setText(_msgs.get("String_Node_Str"));
    _arguments.removeAll();
    return;
  }
  String name=value.getName();
  _config.setText(name.substring(name.lastIndexOf('/') + 1));
  @SuppressWarnings("String_Node_Str") Class<ManagedConfig> clazz=(Class<ManagedConfig>)_property.getArgumentType(ConfigReference.class);
  ManagedConfig config=_ctx.getConfigManager().getConfig(clazz,name);
  if (!(config instanceof ParameterizedConfig)) {
    _arguments.removeAll();
    value.getArguments().clear();
    if (config == null) {
      _config.setForeground(Color.red);
    }
    return;
  }
  _config.setForeground(_content.getForeground());
  int ocount=_arguments.getComponentCount();
  HashMap<String,PropertyEditor> oeditors=new HashMap<String,PropertyEditor>();
  if (transfer) {
    for (int ii=0; ii < ocount; ii++) {
      PropertyEditor editor=(PropertyEditor)_arguments.getComponent(ii);
      oeditors.put(editor.getProperty().getName(),editor);
    }
  }
  int idx=0;
  Object nargs=value.getArguments();
  ParameterizedConfig pconfig=(ParameterizedConfig)config;
  for (  Parameter parameter : pconfig.parameters) {
    Property property=parameter.getArgumentProperty(pconfig);
    if (property == null) {
      continue;
    }
    PropertyEditor editor=null;
    if (idx < ocount) {
      PropertyEditor oeditor=(PropertyEditor)_arguments.getComponent(idx);
      if (oeditor.getProperty().equals(property)) {
        if (transfer) {
          property.set(nargs,property.get(oeditor.getObject()));
        }
        editor=oeditor;
      }
 else {
        _arguments.remove(idx);
      }
    }
    if (editor == null) {
      editor=PropertyEditor.createEditor(_ctx,property,_lineage);
      editor.addChangeListener(this);
      _arguments.add(editor,idx);
      PropertyEditor oeditor=oeditors.get(parameter.name);
      if (oeditor != null) {
        Property oproperty=oeditor.getProperty();
        if (property.getGenericType().equals(oproperty.getGenericType())) {
          Object ovalue=oproperty.get(oeditor.getObject());
          if (property.isLegalValue(ovalue)) {
            property.set(nargs,ovalue);
          }
        }
      }
    }
    editor.setObject(nargs);
    idx++;
  }
  while (ocount > idx) {
    _arguments.remove(--ocount);
  }
  SwingUtil.refresh(_arguments);
  for (Iterator<String> it=value.getArguments().keySet().iterator(); it.hasNext(); ) {
    if (pconfig.getParameter(it.next()) == null) {
      it.remove();
    }
  }
  (_listenee=pconfig).addListener(this);
}