nus-yam/ex-repair huggingface dataset:
Program: 71423
Project: 71423
Buggy source:
/** 
 * Returns the fromIndex.  Valid for removed or moved events 
 */
public int getFromIndex(){
  return fromIndex;
}

Fixed version (ground truth):
/** 
 * Returns the fromIndex.  Valid for removed or moved events
 * @return int value for index from which the column was moved or removed
 */
public int getFromIndex(){
  return fromIndex;
}
Program: 71424
Project: 71424
Buggy source:
/** 
 * Returns the toIndex.  Valid for add and moved events 
 */
public int getToIndex(){
  return toIndex;
}

Fixed version (ground truth):
/** 
 * Returns the toIndex.  Valid for add and moved events
 * @return int value of column's new index
 */
public int getToIndex(){
  return toIndex;
}
Program: 71425
Project: 71425
Buggy source:
/** 
 * Tells listeners that a column was repositioned. 
 */
public void columnMoved(TableColumnModelEvent e);

Fixed version (ground truth):
/** 
 * Tells listeners that a column was repositioned.
 * @param e a {@code TableColumnModelEvent}
 */
public void columnMoved(TableColumnModelEvent e);
Program: 71426
Project: 71426
Buggy source:
/** 
 * Tells listeners that the selection model of the TableColumnModel changed.
 */
public void columnSelectionChanged(ListSelectionEvent e);

Fixed version (ground truth):
/** 
 * Tells listeners that the selection model of the TableColumnModel changed.
 * @param e a {@code ListSelectionEvent}
 */
public void columnSelectionChanged(ListSelectionEvent e);
Program: 71427
Project: 71427
Buggy source:
/** 
 * Tells listeners that a column was removed from the model. 
 */
public void columnRemoved(TableColumnModelEvent e);

Fixed version (ground truth):
/** 
 * Tells listeners that a column was removed from the model.
 * @param e a {@code TableColumnModelEvent}
 */
public void columnRemoved(TableColumnModelEvent e);
Program: 71428
Project: 71428
Buggy source:
/** 
 * Tells listeners that a column was moved due to a margin change. 
 */
public void columnMarginChanged(ChangeEvent e);

Fixed version (ground truth):
/** 
 * Tells listeners that a column was moved due to a margin change.
 * @param e a {@code ChangeEvent}
 */
public void columnMarginChanged(ChangeEvent e);
Program: 71429
Project: 71429
Buggy source:
/** 
 * Tells listeners that a column was added to the model. 
 */
public void columnAdded(TableColumnModelEvent e);

Fixed version (ground truth):
/** 
 * Tells listeners that a column was added to the model.
 * @param e a {@code TableColumnModelEvent}
 */
public void columnAdded(TableColumnModelEvent e);
Program: 71430
Project: 71430
Buggy source:
protected void init(String text,Icon icon){
  if (text != null) {
    setText(text);
  }
  if (icon != null) {
    setIcon(icon);
  }
  updateUI();
  setAlignmentX(LEFT_ALIGNMENT);
  setAlignmentY(CENTER_ALIGNMENT);
}

Fixed version (ground truth):
/** 
 * Initialization of the   {@code AbstractButton}.
 * @param text  the text of the button
 * @param icon  the Icon image to display on the button
 */
protected void init(String text,Icon icon){
  if (text != null) {
    setText(text);
  }
  if (icon != null) {
    setIcon(icon);
  }
  updateUI();
  setAlignmentX(LEFT_ALIGNMENT);
  setAlignmentY(CENTER_ALIGNMENT);
}
Program: 71431
Project: 71431
Buggy source:
protected ItemListener createItemListener(){
  return getHandler();
}

Fixed version (ground truth):
/** 
 * Returns   {@code ItemListener} that is added to model.
 * @return the {@code ItemListener}
 */
protected ItemListener createItemListener(){
  return getHandler();
}
Program: 71432
Project: 71432
Buggy source:
/** 
 * If both the icon and text properties are set, this property defines the space between them. <p> The default value of this property is 4 pixels. <p> This is a JavaBeans bound property.
 * @since 1.4
 * @see #getIconTextGap
 * @beaninfo bound: true attribute: visualUpdate true description: If both the icon and text properties are set, this property defines the space between them.
 */
