nus-yam/ex-repair huggingface dataset:
Program: 78684
Project: 78684
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: 78685
Project: 78685
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: 78686
Project: 78686
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: 78687
Project: 78687
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: 78688
Project: 78688
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: 78689
Project: 78689
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: 78690
Project: 78690
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: 78691
Project: 78691
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: 78692
Project: 78692
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: 78693
Project: 78693
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: 78694
Project: 78694
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: 78695
Project: 78695
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: 78696
Project: 78696
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: 78697
Project: 78697
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: 78698
Project: 78698
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: 78699
Project: 78699
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: 78700
Project: 78700
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: 78701
Project: 78701
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: 78702
Project: 78702
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: 78703
Project: 78703
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: 78704
Project: 78704
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: 78705
Project: 78705
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: 78706
Project: 78706
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: 78707
Project: 78707
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: 78708
Project: 78708
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: 78709
Project: 78709
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: 78710
Project: 78710
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: 78711
Project: 78711
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: 78712
Project: 78712
Buggy source:
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}

Fixed version (ground truth):
/** 
 * Constructs   {@code AccessibleJToggleButton}
 */
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}
Program: 78713
Project: 78713
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: 78714
Project: 78714
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: 78715
Project: 78715
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: 78716
Project: 78716
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: 78718
Project: 78718
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: 78719
Project: 78719
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: 78721
Project: 78721
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: 78722
Project: 78722
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: 78724
Project: 78724
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);
}
Program: 78726
Project: 78726
Buggy source:
/** 
 * Adds the given content to the textarea document. This method gets called when we are in a textarea context.  Therefore all text that is seen belongs to the text area and is hence added to the TextAreaDocument associated with the text area.
 */
protected void textAreaContent(char[] data){
  try {
    textAreaDocument.insertString(textAreaDocument.getLength(),new String(data),null);
  }
 catch (  BadLocationException e) {
  }
}

Fixed version (ground truth):
/** 
 * Adds the given content to the textarea document. This method gets called when we are in a textarea context.  Therefore all text that is seen belongs to the text area and is hence added to the TextAreaDocument associated with the text area.
 * @param data the given content
 */
protected void textAreaContent(char[] data){
  try {
    textAreaDocument.insertString(textAreaDocument.getLength(),new String(data),null);
  }
 catch (  BadLocationException e) {
  }
}
Program: 78728
Project: 78728
Buggy source:
/** 
 * Adds an instruction to the parse buffer to create a block element with the given attributes.
 */
protected void blockOpen(HTML.Tag t,MutableAttributeSet attr){
  if (impliedP) {
    blockClose(HTML.Tag.IMPLIED);
  }
  inBlock++;
  if (!canInsertTag(t,attr,true)) {
    return;
  }
  if (attr.isDefined(IMPLIED)) {
    attr.removeAttribute(IMPLIED);
  }
  lastWasNewline=false;
  attr.addAttribute(StyleConstants.NameAttribute,t);
  ElementSpec es=new ElementSpec(attr.copyAttributes(),ElementSpec.StartTagType);
  parseBuffer.addElement(es);
}

Fixed version (ground truth):
/** 
 * Adds an instruction to the parse buffer to create a block element with the given attributes.
 * @param t an HTML tag
 * @param attr the attribute set
 */
protected void blockOpen(HTML.Tag t,MutableAttributeSet attr){
  if (impliedP) {
    blockClose(HTML.Tag.IMPLIED);
  }
  inBlock++;
  if (!canInsertTag(t,attr,true)) {
    return;
  }
  if (attr.isDefined(IMPLIED)) {
    attr.removeAttribute(IMPLIED);
  }
  lastWasNewline=false;
  attr.addAttribute(StyleConstants.NameAttribute,t);
  ElementSpec es=new ElementSpec(attr.copyAttributes(),ElementSpec.StartTagType);
  parseBuffer.addElement(es);
}
Program: 78730
Project: 78730
Buggy source:
/** 
 * Adds content that is basically specified entirely in the attribute set.
 */
protected void addSpecialElement(HTML.Tag t,MutableAttributeSet a){
  if ((t != HTML.Tag.FRAME) && (!inParagraph) && (!inPre)) {
    nextTagAfterPImplied=t;
    blockOpen(HTML.Tag.IMPLIED,new SimpleAttributeSet());
    nextTagAfterPImplied=null;
    inParagraph=true;
    impliedP=true;
  }
  if (!canInsertTag(t,a,t.isBlock())) {
    return;
  }
  if (a.isDefined(IMPLIED)) {
    a.removeAttribute(IMPLIED);
  }
  emptyAnchor=false;
  a.addAttributes(charAttr);
  a.addAttribute(StyleConstants.NameAttribute,t);
  char[] one=new char[1];
  one[0]=' ';
  ElementSpec es=new ElementSpec(a.copyAttributes(),ElementSpec.ContentType,one,0,1);
  parseBuffer.addElement(es);
  if (t == HTML.Tag.FRAME) {
    lastWasNewline=true;
  }
}

