nus-yam/ex-repair huggingface dataset:
Program: 76963
Project: 76963
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: 76964
Project: 76964
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: 76965
Project: 76965
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: 76966
Project: 76966
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: 76967
Project: 76967
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: 76968
Project: 76968
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: 76969
Project: 76969
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: 76970
Project: 76970
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: 76971
Project: 76971
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: 76972
Project: 76972
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: 76973
Project: 76973
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: 76974
Project: 76974
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: 76975
Project: 76975
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: 76976
Project: 76976
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: 76977
Project: 76977
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: 76978
Project: 76978
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: 76979
Project: 76979
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: 76980
Project: 76980
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: 76981
Project: 76981
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: 76982
Project: 76982
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: 76983
Project: 76983
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: 76984
Project: 76984
Buggy source:
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}

Fixed version (ground truth):
/** 
 * Constructs   {@code AccessibleJToggleButton}
 */
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}
Program: 76985
Project: 76985
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: 76986
Project: 76986
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: 76987
Project: 76987
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: 76988
Project: 76988
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: 76989
Project: 76989
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: 76990
Project: 76990
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: 76991
Project: 76991
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: 76992
Project: 76992
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: 76993
Project: 76993
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: 76994
Project: 76994
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: 76995
Project: 76995
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: 76996
Project: 76996
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: 76997
Project: 76997
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: 76998
Project: 76998
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: 76999
Project: 76999
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: 77000
Project: 77000
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: 77001
Project: 77001
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: 77002
Project: 77002
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: 77003
Project: 77003
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: 77004
Project: 77004
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: 77006
Project: 77006
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: 77007
Project: 77007
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: 77009
Project: 77009
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: 77010
Project: 77010
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: 77012
Project: 77012
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: 77014
Project: 77014
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: 77016
Project: 77016
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: 77018
Project: 77018
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: 77020
Project: 77020
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){
}