nus-yam/ex-repair huggingface dataset:
Program: 36075
Project: 36075
Buggy source:
/** 
 * Returns whether the application has invoked <code>disableSwingFocusManager()</code>.
 * @see #disableSwingFocusManager
 * @deprecated As of 1.4, replaced by<code>KeyboardFocusManager.getDefaultFocusTraversalPolicy()</code>
 */
@Deprecated public static boolean isFocusManagerEnabled(){
  return enabled;
}

Fixed version (ground truth):
/** 
 * Returns whether the application has invoked <code>disableSwingFocusManager()</code>.
 * @return {@code true} if focus manager is enabled.
 * @see #disableSwingFocusManager
 * @deprecated As of 1.4, replaced by<code>KeyboardFocusManager.getDefaultFocusTraversalPolicy()</code>
 */
@Deprecated public static boolean isFocusManagerEnabled(){
  return enabled;
}
Program: 36076
Project: 36076
Buggy source:
/** 
 * Selects the list item that corresponds to the specified keyboard character and returns true, if there is an item corresponding to that character.  Otherwise, returns false.
 * @param keyChar a char, typically this is a keyboard keytyped by the user
 */
public boolean selectWithKeyChar(char keyChar){
  int index;
  if (keySelectionManager == null)   keySelectionManager=createDefaultKeySelectionManager();
  index=keySelectionManager.selectionForKey(keyChar,getModel());
  if (index != -1) {
    setSelectedIndex(index);
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
/** 
 * Selects the list item that corresponds to the specified keyboard character and returns true, if there is an item corresponding to that character.  Otherwise, returns false.
 * @param keyChar a char, typically this is a keyboard keytyped by the user
 * @return {@code true} if there is an item corresponding to that character.Otherwise, returns  {@code false}.
 */
public boolean selectWithKeyChar(char keyChar){
  int index;
  if (keySelectionManager == null)   keySelectionManager=createDefaultKeySelectionManager();
  index=keySelectionManager.selectionForKey(keyChar,getModel());
  if (index != -1) {
    setSelectedIndex(index);
    return true;
  }
 else   return false;
}
Program: 36077
Project: 36077
Buggy source:
protected void installAncestorListener(){
  addAncestorListener(new AncestorListener(){
    public void ancestorAdded(    AncestorEvent event){
      hidePopup();
    }
    public void ancestorRemoved(    AncestorEvent event){
      hidePopup();
    }
    public void ancestorMoved(    AncestorEvent event){
      if (event.getSource() != JComboBox.this)       hidePopup();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Registers ancestor listener so that it will receive  {@code AncestorEvents} when it or any of its ancestorsmove or are made visible or invisible. Events are also sent when the component or its ancestors are added or removed from the containment hierarchy.
 */
protected void installAncestorListener(){
  addAncestorListener(new AncestorListener(){
    public void ancestorAdded(    AncestorEvent event){
      hidePopup();
    }
    public void ancestorRemoved(    AncestorEvent event){
      hidePopup();
    }
    public void ancestorMoved(    AncestorEvent event){
      if (event.getSource() != JComboBox.this)       hidePopup();
    }
  }
);
}
Program: 36078
Project: 36078
Buggy source:
/** 
 * Creates and returns a <code>PropertyChangeListener</code> that is responsible for listening for changes from the specified <code>Action</code> and updating the appropriate properties. <p> <b>Warning:</b> If you subclass this do not create an anonymous inner class.  If you do the lifetime of the combobox will be tied to that of the <code>Action</code>.
 * @param a the combobox's action
 * @since 1.3
 * @see Action
 * @see #setAction
 */
protected PropertyChangeListener createActionPropertyChangeListener(Action a){
  return new ComboBoxActionPropertyChangeListener(this,a);
}

Fixed version (ground truth):
/** 
 * Creates and returns a <code>PropertyChangeListener</code> that is responsible for listening for changes from the specified <code>Action</code> and updating the appropriate properties. <p> <b>Warning:</b> If you subclass this do not create an anonymous inner class.  If you do the lifetime of the combobox will be tied to that of the <code>Action</code>.
 * @param a the combobox's action
 * @return the {@code PropertyChangeListener}
 * @since 1.3
 * @see Action
 * @see #setAction
 */
protected PropertyChangeListener createActionPropertyChangeListener(Action a){
  return new ComboBoxActionPropertyChangeListener(this,a);
}
Program: 36079
Project: 36079
Buggy source:
/** 
 * Sets the object that translates a keyboard character into a list selection. Typically, the first selection with a matching first character becomes the selected item.
 * @beaninfo expert: true description: The objects that changes the selection when a key is pressed.
 */
public void setKeySelectionManager(KeySelectionManager aManager){
  keySelectionManager=aManager;
}

Fixed version (ground truth):
/** 
 * Sets the object that translates a keyboard character into a list selection. Typically, the first selection with a matching first character becomes the selected item.
 * @param aManager a key selection manager
 * @beaninfo expert: true description: The objects that changes the selection when a key is pressed.
 */
public void setKeySelectionManager(KeySelectionManager aManager){
  keySelectionManager=aManager;
}
Program: 36080
Project: 36080
Buggy source:
/** 
 * Sets the visibility of the popup.
 */
public void setPopupVisible(boolean v){
  getUI().setPopupVisible(this,v);
}

Fixed version (ground truth):
/** 
 * Sets the visibility of the popup.
 * @param v if {@code true} shows the popup, otherwise, hides the popup.
 */
public void setPopupVisible(boolean v){
  getUI().setPopupVisible(this,v);
}
Program: 36081
Project: 36081
Buggy source:
/** 
 * Subclasses that want to handle change events from the model differently can override this to return an instance of a custom <code>ChangeListener</code> implementation. The default   {@code ChangeListener} simply calls the{@code fireStateChanged} method to forward {@code ChangeEvent}s to the   {@code ChangeListener}s that have been added directly to the progress bar.
 * @see #changeListener
 * @see #fireStateChanged
 * @see javax.swing.event.ChangeListener
 * @see javax.swing.BoundedRangeModel
 */
protected ChangeListener createChangeListener(){
  return new ModelListener();
}

Fixed version (ground truth):
/** 
 * Subclasses that want to handle change events from the model differently can override this to return an instance of a custom <code>ChangeListener</code> implementation. The default   {@code ChangeListener} simply calls the{@code fireStateChanged} method to forward {@code ChangeEvent}s to the   {@code ChangeListener}s that have been added directly to the progress bar.
 * @return the instance of a custom {@code ChangeListener} implementation.
 * @see #changeListener
 * @see #fireStateChanged
 * @see javax.swing.event.ChangeListener
 * @see javax.swing.BoundedRangeModel
 */
protected ChangeListener createChangeListener(){
  return new ModelListener();
}
Program: 36082
Project: 36082
Buggy source:
/** 
 * Creates a radio button that has the specified text, image, and selection state.
 * @param text  the string displayed on the radio button
 * @param icon  the image that the button should display
 */
public JRadioButton(String text,Icon icon,boolean selected){
  super(text,icon,selected);
  setBorderPainted(false);
  setHorizontalAlignment(LEADING);
}

Fixed version (ground truth):
/** 
 * Creates a radio button that has the specified text, image, and selection state.
 * @param text  the string displayed on the radio button
 * @param icon  the image that the button should display
 * @param selected if {@code true}, the button is initially selected otherwise, the button is initially unselected
 */
public JRadioButton(String text,Icon icon,boolean selected){
  super(text,icon,selected);
  setBorderPainted(false);
  setHorizontalAlignment(LEADING);
}
Program: 36083
Project: 36083
Buggy source:
/** 
 * Returns a properly configured <code>PropertyChangeListener</code> which updates the control as changes to the <code>Action</code> occur, or <code>null</code> if the default property change listener for the control is desired.
 * @return <code>null</code>
 */
protected PropertyChangeListener createActionChangeListener(JButton b){
  return null;
}

Fixed version (ground truth):
/** 
 * Returns a properly configured <code>PropertyChangeListener</code> which updates the control as changes to the <code>Action</code> occur, or <code>null</code> if the default property change listener for the control is desired.
 * @param b a {@code JButton}
 * @return {@code null}
 */
protected PropertyChangeListener createActionChangeListener(JButton b){
  return null;
}
Program: 36084
Project: 36084
Buggy source:
/** 
 * Returns the tool bar's current UI.
 * @see #setUI
 */
public ToolBarUI getUI(){
  return (ToolBarUI)ui;
}

Fixed version (ground truth):
/** 
 * Returns the tool bar's current UI.
 * @return the tool bar's current UI.
 * @see #setUI
 */
public ToolBarUI getUI(){
  return (ToolBarUI)ui;
}
Program: 36085
Project: 36085
Buggy source:
/** 
 * Return an array of all the listeners of the given type that were added to this model.  For example to find all of the ChangeListeners added to this model: <pre> myAbstractSpinnerModel.getListeners(ChangeListener.class); </pre>
 * @param listenerType the type of listeners to return, e.g. ChangeListener.class
 * @return all of the objects receiving <em>listenerType</em> notificationsfrom this model
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}

Fixed version (ground truth):
/** 
 * Return an array of all the listeners of the given type that were added to this model.  For example to find all of the ChangeListeners added to this model: <pre> myAbstractSpinnerModel.getListeners(ChangeListener.class); </pre>
 * @param < T > the type of requested listeners
 * @param listenerType the type of listeners to return, e.g. ChangeListener.class
 * @return all of the objects receiving <em>listenerType</em> notificationsfrom this model
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}
Program: 36086
Project: 36086
Buggy source:
/** 
 * Returns the <code>Action</code> names that are bound in this <code>ActionMap</code>.
 */
public Object[] keys(){
  if (arrayTable == null) {
    return null;
  }
  return arrayTable.getKeys(null);
}

Fixed version (ground truth):
/** 
 * Returns the <code>Action</code> names that are bound in this <code>ActionMap</code>.
 * @return an array of the keys
 */
public Object[] keys(){
  if (arrayTable == null) {
    return null;
  }
  return arrayTable.getKeys(null);
}
Program: 36087
Project: 36087
Buggy source:
/** 
 * Returns the binding for <code>key</code>, messaging the parent <code>ActionMap</code> if the binding is not locally defined.
 */
public Action get(Object key){
  Action value=(arrayTable == null) ? null : (Action)arrayTable.get(key);
  if (value == null) {
    ActionMap parent=getParent();
    if (parent != null) {
      return parent.get(key);
    }
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Returns the binding for <code>key</code>, messaging the parent <code>ActionMap</code> if the binding is not locally defined.
 * @param key a key
 * @return the binding for {@code key}
 */
public Action get(Object key){
  Action value=(arrayTable == null) ? null : (Action)arrayTable.get(key);
  if (value == null) {
    ActionMap parent=getParent();
    if (parent != null) {
      return parent.get(key);
    }
  }
  return value;
}
Program: 36088
Project: 36088
Buggy source:
/** 
 * Returns an array of the keys defined in this <code>ActionMap</code> and its parent. This method differs from <code>keys()</code> in that this method includes the keys defined in the parent.
 */
public Object[] allKeys(){
  int count=size();
  ActionMap parent=getParent();
  if (count == 0) {
    if (parent != null) {
      return parent.allKeys();
    }
    return keys();
  }
  if (parent == null) {
    return keys();
  }
  Object[] keys=keys();
  Object[] pKeys=parent.allKeys();
  if (pKeys == null) {
    return keys;
  }
  if (keys == null) {
    return pKeys;
  }
  HashMap<Object,Object> keyMap=new HashMap<Object,Object>();
  int counter;
  for (counter=keys.length - 1; counter >= 0; counter--) {
    keyMap.put(keys[counter],keys[counter]);
  }
  for (counter=pKeys.length - 1; counter >= 0; counter--) {
    keyMap.put(pKeys[counter],pKeys[counter]);
  }
  return keyMap.keySet().toArray();
}

Fixed version (ground truth):
/** 
 * Returns an array of the keys defined in this <code>ActionMap</code> and its parent. This method differs from <code>keys()</code> in that this method includes the keys defined in the parent.
 * @return an array of the keys
 */
public Object[] allKeys(){
  int count=size();
  ActionMap parent=getParent();
  if (count == 0) {
    if (parent != null) {
      return parent.allKeys();
    }
    return keys();
  }
  if (parent == null) {
    return keys();
  }
  Object[] keys=keys();
  Object[] pKeys=parent.allKeys();
  if (pKeys == null) {
    return keys;
  }
  if (keys == null) {
    return pKeys;
  }
  HashMap<Object,Object> keyMap=new HashMap<Object,Object>();
  int counter;
  for (counter=keys.length - 1; counter >= 0; counter--) {
    keyMap.put(keys[counter],keys[counter]);
  }
  for (counter=pKeys.length - 1; counter >= 0; counter--) {
    keyMap.put(pKeys[counter],pKeys[counter]);
  }
  return keyMap.keySet().toArray();
}
Program: 36089
Project: 36089
Buggy source:
/** 
 * Adds a binding for <code>key</code> to <code>action</code>. If <code>action</code> is null, this removes the current binding for <code>key</code>. <p>In most instances, <code>key</code> will be <code>action.getValue(NAME)</code>.
 */
public void put(Object key,Action action){
  if (key == null) {
    return;
  }
  if (action == null) {
    remove(key);
  }
 else {
    if (arrayTable == null) {
      arrayTable=new ArrayTable();
    }
    arrayTable.put(key,action);
  }
}

Fixed version (ground truth):
/** 
 * Adds a binding for <code>key</code> to <code>action</code>. If <code>action</code> is null, this removes the current binding for <code>key</code>. <p>In most instances, <code>key</code> will be <code>action.getValue(NAME)</code>.
 * @param key a key
 * @param action a binding for {@code key}
 */
public void put(Object key,Action action){
  if (key == null) {
    return;
  }
  if (action == null) {
    remove(key);
  }
 else {
    if (arrayTable == null) {
      arrayTable=new ArrayTable();
    }
    arrayTable.put(key,action);
  }
}
Program: 36090
Project: 36090
Buggy source:
/** 
 * Removes the binding for <code>key</code> from this <code>ActionMap</code>.
 */
public void remove(Object key){
  if (arrayTable != null) {
    arrayTable.remove(key);
  }
}

Fixed version (ground truth):
/** 
 * Removes the binding for <code>key</code> from this <code>ActionMap</code>.
 * @param key a key
 */
public void remove(Object key){
  if (arrayTable != null) {
    arrayTable.remove(key);
  }
}
Program: 36091
Project: 36091
Buggy source:
/** 
 * Returns whether a <code>ButtonModel</code> is selected.
 * @return <code>true</code> if the button is selected,otherwise returns <code>false</code>
 */
public boolean isSelected(ButtonModel m){
  return (m == selection);
}

Fixed version (ground truth):
/** 
 * Returns whether a   {@code ButtonModel} is selected.
 * @param m an isntance of {@code ButtonModel}
 * @return {@code true} if the button is selected,otherwise returns  {@code false}
 */
public boolean isSelected(ButtonModel m){
  return (m == selection);
}
Program: 36092
Project: 36092
Buggy source:
/** 
 * Ask the editor to start editing and to select everything 
 */
public void selectAll();

Fixed version (ground truth):
/** 
 * Ask the editor to start editing and to select everything
 */
public void selectAll();
Program: 36093
Project: 36093
Buggy source:
/** 
 * Remove an ActionListener 
 */
public void removeActionListener(ActionListener l);

Fixed version (ground truth):
/** 
 * Remove an ActionListener
 * @param l an {@code ActionListener}
 */
public void removeActionListener(ActionListener l);
Program: 36094
Project: 36094
Buggy source:
/** 
 * Add an ActionListener. An action event is generated when the edited item changes 
 */
public void addActionListener(ActionListener l);

Fixed version (ground truth):
/** 
 * Add an ActionListener. An action event is generated when the edited item changes
 * @param l an {@code ActionListener}
 */
public void addActionListener(ActionListener l);
Program: 36095
Project: 36095
Buggy source:
/** 
 * Return the edited item 
 */
public Object getItem();

Fixed version (ground truth):
/** 
 * Returns the edited item
 * @return the edited item
 */
public Object getItem();
Program: 36096
Project: 36096
Buggy source:
/** 
 * Return the component that should be added to the tree hierarchy for this editor
 */
public Component getEditorComponent();

Fixed version (ground truth):
/** 
 * Returns the component that should be added to the tree hierarchy for this editor
 * @return the component
 */
public Component getEditorComponent();
Program: 36097
Project: 36097
Buggy source:
/** 
 * Set the item that should be edited. Cancel any editing if necessary 
 */
public void setItem(Object anObject);

Fixed version (ground truth):
/** 
 * Set the item that should be edited. Cancel any editing if necessary
 * @param anObject an item
 */
public void setItem(Object anObject);
Program: 36098
Project: 36098
Buggy source:
/** 
 * Returns the component the <code>InputMap</code> was created for.
 */
public JComponent getComponent(){
  return component;
}

Fixed version (ground truth):
/** 
 * Returns the component the   {@code InputMap} was created for.
 * @return the component the {@code InputMap} was created for.
 */
public JComponent getComponent(){
  return component;
}
Program: 36099
Project: 36099
Buggy source:
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a <code>DefaultButtonModel</code> instance <code>m</code> for its action listeners with the following code: <pre>ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getActionListeners
 * @see #getChangeListeners
 * @see #getItemListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}

Fixed version (ground truth):
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a <code>DefaultButtonModel</code> instance <code>m</code> for its action listeners with the following code: <pre>ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param < T > the type of requested listeners
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getActionListeners
 * @see #getChangeListeners
 * @see #getItemListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}
Program: 36100
Project: 36100
Buggy source:
/** 
 * Creates and returns a   {@code ParallelGroup} that aligns it'selements along the baseline.
 * @param resizable whether the group is resizable
 * @param anchorBaselineToTop whether the baseline is anchored tothe top or bottom of the group
 * @see #createBaselineGroup
 * @see ParallelGroup
 */
public ParallelGroup createBaselineGroup(boolean resizable,boolean anchorBaselineToTop){
  return new BaselineGroup(resizable,anchorBaselineToTop);
}

Fixed version (ground truth):
/** 
 * Creates and returns a   {@code ParallelGroup} that aligns it'selements along the baseline.
 * @param resizable whether the group is resizable
 * @param anchorBaselineToTop whether the baseline is anchored tothe top or bottom of the group
 * @return the {@code ParallelGroup}
 * @see #createBaselineGroup
 * @see ParallelGroup
 */
public ParallelGroup createBaselineGroup(boolean resizable,boolean anchorBaselineToTop){
  return new BaselineGroup(resizable,anchorBaselineToTop);
}
Program: 36101
Project: 36101
Buggy source:
/** 
 * Sets the <code>wantsInput</code> property. If <code>newValue</code> is true, an input component (such as a text field or combo box) whose parent is <code>parentComponent</code> is provided to allow the user to input a value. If <code>getSelectionValues</code> returns a non-<code>null</code> array, the input value is one of the objects in that array. Otherwise the input value is whatever the user inputs. <p> This is a bound property.
 * @see #setSelectionValues
 * @see #setInputValue
 * @beaninfo preferred: true bound: true description: Flag which allows the user to input a value.
 */
public void setWantsInput(boolean newValue){
  boolean oldValue=wantsInput;
  wantsInput=newValue;
  firePropertyChange(WANTS_INPUT_PROPERTY,oldValue,newValue);
}

Fixed version (ground truth):
/** 
 * Sets the <code>wantsInput</code> property. If <code>newValue</code> is true, an input component (such as a text field or combo box) whose parent is <code>parentComponent</code> is provided to allow the user to input a value. If <code>getSelectionValues</code> returns a non-<code>null</code> array, the input value is one of the objects in that array. Otherwise the input value is whatever the user inputs. <p> This is a bound property.
 * @param newValue if true, an input component whose parent is {@code parentComponent}is provided to allow the user to input a value.
 * @see #setSelectionValues
 * @see #setInputValue
 * @beaninfo preferred: true bound: true description: Flag which allows the user to input a value.
 */
public void setWantsInput(boolean newValue){
  boolean oldValue=wantsInput;
  wantsInput=newValue;
  firePropertyChange(WANTS_INPUT_PROPERTY,oldValue,newValue);
}
Program: 36102
Project: 36102
Buggy source:
/** 
 * Creates a radio button menu item that has the specified text, image, and selection state.  All other constructors defer to this one.
 * @param text  the string displayed on the radio button
 * @param icon  the image that the button should display
 */
public JRadioButtonMenuItem(String text,Icon icon,boolean selected){
  super(text,icon);
  setModel(new JToggleButton.ToggleButtonModel());
  setSelected(selected);
  setFocusable(false);
}

Fixed version (ground truth):
/** 
 * Creates a radio button menu item that has the specified text, image, and selection state.  All other constructors defer to this one.
 * @param text  the string displayed on the radio button
 * @param icon  the image that the button should display
 * @param selected if {@code true}, the button is initially selected, otherwise, the button is initially unselected
 */
public JRadioButtonMenuItem(String text,Icon icon,boolean selected){
  super(text,icon);
  setModel(new JToggleButton.ToggleButtonModel());
  setSelected(selected);
  setFocusable(false);
}
Program: 36103
Project: 36103
Buggy source:
/** 
 * Sets the four BoundedRangeModel properties after forcing the arguments to obey the usual constraints: <pre> minimum &le; value &le; value+extent &le; maximum </pre>
 * @see BoundedRangeModel#setRangeProperties
 * @see #setValue
 * @see #setVisibleAmount
 * @see #setMinimum
 * @see #setMaximum
 */
public void setValues(int newValue,int newExtent,int newMin,int newMax){
  BoundedRangeModel m=getModel();
  int oldValue=m.getValue();
  m.setRangeProperties(newValue,newExtent,newMin,newMax,m.getValueIsAdjusting());
  if (accessibleContext != null) {
    accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,Integer.valueOf(oldValue),Integer.valueOf(m.getValue()));
  }
}

Fixed version (ground truth):
/** 
 * Sets the four BoundedRangeModel properties after forcing the arguments to obey the usual constraints: <pre> minimum &le; value &le; value+extent &le; maximum </pre>
 * @param newValue an int giving the current value
 * @param newExtent an int giving the amount by which the value can "jump"
 * @param newMin an int giving the minimum value
 * @param newMax an int giving the maximum value
 * @see BoundedRangeModel#setRangeProperties
 * @see #setValue
 * @see #setVisibleAmount
 * @see #setMinimum
 * @see #setMaximum
 */
public void setValues(int newValue,int newExtent,int newMin,int newMax){
  BoundedRangeModel m=getModel();
  int oldValue=m.getValue();
  m.setRangeProperties(newValue,newExtent,newMin,newMax,m.getValueIsAdjusting());
  if (accessibleContext != null) {
    accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,Integer.valueOf(oldValue),Integer.valueOf(m.getValue()));
  }
}
Program: 36104
Project: 36104
Buggy source:
/** 
 * Set the scrollbar's orientation to either VERTICAL or HORIZONTAL.
 * @exception IllegalArgumentException if orientation is not one of VERTICAL, HORIZONTAL
 * @see #getOrientation
 * @beaninfo preferred: true bound: true attribute: visualUpdate true description: The scrollbar's orientation. enum: VERTICAL JScrollBar.VERTICAL HORIZONTAL JScrollBar.HORIZONTAL
 */
public void setOrientation(int orientation){
  checkOrientation(orientation);
  int oldValue=this.orientation;
  this.orientation=orientation;
  firePropertyChange("String_Node_Str",oldValue,orientation);
  if ((oldValue != orientation) && (accessibleContext != null)) {
    accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY,((oldValue == VERTICAL) ? AccessibleState.VERTICAL : AccessibleState.HORIZONTAL),((orientation == VERTICAL) ? AccessibleState.VERTICAL : AccessibleState.HORIZONTAL));
  }
  if (orientation != oldValue) {
    revalidate();
  }
}

Fixed version (ground truth):
/** 
 * Set the scrollbar's orientation to either VERTICAL or HORIZONTAL.
 * @param orientation an orientation of the {@code JScrollBar}
 * @exception IllegalArgumentException if orientation is not one of VERTICAL, HORIZONTAL
 * @see #getOrientation
 * @beaninfo preferred: true bound: true attribute: visualUpdate true description: The scrollbar's orientation. enum: VERTICAL JScrollBar.VERTICAL HORIZONTAL JScrollBar.HORIZONTAL
 */
public void setOrientation(int orientation){
  checkOrientation(orientation);
  int oldValue=this.orientation;
  this.orientation=orientation;
  firePropertyChange("String_Node_Str",oldValue,orientation);
  if ((oldValue != orientation) && (accessibleContext != null)) {
    accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY,((oldValue == VERTICAL) ? AccessibleState.VERTICAL : AccessibleState.HORIZONTAL),((orientation == VERTICAL) ? AccessibleState.VERTICAL : AccessibleState.HORIZONTAL));
  }
  if (orientation != oldValue) {
    revalidate();
  }
}
Program: 36105
Project: 36105
Buggy source:
/** 
 * Returns data model that handles the scrollbar's four fundamental properties: minimum, maximum, value, extent.
 * @see #setModel
 */
public BoundedRangeModel getModel(){
  return model;
}

Fixed version (ground truth):
/** 
 * Returns data model that handles the scrollbar's four fundamental properties: minimum, maximum, value, extent.
 * @return the data model
 * @see #setModel
 */
public BoundedRangeModel getModel(){
  return model;
}
Program: 36106
Project: 36106
Buggy source:
/** 
 * Returns the delegate that implements the look and feel for this component.
 * @see JComponent#setUI
 */
public ScrollBarUI getUI(){
  return (ScrollBarUI)ui;
}

Fixed version (ground truth):
/** 
 * Returns the delegate that implements the look and feel for this component.
 * @return the scroll bar's current UI.
 * @see JComponent#setUI
 */
public ScrollBarUI getUI(){
  return (ScrollBarUI)ui;
}
Program: 36107
Project: 36107
Buggy source:
/** 
 * Sets the model's valueIsAdjusting property.  Scrollbar look and feel implementations should set this property to true when a knob drag begins, and to false when the drag ends.  The scrollbar model will not generate ChangeEvents while valueIsAdjusting is true.
 * @see #getValueIsAdjusting
 * @see BoundedRangeModel#setValueIsAdjusting
 * @beaninfo expert: true description: True if the scrollbar thumb is being dragged.
 */
public void setValueIsAdjusting(boolean b){
  BoundedRangeModel m=getModel();
  boolean oldValue=m.getValueIsAdjusting();
  m.setValueIsAdjusting(b);
  if ((oldValue != b) && (accessibleContext != null)) {
    accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY,((oldValue) ? AccessibleState.BUSY : null),((b) ? AccessibleState.BUSY : null));
  }
}

Fixed version (ground truth):
/** 
 * Sets the model's valueIsAdjusting property.  Scrollbar look and feel implementations should set this property to true when a knob drag begins, and to false when the drag ends.  The scrollbar model will not generate ChangeEvents while valueIsAdjusting is true.
 * @param b {@code true} if the upcoming changes to the value property are part of a series
 * @see #getValueIsAdjusting
 * @see BoundedRangeModel#setValueIsAdjusting
 * @beaninfo expert: true description: True if the scrollbar thumb is being dragged.
 */
public void setValueIsAdjusting(boolean b){
  BoundedRangeModel m=getModel();
  boolean oldValue=m.getValueIsAdjusting();
  m.setValueIsAdjusting(b);
  if ((oldValue != b) && (accessibleContext != null)) {
    accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY,((oldValue) ? AccessibleState.BUSY : null),((b) ? AccessibleState.BUSY : null));
  }
}
Program: 36108
Project: 36108
Buggy source:
/** 
 * Sets the model that handles the scrollbar's four fundamental properties: minimum, maximum, value, extent.
 * @see #getModel
 * @beaninfo bound: true expert: true description: The scrollbar's BoundedRangeModel.
 */
public void setModel(BoundedRangeModel newModel){
  Integer oldValue=null;
  BoundedRangeModel oldModel=model;
  if (model != null) {
    model.removeChangeListener(fwdAdjustmentEvents);
    oldValue=Integer.valueOf(model.getValue());
  }
  model=newModel;
  if (model != null) {
    model.addChangeListener(fwdAdjustmentEvents);
  }
  firePropertyChange("String_Node_Str",oldModel,model);
  if (accessibleContext != null) {
    accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,oldValue,new Integer(model.getValue()));
  }
}

Fixed version (ground truth):
/** 
 * Sets the model that handles the scrollbar's four fundamental properties: minimum, maximum, value, extent.
 * @param newModel a new model
 * @see #getModel
 * @beaninfo bound: true expert: true description: The scrollbar's BoundedRangeModel.
 */
public void setModel(BoundedRangeModel newModel){
  Integer oldValue=null;
  BoundedRangeModel oldModel=model;
  if (model != null) {
    model.removeChangeListener(fwdAdjustmentEvents);
    oldValue=Integer.valueOf(model.getValue());
  }
  model=newModel;
  if (model != null) {
    model.addChangeListener(fwdAdjustmentEvents);
  }
  firePropertyChange("String_Node_Str",oldModel,model);
  if (accessibleContext != null) {
    accessibleContext.firePropertyChange(AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,oldValue,new Integer(model.getValue()));
  }
}
Program: 36109
Project: 36109
Buggy source:
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}