Fixed version (ground truth):
/** 
 * Adds content that is basically specified entirely in the attribute set.
 * @param t an HTML tag
 * @param a the attribute set
 */
protected void addSpecialElement(HTML.Tag t,MutableAttributeSet a){
  if ((t != HTML.Tag.FRAME) && (!inParagraph) && (!inPre)) {
    nextTagAfterPImplied=t;
    blockOpen(HTML.Tag.IMPLIED,new SimpleAttributeSet());
    nextTagAfterPImplied=null;
    inParagraph=true;
    impliedP=true;
  }
  if (!canInsertTag(t,a,t.isBlock())) {
    return;
  }
  if (a.isDefined(IMPLIED)) {
    a.removeAttribute(IMPLIED);
  }
  emptyAnchor=false;
  a.addAttributes(charAttr);
  a.addAttribute(StyleConstants.NameAttribute,t);
  char[] one=new char[1];
  one[0]=' ';
  ElementSpec es=new ElementSpec(a.copyAttributes(),ElementSpec.ContentType,one,0,1);
  parseBuffer.addElement(es);
  if (t == HTML.Tag.FRAME) {
    lastWasNewline=true;
  }
}
Program: 78732
Project: 78732
Buggy source:
/** 
 * This is invoked after the stream has been parsed, but before <code>flush</code>. <code>eol</code> will be one of \n, \r or \r\n, which ever is encountered the most in parsing the stream.
 * @since 1.3
 */
public void handleEndOfLineString(String eol){
}

Fixed version (ground truth):
/** 
 * This is invoked after the stream has been parsed, but before <code>flush</code>. <code>eol</code> will be one of \n, \r or \r\n, which ever is encountered the most in parsing the stream.
 * @param eol value of eol
 * @since 1.3
 */
public void handleEndOfLineString(String eol){
}
Program: 78733
Project: 78733
Buggy source:
/** 
 * Returns number of elements, starting at the deepest leaf, needed to get to an element representing <code>tag</code>. This will return -1 if no elements is found representing <code>tag</code>, or 0 if the parent of the leaf at <code>offset</code> represents <code>tag</code>.
 */
protected int elementCountToTag(HTMLDocument doc,int offset,HTML.Tag tag){
  int depth=-1;
  Element e=doc.getCharacterElement(offset);
  while (e != null && e.getAttributes().getAttribute(StyleConstants.NameAttribute) != tag) {
    e=e.getParentElement();
    depth++;
  }
  if (e == null) {
    return -1;
  }
  return depth;
}

Fixed version (ground truth):
/** 
 * Returns number of elements, starting at the deepest leaf, needed to get to an element representing <code>tag</code>. This will return -1 if no elements is found representing <code>tag</code>, or 0 if the parent of the leaf at <code>offset</code> represents <code>tag</code>.
 * @param doc an instance of HTMLDocument
 * @param offset an offset to start from
 * @param tag tag to represent
 * @return number of elements
 */
protected int elementCountToTag(HTMLDocument doc,int offset,HTML.Tag tag){
  int depth=-1;
  Element e=doc.getCharacterElement(offset);
  while (e != null && e.getAttributes().getAttribute(StyleConstants.NameAttribute) != tag) {
    e=e.getParentElement();
    depth++;
  }
  if (e == null) {
    return -1;
  }
  return depth;
}
Program: 78734
Project: 78734
Buggy source:
/** 
 * Parse the given stream and drive the given callback with the results of the parse.  This method should be implemented to be thread-safe.
 */
public abstract void parse(Reader r,ParserCallback cb,boolean ignoreCharSet) throws IOException ;

Fixed version (ground truth):
/** 
 * Parse the given stream and drive the given callback with the results of the parse.  This method should be implemented to be thread-safe.
 * @throws IOException if an I/O exception occurs
 */
public abstract void parse(Reader r,ParserCallback cb,boolean ignoreCharSet) throws IOException ;
Program: 78735
Project: 78735
Buggy source:
/** 
 * @return HTMLDocument of <code>e</code>.
 */
