Program: 72982
Project: 72982
Buggy source:
/** 
 * Return a new default widget for configuring the specified object. This is used by the Configurer for objects that do not contain an instance of EditorPaneFactory as an attribute.  The resulting component is an instance of the PtolemyQuery class that
 * @param object The object to be configured.
 * @param query The query to which new entries for the object are to beadded.
 * @return An instance of the PtolemyQuery class that is createdwith styles according to the type given in each visible attribute.
 */
public static Component createEditorPane(NamedObj object,PtolemyQuery query){
  JTabbedPane tabs=new JTabbedPane();
  boolean foundOne=false;
  List<Settable> parameters=new LinkedList<Settable>(object.attributeList(Settable.class));
  int numberOfTabs=1;
  PtolemyQuery mainTab=new PtolemyQuery(object);
  mainTab.setTextWidth(40);
  tabs.addTab(object.getDisplayName(),mainTab);
  try {
    Set<Decorator> decorators=object.decorators();
    for (    Decorator decorator : decorators) {
      DecoratorAttributes decoratorAttributes=object.getDecoratorAttributes(decorator);
      if (decoratorAttributes != null) {
        PtolemyQuery decoratorQuery=new PtolemyQuery(object);
        decoratorQuery.setAlignmentY(Component.TOP_ALIGNMENT);
        decoratorQuery.setTextWidth(40);
        decoratorQuery.addText("String_Node_Str" + decorator.getFullName(),Color.BLACK,0);
        boolean foundDecoratorAttribute=false;
        for (        Object attribute : decoratorAttributes.attributeList()) {
          if (attribute instanceof Settable) {
            Settable settable=(Settable)attribute;
            if (Configurer.isVisible(object,settable)) {
              foundDecoratorAttribute=true;
              decoratorQuery.addStyledEntry(settable);
            }
          }
        }
        foundOne=foundOne || foundDecoratorAttribute;
        if (foundDecoratorAttribute) {
          tabs.addTab(decorator.getName(),decoratorQuery);
          numberOfTabs+=1;
        }
      }
    }
  }
 catch (  IllegalActionException e) {
    MessageHandler.error("String_Node_Str",e);
  }
  if (numberOfTabs > 1) {
    query.add(tabs);
  }
  PtolemyQuery queryForMainAttributes=numberOfTabs > 1 ? mainTab : query;
  for (  Settable parameter : parameters) {
    if (Configurer.isVisible(object,parameter)) {
      foundOne=true;
      queryForMainAttributes.addStyledEntry(parameter);
    }
  }
  if (!foundOne) {
    return new JLabel(object.getName() + "String_Node_Str");
  }
  return query;
}

Fixed version (ground truth):
/** 
 * Return a new default widget for configuring the specified object. This is used by the Configurer for objects that do not contain an instance of EditorPaneFactory as an attribute.  The resulting component is an instance of the PtolemyQuery class that
 * @param object The object to be configured.
 * @param query The query to which new entries for the object are to beadded.
 * @return An instance of the PtolemyQuery class that is createdwith styles according to the type given in each visible attribute.
 */
public static Component createEditorPane(NamedObj object,PtolemyQuery query){
  query.setTextWidth(DEFAULT_QUERY_WIDTH);
  boolean foundOne=false;
  List<Settable> parameters=new LinkedList<Settable>(object.attributeList(Settable.class));
  for (  Settable parameter : parameters) {
    if (Configurer.isVisible(object,parameter)) {
      foundOne=true;
      query.addStyledEntry(parameter);
    }
  }
  if (!foundOne) {
    return new JLabel(object.getName() + "String_Node_Str");
  }
  return query;
}