Program: 152020
Project: 152020
Buggy source:
/** 
 * (Re)populates the specified node.
 */
protected void populateNode(DefaultMutableTreeNode node,String label,Object value,Class<?>[] subtypes,Property property,Object comp){
  if (value == null || value instanceof Boolean || value instanceof Number || value instanceof Color4f || value instanceof File || value instanceof Quaternion || value instanceof String || value instanceof Transform2D || value instanceof Transform3D || value instanceof Vector2f || value instanceof Vector3f || value instanceof Enum) {
    Object dval=value;
    if (value == null) {
      dval=_msgs.get("String_Node_Str");
    }
 else     if (value instanceof String) {
      dval="String_Node_Str" + value + "String_Node_Str";
    }
 else     if (value instanceof Enum) {
      Enum<?> eval=(Enum)value;
      dval=getLabel(eval,_msgmgr.getBundle(Introspector.getMessageBundle(eval.getDeclaringClass())));
    }
 else     if (value instanceof Integer && property.getAnnotation().editor().equals("String_Node_Str")) {
      int ival=(Integer)value;
      String mode=property.getAnnotation().mode();
      if (mode.equals("String_Node_Str")) {
        ClassRecord crec=_ctx.getColorPository().getClassRecord(ival);
        dval=(crec == null) ? dval : crec.name;
      }
 else       if (mode.length() > 0) {
        ColorRecord color=_ctx.getColorPository().getColorRecord(ival >> 8,ival & 0xFF);
      }
 else {
        ColorRecord crec=_ctx.getColorPository().getColorRecord(ival >> 8,ival & 0xFF);
        dval=(crec == null) ? dval : (mode.length() > 0 ? "String_Node_Str" : crec.cclass.name + "String_Node_Str") + crec.name;
      }
    }
    node.setUserObject(new NodeObject(label + "String_Node_Str" + dval,value,property,comp));
    node.setAllowsChildren(false);
  }
 else   if (value instanceof ConfigReference) {
    ConfigReference<?> ref=(ConfigReference)value;
    String name=ref.getName();
    node.setUserObject(new NodeObject(label + "String_Node_Str" + name,value,property,comp));
    node.setAllowsChildren(true);
    int ccount=node.getChildCount();
    int idx=0;
    if (property != null) {
      @SuppressWarnings("String_Node_Str") Class<ManagedConfig> clazz=(Class<ManagedConfig>)property.getArgumentType(ConfigReference.class);
      ManagedConfig config=_ctx.getConfigManager().getRawConfig(clazz,name);
      if (config instanceof ParameterizedConfig) {
        ParameterizedConfig pconfig=(ParameterizedConfig)config;
        if (pconfig.parameters.length > 0) {
          for (          Parameter param : pconfig.parameters) {
            Property aprop=param.getArgumentProperty(pconfig);
            if (aprop != null) {
              DefaultMutableTreeNode child=new DefaultMutableTreeNode();
              if (idx < ccount) {
                DefaultMutableTreeNode ochild=(DefaultMutableTreeNode)node.getChildAt(idx);
                NodeObject onobj=(NodeObject)ochild.getUserObject();
                if (onobj.property == aprop) {
                  child=ochild;
                }
                node.remove(idx);
              }
              node.insert(child,idx++);
              populateNode(child,param.name,aprop.get(ref.getArguments()),aprop.getSubtypes(),aprop,param.name);
            }
          }
        }
      }
    }
    for (int ii=idx; ii < ccount; ii++) {
      node.remove(idx);
    }
    if (node.getChildCount() == 0) {
      node.setAllowsChildren(false);
    }
  }
 else   if (value instanceof List || value.getClass().isArray()) {
    node.setUserObject(new NodeObject(label,value,property,comp));
    node.setAllowsChildren(true);
    Class<?>[] componentSubtypes=(property != null) ? property.getComponentSubtypes() : new Class[0];
    int ccount=node.getChildCount();
    int length=(value instanceof List) ? ((List)value).size() : Array.getLength(value);
    for (int ii=0; ii < length; ii++) {
      DefaultMutableTreeNode child;
      if (ii < ccount) {
        child=(DefaultMutableTreeNode)node.getChildAt(ii);
      }
 else {
        node.insert(child=new DefaultMutableTreeNode(),ii);
      }
      populateNode(child,String.valueOf(ii),(value instanceof List) ? ((List)value).get(ii) : Array.get(value,ii),componentSubtypes,null,ii);
    }
    for (int ii=length; ii < ccount; ii++) {
      node.remove(length);
    }
  }
 else {
    if (subtypes.length > 1) {
      label=label + "String_Node_Str" + getLabel(value.getClass());
    }
    node.setUserObject(new NodeObject(label,value,property,comp));
    updatePropertyNodes(node,value);
  }
}

Fixed version (ground truth):
/** 
 * (Re)populates the specified node.
 */