protected HTMLDocument getHTMLDocument(JEditorPane e){
  Document d=e.getDocument();
  if (d instanceof HTMLDocument) {
    return (HTMLDocument)d;
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param e the JEditorPane
 * @return HTMLDocument of <code>e</code>.
 */
protected HTMLDocument getHTMLDocument(JEditorPane e){
  Document d=e.getDocument();
  if (d instanceof HTMLDocument) {
    return (HTMLDocument)d;
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 78736
Project: 78736
Buggy source:
/** 
 * returns the target for the link.
 */
public String getTarget(){
  return targetFrame;
}

Fixed version (ground truth):
/** 
 * returns the target for the link.
 * @return the target for the link
 */
public String getTarget(){
  return targetFrame;
}
Program: 78738
Project: 78738
Buggy source:
@Override public Node leaveIdentNode(final IdentNode identNode){
  if (ARGUMENTS.equals(identNode.getName()) && !isCurrentArg(identNode)) {
    throw new UnsupportedOperationException();
  }
  return identNode;
}

Fixed version (ground truth):
@Override public Node leaveIdentNode(final IdentNode identNode){
  if (isParam(identNode.getName()) || ARGUMENTS.equals(identNode.getName()) && !isCurrentArg(identNode)) {
    throw new UnsupportedOperationException();
  }
  return identNode;
}
Program: 78739
Project: 78739
Buggy source:
@Override public FunctionNode apply(final FunctionNode functionNode){
  this.initialFunctionNode=functionNode;
  if (data.isVariableArity()) {
    final ApplySpecialization spec=new ApplySpecialization(data.context,data,functionNode,actualCallSiteType);
    if (spec.transform()) {
      setTransformedFunctionNode(spec.getFunctionNode());
      return transformedFunctionNode;
    }
  }
  return functionNode;
}

Fixed version (ground truth):
@Override public FunctionNode apply(final FunctionNode functionNode){
  this.initialFunctionNode=functionNode;
  if (data.isVariableArity() && !CompiledFunction.isVarArgsType(actualCallSiteType)) {
    final ApplySpecialization spec=new ApplySpecialization(data.context,data,functionNode,actualCallSiteType);
    if (spec.transform()) {
      setTransformedFunctionNode(spec.getFunctionNode());
      return transformedFunctionNode;
    }
  }
  return functionNode;
}
Program: 78740
Project: 78740
Buggy source:
/** 
 * Returns a copy of this duration with the specified duration subtracted. <p> The duration amount is measured in terms of the specified unit. Only a subset of units are accepted by this method. The unit must either have an   {@linkplain TemporalUnit#isDurationEstimated() exact duration} orbe  {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception.<p> This instance is immutable and unaffected by this method call.
 * @param amountToSubtract  the amount of the period, measured in terms of the unit, positive or negative
 * @param unit  the unit that the period is measured in, must have an exact duration, not null
 * @return a {@code Duration} based on this duration with the specified duration subtracted, not null
 * @throws ArithmeticException if numeric overflow occurs
 */
public Duration minus(long amountToSubtract,TemporalUnit unit){
  return (amountToSubtract == Long.MIN_VALUE ? plus(Long.MAX_VALUE,unit).plus(1,unit) : plus(-amountToSubtract,unit));
}

Fixed version (ground truth):
/** 
 * Returns a copy of this duration with the specified duration subtracted. <p> The duration amount is measured in terms of the specified unit. Only a subset of units are accepted by this method. The unit must either have an   {@linkplain TemporalUnit#isDurationEstimated() exact duration} orbe  {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception.<p> This instance is immutable and unaffected by this method call.
 * @param amountToSubtract  the amount to subtract, measured in terms of the unit, positive or negative
 * @param unit  the unit that the amount is measured in, must have an exact duration, not null
 * @return a {@code Duration} based on this duration with the specified duration subtracted, not null
 * @throws ArithmeticException if numeric overflow occurs
 */
public Duration minus(long amountToSubtract,TemporalUnit unit){
  return (amountToSubtract == Long.MIN_VALUE ? plus(Long.MAX_VALUE,unit).plus(1,unit) : plus(-amountToSubtract,unit));
}
Program: 78741
Project: 78741
Buggy source:
/** 
 * Gets the set of units supported by this duration. <p> The supported units are   {@link ChronoUnit#SECONDS SECONDS}, and   {@link ChronoUnit#NANOS NANOS}. They are returned in the order seconds, nanos. <p> This set can be used in conjunction with   {@link #get(TemporalUnit)}to access the entire state of the period.
 * @return a list containing the seconds and nanos units, not null
 */
@Override public List<TemporalUnit> getUnits(){
  return DurationUnits.UNITS;
}

Fixed version (ground truth):
/** 
 * Gets the set of units supported by this duration. <p> The supported units are   {@link ChronoUnit#SECONDS SECONDS}, and   {@link ChronoUnit#NANOS NANOS}. They are returned in the order seconds, nanos. <p> This set can be used in conjunction with   {@link #get(TemporalUnit)}to access the entire state of the duration.
 * @return a list containing the seconds and nanos units, not null
 */
@Override public List<TemporalUnit> getUnits(){
  return DurationUnits.UNITS;
}