Fixed version (ground truth):
/** 
 * Constructs   {@code AccessibleJToggleButton}
 */
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}
Program: 36110
Project: 36110
Buggy source:
/** 
 * Return an array of all the listeners of the given type that were added to this model.  For example to find all of the ChangeListeners added to this model: <pre> myAbstractSpinnerModel.getListeners(ChangeListener.class); </pre>
 * @param listenerType the type of listeners to return, e.g. ChangeListener.class
 * @return all of the objects receiving <em>listenerType</em> notificationsfrom this model
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}

Fixed version (ground truth):
/** 
 * Return an array of all the listeners of the given type that were added to this model.  For example to find all of the ChangeListeners added to this model: <pre> myAbstractSpinnerModel.getListeners(ChangeListener.class); </pre>
 * @param < T > the type of requested listeners
 * @param listenerType the type of listeners to return, e.g. ChangeListener.class
 * @return all of the objects receiving <em>listenerType</em> notificationsfrom this model
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}
Program: 36111
Project: 36111
Buggy source:
/** 
 * Returns the <code>Action</code> names that are bound in this <code>ActionMap</code>.
 */
public Object[] keys(){
  if (arrayTable == null) {
    return null;
  }
  return arrayTable.getKeys(null);
}

Fixed version (ground truth):
/** 
 * Returns the <code>Action</code> names that are bound in this <code>ActionMap</code>.
 * @return an array of the keys
 */