public void setIconTextGap(int iconTextGap){
  int oldValue=this.iconTextGap;
  this.iconTextGap=iconTextGap;
  iconTextGapSet=true;
  firePropertyChange("String_Node_Str",oldValue,iconTextGap);
  if (iconTextGap != oldValue) {
    revalidate();
    repaint();
  }
}

Fixed version (ground truth):
/** 
 * If both the icon and text properties are set, this property defines the space between them. <p> The default value of this property is 4 pixels. <p> This is a JavaBeans bound property.
 * @param iconTextGap the space between icon and text if these properties are set.
 * @since 1.4
 * @see #getIconTextGap
 * @beaninfo bound: true attribute: visualUpdate true description: If both the icon and text properties are set, this property defines the space between them.
 */
public void setIconTextGap(int iconTextGap){
  int oldValue=this.iconTextGap;
  this.iconTextGap=iconTextGap;
  iconTextGapSet=true;
  firePropertyChange("String_Node_Str",oldValue,iconTextGap);
  if (iconTextGap != oldValue) {
    revalidate();
    repaint();
  }
}
Program: 71433
Project: 71433
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 button will be tied to that of the <code>Action</code>.
 * @param a the button's action
 * @since 1.3
 * @see Action
 * @see #setAction
 */
protected PropertyChangeListener createActionPropertyChangeListener(Action a){
  return createActionPropertyChangeListener0(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 button will be tied to that of the <code>Action</code>.
 * @param a the button's action
 * @return the {@code PropertyChangeListener}
 * @since 1.3
 * @see Action
 * @see #setAction
 */
protected PropertyChangeListener createActionPropertyChangeListener(Action a){
  return createActionPropertyChangeListener0(a);
}
Program: 71434
Project: 71434
Buggy source:
protected ActionListener createActionListener(){
  return getHandler();
}

Fixed version (ground truth):
/** 
 * Returns   {@code ActionListener} that is added to model.
 * @return the {@code ActionListener}
 */
protected ActionListener createActionListener(){
  return getHandler();
}
Program: 71435
Project: 71435
Buggy source:
/** 
 * Gets one of this object's properties using the associated key.
 * @see #putValue
 */
public Object getValue(String key);

Fixed version (ground truth):
/** 
 * Gets one of this object's properties using the associated key.
 * @param key a {@code String} containing the key
 * @return the {@code Object} value
 * @see #putValue
 */
public Object getValue(String key);
Program: 71436
Project: 71436
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: 71437
Project: 71437
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: 71438
Project: 71438
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: 71439
Project: 71439
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: 71440
Project: 71440
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: 71441
Project: 71441
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: 71442
Project: 71442
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: 71443
Project: 71443
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: 71444
Project: 71444
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: 71445
Project: 71445
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: 71446
Project: 71446
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: 71447
Project: 71447
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: 71448
Project: 71448
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: 71449
Project: 71449
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: 71450
Project: 71450
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: 71451
Project: 71451
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: 71452
Project: 71452
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: 71453
Project: 71453
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: 71454
Project: 71454
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: 71455
Project: 71455
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: 71456
Project: 71456
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: 71457
Project: 71457
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: 71458
Project: 71458
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: 71459
Project: 71459
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: 71460
Project: 71460
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: 71461
Project: 71461
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: 71462
Project: 71462
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: 71463
Project: 71463
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: 71464
Project: 71464
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: 71465
Project: 71465
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: 71466
Project: 71466
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: 71467
Project: 71467
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: 71468
Project: 71468
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: 71469
Project: 71469
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: 71470
Project: 71470
Buggy source:
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}

Fixed version (ground truth):
/** 
 * Constructs   {@code AccessibleJToggleButton}
 */
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}
Program: 71471
Project: 71471
Buggy source:
public void inject(@NotNull WSWebServiceContext context,@NotNull Object instance){
  InjectionPlan.buildInjectionPlan(instance.getClass(),WebServiceContext.class,false).inject(instance,context);
}