protected void populateNode(DefaultMutableTreeNode node,String label,Object value,Class<?>[] subtypes,Property property,Object comp){
  if (value == null || value instanceof Boolean || value instanceof Number || value instanceof Color4f || value instanceof File || value instanceof Quaternion || value instanceof String || value instanceof Transform2D || value instanceof Transform3D || value instanceof Vector2f || value instanceof Vector3f || value instanceof Enum) {
    Object dval=value;
    if (value == null) {
      dval=_msgs.get("String_Node_Str");
    }
 else     if (value instanceof String) {
      dval="String_Node_Str" + value + "String_Node_Str";
    }
 else     if (value instanceof Enum) {
      Enum<?> eval=(Enum)value;
      dval=getLabel(eval,_msgmgr.getBundle(Introspector.getMessageBundle(eval.getDeclaringClass())));
    }
 else     if (value instanceof Integer && property.getAnnotation().editor().equals("String_Node_Str")) {
      int ival=(Integer)value;
      String mode=property.getAnnotation().mode();
      if (mode.equals("String_Node_Str")) {
        ClassRecord crec=_ctx.getColorPository().getClassRecord(ival);
        dval=(crec == null) ? dval : crec.name;
      }
 else       if (mode.length() > 0) {
        ColorRecord color=_ctx.getColorPository().getColorRecord(ival >> 8,ival & 0xFF);
      }
 else {
        ColorRecord crec=_ctx.getColorPository().getColorRecord(ival >> 8,ival & 0xFF);
        dval=(crec == null) ? dval : (mode.length() > 0 ? "String_Node_Str" : crec.cclass.name + "String_Node_Str") + crec.name;
      }
    }
    node.setUserObject(new NodeObject(label + "String_Node_Str" + dval,value,property,comp));
    node.setAllowsChildren(false);
  }
 else   if (value instanceof ConfigReference) {
    ConfigReference<?> ref=(ConfigReference)value;
    String name=ref.getName();
    node.setUserObject(new NodeObject(label + "String_Node_Str" + name,value,property,comp));
    node.setAllowsChildren(true);
    int ccount=node.getChildCount();
    int idx=0;
    if (property != null) {
      Class<?> refTypeClass=property.getArgumentType(ConfigReference.class);
      if (refTypeClass == null) {
        if (_object instanceof DerivedConfig) {
          refTypeClass=((DerivedConfig)_object).cclass;
        }
        if (refTypeClass == null) {
          log.warning("String_Node_Str","String_Node_Str",ref);
        }
      }
      @SuppressWarnings("String_Node_Str") Class<ManagedConfig> clazz=(Class<ManagedConfig>)refTypeClass;
      ManagedConfig config=_ctx.getConfigManager().getRawConfig(clazz,name);
      if (config instanceof ParameterizedConfig) {
        ParameterizedConfig pconfig=(ParameterizedConfig)config;
        if (pconfig.parameters.length > 0) {
          for (          Parameter param : pconfig.parameters) {
            Property aprop=param.getArgumentProperty(pconfig);
            if (aprop != null) {
              DefaultMutableTreeNode child=new DefaultMutableTreeNode();
              if (idx < ccount) {
                DefaultMutableTreeNode ochild=(DefaultMutableTreeNode)node.getChildAt(idx);
                NodeObject onobj=(NodeObject)ochild.getUserObject();
                if (onobj.property == aprop) {
                  child=ochild;
                }
                node.remove(idx);
              }
              node.insert(child,idx++);
              populateNode(child,param.name,aprop.get(ref.getArguments()),aprop.getSubtypes(),aprop,param.name);
            }
          }
        }
      }
    }
    for (int ii=idx; ii < ccount; ii++) {
      node.remove(idx);
    }
    if (node.getChildCount() == 0) {
      node.setAllowsChildren(false);
    }
  }
 else   if (value instanceof List || value.getClass().isArray()) {
    node.setUserObject(new NodeObject(label,value,property,comp));
    node.setAllowsChildren(true);
    Class<?>[] componentSubtypes=(property != null) ? property.getComponentSubtypes() : new Class[0];
    int ccount=node.getChildCount();
    int length=(value instanceof List) ? ((List)value).size() : Array.getLength(value);
    for (int ii=0; ii < length; ii++) {
      DefaultMutableTreeNode child;
      if (ii < ccount) {
        child=(DefaultMutableTreeNode)node.getChildAt(ii);
      }
 else {
        node.insert(child=new DefaultMutableTreeNode(),ii);
      }
      populateNode(child,String.valueOf(ii),(value instanceof List) ? ((List)value).get(ii) : Array.get(value,ii),componentSubtypes,null,ii);
    }
    for (int ii=length; ii < ccount; ii++) {
      node.remove(length);
    }
  }
 else {
    if (subtypes.length > 1) {
      label=label + "String_Node_Str" + getLabel(value.getClass());
    }
    node.setUserObject(new NodeObject(label,value,property,comp));
    updatePropertyNodes(node,value);
  }
}