public Object[] keys(){
  if (arrayTable == null) {
    return null;
  }
  return arrayTable.getKeys(null);
}
Program: 36112
Project: 36112
Buggy source:
/** 
 * Returns the binding for <code>key</code>, messaging the parent <code>ActionMap</code> if the binding is not locally defined.
 */
public Action get(Object key){
  Action value=(arrayTable == null) ? null : (Action)arrayTable.get(key);
  if (value == null) {
    ActionMap parent=getParent();
    if (parent != null) {
      return parent.get(key);
    }
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Returns the binding for <code>key</code>, messaging the parent <code>ActionMap</code> if the binding is not locally defined.
 * @param key a key
 * @return the binding for {@code key}
 */
public Action get(Object key){
  Action value=(arrayTable == null) ? null : (Action)arrayTable.get(key);
  if (value == null) {
    ActionMap parent=getParent();
    if (parent != null) {
      return parent.get(key);
    }
  }
  return value;
}
Program: 36113
Project: 36113
Buggy source:
/** 
 * Returns an array of the keys defined in this <code>ActionMap</code> and its parent. This method differs from <code>keys()</code> in that this method includes the keys defined in the parent.
 */
public Object[] allKeys(){
  int count=size();
  ActionMap parent=getParent();
  if (count == 0) {
    if (parent != null) {
      return parent.allKeys();
    }
    return keys();
  }
  if (parent == null) {
    return keys();
  }
  Object[] keys=keys();
  Object[] pKeys=parent.allKeys();
  if (pKeys == null) {
    return keys;
  }
  if (keys == null) {
    return pKeys;
  }
  HashMap<Object,Object> keyMap=new HashMap<Object,Object>();
  int counter;
  for (counter=keys.length - 1; counter >= 0; counter--) {
    keyMap.put(keys[counter],keys[counter]);
  }
  for (counter=pKeys.length - 1; counter >= 0; counter--) {
    keyMap.put(pKeys[counter],pKeys[counter]);
  }
  return keyMap.keySet().toArray();
}

Fixed version (ground truth):
/** 
 * Returns an array of the keys defined in this <code>ActionMap</code> and its parent. This method differs from <code>keys()</code> in that this method includes the keys defined in the parent.
 * @return an array of the keys
 */
public Object[] allKeys(){
  int count=size();
  ActionMap parent=getParent();
  if (count == 0) {
    if (parent != null) {
      return parent.allKeys();
    }
    return keys();
  }
  if (parent == null) {
    return keys();
  }
  Object[] keys=keys();
  Object[] pKeys=parent.allKeys();
  if (pKeys == null) {
    return keys;
  }
  if (keys == null) {
    return pKeys;
  }
  HashMap<Object,Object> keyMap=new HashMap<Object,Object>();
  int counter;
  for (counter=keys.length - 1; counter >= 0; counter--) {
    keyMap.put(keys[counter],keys[counter]);
  }
  for (counter=pKeys.length - 1; counter >= 0; counter--) {
    keyMap.put(pKeys[counter],pKeys[counter]);
  }
  return keyMap.keySet().toArray();
}
Program: 36114
Project: 36114
Buggy source:
/** 
 * Adds a binding for <code>key</code> to <code>action</code>. If <code>action</code> is null, this removes the current binding for <code>key</code>. <p>In most instances, <code>key</code> will be <code>action.getValue(NAME)</code>.
 */
public void put(Object key,Action action){
  if (key == null) {
    return;
  }
  if (action == null) {
    remove(key);
  }
 else {
    if (arrayTable == null) {
      arrayTable=new ArrayTable();
    }
    arrayTable.put(key,action);
  }
}

Fixed version (ground truth):
/** 
 * Adds a binding for <code>key</code> to <code>action</code>. If <code>action</code> is null, this removes the current binding for <code>key</code>. <p>In most instances, <code>key</code> will be <code>action.getValue(NAME)</code>.
 * @param key a key
 * @param action a binding for {@code key}
 */
public void put(Object key,Action action){
  if (key == null) {
    return;
  }
  if (action == null) {
    remove(key);
  }
 else {
    if (arrayTable == null) {
      arrayTable=new ArrayTable();
    }
    arrayTable.put(key,action);
  }
}
Program: 36115
Project: 36115
Buggy source:
/** 
 * Removes the binding for <code>key</code> from this <code>ActionMap</code>.
 */
public void remove(Object key){
  if (arrayTable != null) {
    arrayTable.remove(key);
  }
}

Fixed version (ground truth):
/** 
 * Removes the binding for <code>key</code> from this <code>ActionMap</code>.
 * @param key a key
 */
public void remove(Object key){
  if (arrayTable != null) {
    arrayTable.remove(key);
  }
}
Program: 36116
Project: 36116
Buggy source:
/** 
 * Returns whether a <code>ButtonModel</code> is selected.
 * @return <code>true</code> if the button is selected,otherwise returns <code>false</code>
 */
public boolean isSelected(ButtonModel m){
  return (m == selection);
}

Fixed version (ground truth):
/** 
 * Returns whether a   {@code ButtonModel} is selected.
 * @param m an isntance of {@code ButtonModel}
 * @return {@code true} if the button is selected,otherwise returns  {@code false}
 */
public boolean isSelected(ButtonModel m){
  return (m == selection);
}
Program: 36117
Project: 36117
Buggy source:
/** 
 * Ask the editor to start editing and to select everything 
 */
public void selectAll();

Fixed version (ground truth):
/** 
 * Ask the editor to start editing and to select everything
 */
public void selectAll();
Program: 36118
Project: 36118
Buggy source:
/** 
 * Remove an ActionListener 
 */
public void removeActionListener(ActionListener l);

Fixed version (ground truth):
/** 
 * Remove an ActionListener
 * @param l an {@code ActionListener}
 */
public void removeActionListener(ActionListener l);
Program: 36119
Project: 36119
Buggy source:
/** 
 * Add an ActionListener. An action event is generated when the edited item changes 
 */
public void addActionListener(ActionListener l);

Fixed version (ground truth):
/** 
 * Add an ActionListener. An action event is generated when the edited item changes
 * @param l an {@code ActionListener}
 */
public void addActionListener(ActionListener l);
Program: 36120
Project: 36120
Buggy source:
/** 
 * Return the edited item 
 */
public Object getItem();

Fixed version (ground truth):
/** 
 * Returns the edited item
 * @return the edited item
 */
public Object getItem();
Program: 36121
Project: 36121
Buggy source:
/** 
 * Return the component that should be added to the tree hierarchy for this editor
 */
public Component getEditorComponent();

Fixed version (ground truth):
/** 
 * Returns the component that should be added to the tree hierarchy for this editor
 * @return the component
 */
public Component getEditorComponent();
Program: 36122
Project: 36122
Buggy source:
/** 
 * Set the item that should be edited. Cancel any editing if necessary 
 */
public void setItem(Object anObject);

Fixed version (ground truth):
/** 
 * Set the item that should be edited. Cancel any editing if necessary
 * @param anObject an item
 */
public void setItem(Object anObject);
Program: 36123
Project: 36123
Buggy source:
/** 
 * Returns the component the <code>InputMap</code> was created for.
 */
public JComponent getComponent(){
  return component;
}

Fixed version (ground truth):
/** 
 * Returns the component the   {@code InputMap} was created for.
 * @return the component the {@code InputMap} was created for.
 */
public JComponent getComponent(){
  return component;
}
Program: 36124
Project: 36124
Buggy source:
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a <code>DefaultButtonModel</code> instance <code>m</code> for its action listeners with the following code: <pre>ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getActionListeners
 * @see #getChangeListeners
 * @see #getItemListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}

Fixed version (ground truth):
/** 
 * Returns an array of all the objects currently registered as <code><em>Foo</em>Listener</code>s upon this model. <code><em>Foo</em>Listener</code>s are registered using the <code>add<em>Foo</em>Listener</code> method. <p> You can specify the <code>listenerType</code> argument with a class literal, such as <code><em>Foo</em>Listener.class</code>. For example, you can query a <code>DefaultButtonModel</code> instance <code>m</code> for its action listeners with the following code: <pre>ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));</pre> If no such listeners exist, this method returns an empty array.
 * @param < T > the type of requested listeners
 * @param listenerType  the type of listeners requested;this parameter should specify an interface that descends from <code>java.util.EventListener</code>
 * @return an array of all objects registered as<code><em>Foo</em>Listener</code>s on this model, or an empty array if no such listeners have been added
 * @exception ClassCastException if <code>listenerType</code> doesn'tspecify a class or interface that implements <code>java.util.EventListener</code>
 * @see #getActionListeners
 * @see #getChangeListeners
 * @see #getItemListeners
 * @since 1.3
 */
public <T extends EventListener>T[] getListeners(Class<T> listenerType){
  return listenerList.getListeners(listenerType);
}
Program: 36125
Project: 36125
Buggy source:
/** 
 * Creates and returns a   {@code ParallelGroup} that aligns it'selements along the baseline.
 * @param resizable whether the group is resizable
 * @param anchorBaselineToTop whether the baseline is anchored tothe top or bottom of the group
 * @see #createBaselineGroup
 * @see ParallelGroup
 */
public ParallelGroup createBaselineGroup(boolean resizable,boolean anchorBaselineToTop){
  return new BaselineGroup(resizable,anchorBaselineToTop);
}

Fixed version (ground truth):
/** 
 * Creates and returns a   {@code ParallelGroup} that aligns it'selements along the baseline.
 * @param resizable whether the group is resizable
 * @param anchorBaselineToTop whether the baseline is anchored tothe top or bottom of the group
 * @return the {@code ParallelGroup}
 * @see #createBaselineGroup
 * @see ParallelGroup
 */
public ParallelGroup createBaselineGroup(boolean resizable,boolean anchorBaselineToTop){
  return new BaselineGroup(resizable,anchorBaselineToTop);
}
Program: 36126
Project: 36126
Buggy source:
/** 
 * Sets the <code>wantsInput</code> property. If <code>newValue</code> is true, an input component (such as a text field or combo box) whose parent is <code>parentComponent</code> is provided to allow the user to input a value. If <code>getSelectionValues</code> returns a non-<code>null</code> array, the input value is one of the objects in that array. Otherwise the input value is whatever the user inputs. <p> This is a bound property.
 * @see #setSelectionValues
 * @see #setInputValue
 * @beaninfo preferred: true bound: true description: Flag which allows the user to input a value.
 */
public void setWantsInput(boolean newValue){
  boolean oldValue=wantsInput;
  wantsInput=newValue;
  firePropertyChange(WANTS_INPUT_PROPERTY,oldValue,newValue);
}

Fixed version (ground truth):
/** 
 * Sets the <code>wantsInput</code> property. If <code>newValue</code> is true, an input component (such as a text field or combo box) whose parent is <code>parentComponent</code> is provided to allow the user to input a value. If <code>getSelectionValues</code> returns a non-<code>null</code> array, the input value is one of the objects in that array. Otherwise the input value is whatever the user inputs. <p> This is a bound property.
 * @param newValue if true, an input component whose parent is {@code parentComponent}is provided to allow the user to input a value.
 * @see #setSelectionValues
 * @see #setInputValue
 * @beaninfo preferred: true bound: true description: Flag which allows the user to input a value.
 */
public void setWantsInput(boolean newValue){
  boolean oldValue=wantsInput;
  wantsInput=newValue;
  firePropertyChange(WANTS_INPUT_PROPERTY,oldValue,newValue);
}
Program: 36127
Project: 36127
Buggy source:
/** 
 * Creates a radio button menu item that has the specified text, image, and selection state.  All other constructors defer to this one.
 * @param text  the string displayed on the radio button
 * @param icon  the image that the button should display
 */
public JRadioButtonMenuItem(String text,Icon icon,boolean selected){
  super(text,icon);
  setModel(new JToggleButton.ToggleButtonModel());
  setSelected(selected);
  setFocusable(false);
}

Fixed version (ground truth):
/** 
 * Creates a radio button menu item that has the specified text, image, and selection state.  All other constructors defer to this one.
 * @param text  the string displayed on the radio button
 * @param icon  the image that the button should display
 * @param selected if {@code true}, the button is initially selected, otherwise, the button is initially unselected
 */
public JRadioButtonMenuItem(String text,Icon icon,boolean selected){
  super(text,icon);
  setModel(new JToggleButton.ToggleButtonModel());
  setSelected(selected);
  setFocusable(false);
}