Fixed version (ground truth):
public void inject(@NotNull WSWebServiceContext context,@NotNull Object instance){
  InjectionPlan.<Object,WebServiceContext>buildInjectionPlan(instance.getClass(),WebServiceContext.class,false).inject(instance,context);
}
Program: 71472
Project: 71472
Buggy source:
/** 
 * Fetch the default value for the attribute. If there is no default value (such as for composite attributes), null will be returned.
 */
public String getDefaultValue(){
  return defaultValue;
}

Fixed version (ground truth):
/** 
 * Fetch the default value for the attribute. If there is no default value (such as for composite attributes), null will be returned.
 * @return default value for the attribute
 */
public String getDefaultValue(){
  return defaultValue;
}
Program: 71473
Project: 71473
Buggy source:
/** 
 * Indicates if the attribute should be inherited from the parent or not.
 */
public boolean isInherited(){
  return inherited;
}

Fixed version (ground truth):
/** 
 * Indicates if the attribute should be inherited from the parent or not.
 * @return true if the attribute should be inherited from the parent
 */
public boolean isInherited(){
  return inherited;
}
Program: 71474
Project: 71474
Buggy source:
/** 
 * Return the set of all possible CSS attribute keys.
 */
public static Attribute[] getAllAttributeKeys(){
  Attribute[] keys=new Attribute[Attribute.allAttributes.length];
  System.arraycopy(Attribute.allAttributes,0,keys,0,Attribute.allAttributes.length);
  return keys;
}

Fixed version (ground truth):
/** 
 * Return the set of all possible CSS attribute keys.
 * @return the set of all possible CSS attribute keys
 */
public static Attribute[] getAllAttributeKeys(){
  Attribute[] keys=new Attribute[Attribute.allAttributes.length];
  System.arraycopy(Attribute.allAttributes,0,keys,0,Attribute.allAttributes.length);
  return keys;
}
Program: 71476
Project: 71476
Buggy source:
/** 
 * Returns the set of actual HTML tags that are recognized by the default HTML reader. This set does not include tags that are manufactured by the reader.
 */
public static Tag[] getAllTags(){
  Tag[] tags=new Tag[Tag.allTags.length];
  System.arraycopy(Tag.allTags,0,tags,0,Tag.allTags.length);
  return tags;
}

Fixed version (ground truth):
/** 
 * Returns the set of actual HTML tags that are recognized by the default HTML reader. This set does not include tags that are manufactured by the reader.
 * @return the set of actual HTML tags thatare recognized by the default HTML reader
 */
public static Tag[] getAllTags(){
  Tag[] tags=new Tag[Tag.allTags.length];
  System.arraycopy(Tag.allTags,0,tags,0,Tag.allTags.length);
  return tags;
}
Program: 71477
Project: 71477
Buggy source:
/** 
 * Fetches an integer attribute value.  Attribute values are stored as a string, and this is a convenience method to convert to an actual integer.
 * @param attr the set of attributes to use to try to fetch a value
 * @param key the key to use to fetch the value
 * @param def the default value to use if the attribute isn'tdefined or there is an error converting to an integer
 */
