nus-yam/ex-repair huggingface dataset:
Program: 36128
Project: 36128
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: 36129
Project: 36129
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: 36130
Project: 36130
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: 36131
Project: 36131
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: 36132
Project: 36132
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: 36133
Project: 36133
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: 36134
Project: 36134
Buggy source:
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}

Fixed version (ground truth):
/** 
 * Constructs   {@code AccessibleJToggleButton}
 */
public AccessibleJToggleButton(){
  super();
  JToggleButton.this.addItemListener(this);
}
Program: 36135
Project: 36135
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: 36136
Project: 36136
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: 36137
Project: 36137
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: 36138
Project: 36138
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: 36139
Project: 36139
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: 36140
Project: 36140
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: 36141
Project: 36141
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: 36142
Project: 36142
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: 36143
Project: 36143
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: 36144
Project: 36144
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: 36145
Project: 36145
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: 36146
Project: 36146
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: 36147
Project: 36147
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: 36148
Project: 36148
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: 36149
Project: 36149
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: 36150
Project: 36150
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: 36151
Project: 36151
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: 36152
Project: 36152
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: 36153
Project: 36153
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: 36154
Project: 36154
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: 36155
Project: 36155
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: 36156
Project: 36156
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: 36157
Project: 36157
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: 36159
Project: 36159
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: 36160
Project: 36160
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: 36162
Project: 36162
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: 36164
Project: 36164
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: 36166
Project: 36166
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: 36168
Project: 36168
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: 36170
Project: 36170
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: 36171
Project: 36171
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: 36172
Project: 36172
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: 36173
Project: 36173
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: 36174
Project: 36174
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: 36175
Project: 36175
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: 36176
Project: 36176
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: 36177
Project: 36177
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: 36179
Project: 36179
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: 36180
Project: 36180
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: 36181
Project: 36181
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: 36182
Project: 36182
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: 36183
Project: 36183
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: 36184
Project: 36184
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: 36185
Project: 36185
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: 36187
Project: 36187
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: 36188
Project: 36188
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: 36190
Project: 36190
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;
}