public static int getIntegerAttributeValue(AttributeSet attr,Attribute key,int def){
  int value=def;
  String istr=(String)attr.getAttribute(key);
  if (istr != null) {
    try {
      value=Integer.valueOf(istr).intValue();
    }
 catch (    NumberFormatException e) {
      value=def;
    }
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Fetches an integer attribute value.  Attribute values are stored as a string, and this is a convenience method to convert to an actual integer.
 * @param attr the set of attributes to use to try to fetch a value
 * @param key the key to use to fetch the value
 * @param def the default value to use if the attribute isn'tdefined or there is an error converting to an integer
 * @return an attribute value
 */
public static int getIntegerAttributeValue(AttributeSet attr,Attribute key,int def){
  int value=def;
  String istr=(String)attr.getAttribute(key);
  if (istr != null) {
    try {
      value=Integer.valueOf(istr).intValue();
    }
 catch (    NumberFormatException e) {
      value=def;
    }
  }
  return value;
}
Program: 71479
Project: 71479
Buggy source:
/** 
 * Registers a handler for the given tag.  By default all of the well-known tags will have been registered. This can be used to change the handling of a particular tag or to add support for custom tags.
 */
protected void registerTag(HTML.Tag t,TagAction a){
  tagMap.put(t,a);
}

Fixed version (ground truth):
/** 
 * Registers a handler for the given tag.  By default all of the well-known tags will have been registered. This can be used to change the handling of a particular tag or to add support for custom tags.
 * @param t an HTML tag
 * @param a tag action handler
 */
protected void registerTag(HTML.Tag t,TagAction a){
  tagMap.put(t,a);
}
Program: 71480
Project: 71480
Buggy source:
/** 
 * Adds the given content that was encountered in a PRE element.  This synthesizes lines to hold the runs of text, and makes calls to addContent to actually add the text.
 */
protected void preContent(char[] data){
  int last=0;
  for (int i=0; i < data.length; i++) {
    if (data[i] == '\n') {
      addContent(data,last,i - last + 1);
      blockClose(HTML.Tag.IMPLIED);
      MutableAttributeSet a=new SimpleAttributeSet();
      a.addAttribute(CSS.Attribute.WHITE_SPACE,"String_Node_Str");
      blockOpen(HTML.Tag.IMPLIED,a);
      last=i + 1;
    }
  }
  if (last < data.length) {
    addContent(data,last,data.length - last);
  }
}

Fixed version (ground truth):
/** 
 * Adds the given content that was encountered in a PRE element.  This synthesizes lines to hold the runs of text, and makes calls to addContent to actually add the text.
 * @param data the given content
 */
protected void preContent(char[] data){
  int last=0;
  for (int i=0; i < data.length; i++) {
    if (data[i] == '\n') {
      addContent(data,last,i - last + 1);
      blockClose(HTML.Tag.IMPLIED);
      MutableAttributeSet a=new SimpleAttributeSet();
      a.addAttribute(CSS.Attribute.WHITE_SPACE,"String_Node_Str");
      blockOpen(HTML.Tag.IMPLIED,a);
      last=i + 1;
    }
  }
  if (last < data.length) {
    addContent(data,last,data.length - last);
  }
}
Program: 71482
Project: 71482
Buggy source:
/** 
 * Adds an instruction to the parse buffer to close out a block element of the given type.
 */
protected void blockClose(HTML.Tag t){
  inBlock--;
  if (!foundInsertTag) {
    return;
  }
  if (!lastWasNewline) {
    pushCharacterStyle();
    charAttr.addAttribute(IMPLIED_CR,Boolean.TRUE);
    addContent(NEWLINE,0,1,true);
    popCharacterStyle();
    lastWasNewline=true;
  }
  if (impliedP) {
    impliedP=false;
    inParagraph=false;
    if (t != HTML.Tag.IMPLIED) {
      blockClose(HTML.Tag.IMPLIED);
    }
  }
  ElementSpec prev=(parseBuffer.size() > 0) ? parseBuffer.lastElement() : null;
  if (prev != null && prev.getType() == ElementSpec.StartTagType) {
    char[] one=new char[1];
    one[0]=' ';
    addContent(one,0,1);
  }
  ElementSpec es=new ElementSpec(null,ElementSpec.EndTagType);
  parseBuffer.addElement(es);
}

Fixed version (ground truth):
/** 
 * Adds an instruction to the parse buffer to close out a block element of the given type.
 * @param t the HTML tag
 */
protected void blockClose(HTML.Tag t){
  inBlock--;
  if (!foundInsertTag) {
    return;
  }
  if (!lastWasNewline) {
    pushCharacterStyle();
    charAttr.addAttribute(IMPLIED_CR,Boolean.TRUE);
    addContent(NEWLINE,0,1,true);
    popCharacterStyle();
    lastWasNewline=true;
  }
  if (impliedP) {
    impliedP=false;
    inParagraph=false;
    if (t != HTML.Tag.IMPLIED) {
      blockClose(HTML.Tag.IMPLIED);
    }
  }
  ElementSpec prev=(parseBuffer.size() > 0) ? parseBuffer.lastElement() : null;
  if (prev != null && prev.getType() == ElementSpec.StartTagType) {
    char[] one=new char[1];
    one[0]=' ';
    addContent(one,0,1);
  }
  ElementSpec es=new ElementSpec(null,ElementSpec.EndTagType);
  parseBuffer.addElement(es);
}