nus-yam/ex-repair huggingface dataset:
Program: 77188
Project: 77188
Buggy source:
/** 
 * Returns the String at a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text >= 0
 * @return the letter, word, or sentence,null for an invalid index or part
 * @since 1.3
 */
public String getAtIndex(int part,int index){
  if (index < 0 || index >= getCharCount()) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    try {
      return getText(index,1);
    }
 catch (    BadLocationException e) {
      return null;
    }
case AccessibleText.WORD:
  try {
    String s=getText(0,getCharCount());
    BreakIterator words=BreakIterator.getWordInstance(getLocale());
    words.setText(s);
    int end=words.following(index);
    return s.substring(words.previous(),end);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.SENTENCE:
try {
  String s=getText(0,getCharCount());
  BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
  sentence.setText(s);
  int end=sentence.following(index);
  return s.substring(sentence.previous(),end);
}
 catch (BadLocationException e) {
  return null;
}
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Returns the String at a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text &gt;= 0
 * @return the letter, word, or sentence,null for an invalid index or part
 * @since 1.3
 */
public String getAtIndex(int part,int index){
  if (index < 0 || index >= getCharCount()) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    try {
      return getText(index,1);
    }
 catch (    BadLocationException e) {
      return null;
    }
case AccessibleText.WORD:
  try {
    String s=getText(0,getCharCount());
    BreakIterator words=BreakIterator.getWordInstance(getLocale());
    words.setText(s);
    int end=words.following(index);
    return s.substring(words.previous(),end);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.SENTENCE:
try {
  String s=getText(0,getCharCount());
  BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
  sentence.setText(s);
  int end=sentence.following(index);
  return s.substring(sentence.previous(),end);
}
 catch (BadLocationException e) {
  return null;
}
default :
return null;
}
}
Program: 77189
Project: 77189
Buggy source:
/** 
 * Sets the <code>contentAreaFilled</code> property. If <code>true</code> the button will paint the content area.  If you wish to have a transparent button, such as an icon only button, for example, then you should set this to <code>false</code>. Do not call <code>setOpaque(false)</code>. The default value for the the <code>contentAreaFilled</code> property is <code>true</code>. <p> This function may cause the component's opaque property to change. <p> The exact behavior of calling this function varies on a component-by-component and L&F-by-L&F basis.
 * @param b if true, the content should be filled; if falsethe content area is not filled
 * @see #isContentAreaFilled
 * @see #setOpaque
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the button should paint the content area or leave it transparent.
 */
public void setContentAreaFilled(boolean b){
  boolean oldValue=contentAreaFilled;
  contentAreaFilled=b;
  contentAreaFilledSet=true;
  firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY,oldValue,contentAreaFilled);
  if (b != oldValue) {
    repaint();
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>contentAreaFilled</code> property. If <code>true</code> the button will paint the content area.  If you wish to have a transparent button, such as an icon only button, for example, then you should set this to <code>false</code>. Do not call <code>setOpaque(false)</code>. The default value for the the <code>contentAreaFilled</code> property is <code>true</code>. <p> This function may cause the component's opaque property to change. <p> The exact behavior of calling this function varies on a component-by-component and L&amp;F-by-L&amp;F basis.
 * @param b if true, the content should be filled; if falsethe content area is not filled
 * @see #isContentAreaFilled
 * @see #setOpaque
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the button should paint the content area or leave it transparent.
 */
public void setContentAreaFilled(boolean b){
  boolean oldValue=contentAreaFilled;
  contentAreaFilled=b;
  contentAreaFilledSet=true;
  firePropertyChange(CONTENT_AREA_FILLED_CHANGED_PROPERTY,oldValue,contentAreaFilled);
  if (b != oldValue) {
    repaint();
  }
}
Program: 77190
Project: 77190
Buggy source:
/** 
 * Returns the L&F object that renders this component.
 * @return the ButtonUI object
 * @see #setUI
 */
public ButtonUI getUI(){
  return (ButtonUI)ui;
}

Fixed version (ground truth):
/** 
 * Returns the L&amp;F object that renders this component.
 * @return the ButtonUI object
 * @see #setUI
 */
public ButtonUI getUI(){
  return (ButtonUI)ui;
}
Program: 77192
Project: 77192
Buggy source:
/** 
 * Sets the amount of time (in milliseconds) required between mouse press events for the button to generate the corresponding action events.  After the initial mouse press occurs (and action event generated) any subsequent mouse press events which occur on intervals less than the threshhold will be ignored and no corresponding action event generated.  By default the threshhold is 0, which means that for each mouse press, an action event will be fired, no matter how quickly the mouse clicks occur.  In buttons where this behavior is not desirable (for example, the "OK" button in a dialog), this threshhold should be set to an appropriate positive value.
 * @see #getMultiClickThreshhold
 * @param threshhold the amount of time required between mousepress events to generate corresponding action events
 * @exception IllegalArgumentException if threshhold < 0
 * @since 1.4
 */
public void setMultiClickThreshhold(long threshhold){
  if (threshhold < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.multiClickThreshhold=threshhold;
}

Fixed version (ground truth):
/** 
 * Sets the amount of time (in milliseconds) required between mouse press events for the button to generate the corresponding action events.  After the initial mouse press occurs (and action event generated) any subsequent mouse press events which occur on intervals less than the threshhold will be ignored and no corresponding action event generated.  By default the threshhold is 0, which means that for each mouse press, an action event will be fired, no matter how quickly the mouse clicks occur.  In buttons where this behavior is not desirable (for example, the "OK" button in a dialog), this threshhold should be set to an appropriate positive value.
 * @see #getMultiClickThreshhold
 * @param threshhold the amount of time required between mousepress events to generate corresponding action events
 * @exception IllegalArgumentException if threshhold &lt; 0
 * @since 1.4
 */
public void setMultiClickThreshhold(long threshhold){
  if (threshhold < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.multiClickThreshhold=threshhold;
}
Program: 77193
Project: 77193
Buggy source:
/** 
 * Sets the <code>borderPainted</code> property. If <code>true</code> and the button has a border, the border is painted. The default value for the <code>borderPainted</code> property is <code>true</code>. <p/> Some look and feels might not support the <code>borderPainted</code> property, in which case they ignore this.
 * @param b if true and border property is not <code>null</code>,the border is painted
 * @see #isBorderPainted
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the border should be painted.
 */
public void setBorderPainted(boolean b){
  boolean oldValue=paintBorder;
  paintBorder=b;
  borderPaintedSet=true;
  firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY,oldValue,paintBorder);
  if (b != oldValue) {
    revalidate();
    repaint();
  }
}

Fixed version (ground truth):
/** 
 * Sets the <code>borderPainted</code> property. If <code>true</code> and the button has a border, the border is painted. The default value for the <code>borderPainted</code> property is <code>true</code>. <p> Some look and feels might not support the <code>borderPainted</code> property, in which case they ignore this.
 * @param b if true and border property is not <code>null</code>,the border is painted
 * @see #isBorderPainted
 * @beaninfo bound: true attribute: visualUpdate true description: Whether the border should be painted.
 */
public void setBorderPainted(boolean b){
  boolean oldValue=paintBorder;
  paintBorder=b;
  borderPaintedSet=true;
  firePropertyChange(BORDER_PAINTED_CHANGED_PROPERTY,oldValue,paintBorder);
  if (b != oldValue) {
    revalidate();
    repaint();
  }
}
Program: 77194
Project: 77194
Buggy source:
/** 
 * Sets the L&F object that renders this component.
 * @param ui the <code>ButtonUI</code> L&F object
 * @see #getUI
 * @beaninfo bound: true hidden: true attribute: visualUpdate true description: The UI object that implements the LookAndFeel.
 */
public void setUI(ButtonUI ui){
  super.setUI(ui);
  if (disabledIcon instanceof UIResource) {
    setDisabledIcon(null);
  }
  if (disabledSelectedIcon instanceof UIResource) {
    setDisabledSelectedIcon(null);
  }
}

Fixed version (ground truth):
/** 
 * Sets the L&amp;F object that renders this component.
 * @param ui the <code>ButtonUI</code> L&amp;F object
 * @see #getUI
 * @beaninfo bound: true hidden: true attribute: visualUpdate true description: The UI object that implements the LookAndFeel.
 */
public void setUI(ButtonUI ui){
  super.setUI(ui);
  if (disabledIcon instanceof UIResource) {
    setDisabledIcon(null);
  }
  if (disabledSelectedIcon instanceof UIResource) {
    setDisabledSelectedIcon(null);
  }
}
Program: 77195
Project: 77195
Buggy source:
/** 
 * Creates an invisible, fixed-height component. In a vertical box, you typically use this method to force a certain amount of space between two components. In a horizontal box, you might use this method to force the box to be at least the specified height. The invisible component has no width unless excess space is available, in which case it takes its share of available space, just like any other component that has no maximum width.
 * @param height the height of the invisible component, in pixels >= 0
 * @return the component
 * @see #createHorizontalStrut
 * @see #createGlue
 * @see #createRigidArea
 */
public static Component createVerticalStrut(int height){
  return new Filler(new Dimension(0,height),new Dimension(0,height),new Dimension(Short.MAX_VALUE,height));
}

Fixed version (ground truth):
/** 
 * Creates an invisible, fixed-height component. In a vertical box, you typically use this method to force a certain amount of space between two components. In a horizontal box, you might use this method to force the box to be at least the specified height. The invisible component has no width unless excess space is available, in which case it takes its share of available space, just like any other component that has no maximum width.
 * @param height the height of the invisible component, in pixels &gt;= 0
 * @return the component
 * @see #createHorizontalStrut
 * @see #createGlue
 * @see #createRigidArea
 */
public static Component createVerticalStrut(int height){
  return new Filler(new Dimension(0,height),new Dimension(0,height),new Dimension(Short.MAX_VALUE,height));
}
Program: 77196
Project: 77196
Buggy source:
/** 
 * Creates an invisible, fixed-width component. In a horizontal box, you typically use this method to force a certain amount of space between two components. In a vertical box, you might use this method to force the box to be at least the specified width. The invisible component has no height unless excess space is available, in which case it takes its share of available space, just like any other component that has no maximum height.
 * @param width the width of the invisible component, in pixels >= 0
 * @return the component
 * @see #createVerticalStrut
 * @see #createGlue
 * @see #createRigidArea
 */
public static Component createHorizontalStrut(int width){
  return new Filler(new Dimension(width,0),new Dimension(width,0),new Dimension(width,Short.MAX_VALUE));
}

Fixed version (ground truth):
/** 
 * Creates an invisible, fixed-width component. In a horizontal box, you typically use this method to force a certain amount of space between two components. In a vertical box, you might use this method to force the box to be at least the specified width. The invisible component has no height unless excess space is available, in which case it takes its share of available space, just like any other component that has no maximum height.
 * @param width the width of the invisible component, in pixels &gt;= 0
 * @return the component
 * @see #createVerticalStrut
 * @see #createGlue
 * @see #createRigidArea
 */
public static Component createHorizontalStrut(int width){
  return new Filler(new Dimension(width,0),new Dimension(width,0),new Dimension(width,Short.MAX_VALUE));
}
Program: 77197
Project: 77197
Buggy source:
/** 
 * Returns the preferred dimensions for this layout, given the components in the specified target container.
 * @param target  the container that needs to be laid out
 * @return the dimensions >= 0 && <= Integer.MAX_VALUE
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 * @see Container
 * @see #minimumLayoutSize
 * @see #maximumLayoutSize
 */
public Dimension preferredLayoutSize(Container target){
  Dimension size;
synchronized (this) {
    checkContainer(target);
    checkRequests();
    size=new Dimension(xTotal.preferred,yTotal.preferred);
  }
  Insets insets=target.getInsets();
  size.width=(int)Math.min((long)size.width + (long)insets.left + (long)insets.right,Integer.MAX_VALUE);
  size.height=(int)Math.min((long)size.height + (long)insets.top + (long)insets.bottom,Integer.MAX_VALUE);
  return size;
}

Fixed version (ground truth):
/** 
 * Returns the preferred dimensions for this layout, given the components in the specified target container.
 * @param target  the container that needs to be laid out
 * @return the dimensions &gt;= 0 &amp;&amp; &lt;= Integer.MAX_VALUE
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 * @see Container
 * @see #minimumLayoutSize
 * @see #maximumLayoutSize
 */
public Dimension preferredLayoutSize(Container target){
  Dimension size;
synchronized (this) {
    checkContainer(target);
    checkRequests();
    size=new Dimension(xTotal.preferred,yTotal.preferred);
  }
  Insets insets=target.getInsets();
  size.width=(int)Math.min((long)size.width + (long)insets.left + (long)insets.right,Integer.MAX_VALUE);
  size.height=(int)Math.min((long)size.height + (long)insets.top + (long)insets.bottom,Integer.MAX_VALUE);
  return size;
}
Program: 77198
Project: 77198
Buggy source:
/** 
 * Returns the alignment along the X axis for the container. If the box is horizontal, the default alignment will be returned. Otherwise, the alignment needed to place the children along the X axis will be returned.
 * @param target  the container
 * @return the alignment >= 0.0f && <= 1.0f
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 */
public synchronized float getLayoutAlignmentX(Container target){
  checkContainer(target);
  checkRequests();
  return xTotal.alignment;
}

Fixed version (ground truth):
/** 
 * Returns the alignment along the X axis for the container. If the box is horizontal, the default alignment will be returned. Otherwise, the alignment needed to place the children along the X axis will be returned.
 * @param target  the container
 * @return the alignment &gt;= 0.0f &amp;&amp; &lt;= 1.0f
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 */
public synchronized float getLayoutAlignmentX(Container target){
  checkContainer(target);
  checkRequests();
  return xTotal.alignment;
}
Program: 77199
Project: 77199
Buggy source:
/** 
 * Returns the minimum dimensions needed to lay out the components contained in the specified target container.
 * @param target  the container that needs to be laid out
 * @return the dimensions >= 0 && <= Integer.MAX_VALUE
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 * @see #preferredLayoutSize
 * @see #maximumLayoutSize
 */
public Dimension minimumLayoutSize(Container target){
  Dimension size;
synchronized (this) {
    checkContainer(target);
    checkRequests();
    size=new Dimension(xTotal.minimum,yTotal.minimum);
  }
  Insets insets=target.getInsets();
  size.width=(int)Math.min((long)size.width + (long)insets.left + (long)insets.right,Integer.MAX_VALUE);
  size.height=(int)Math.min((long)size.height + (long)insets.top + (long)insets.bottom,Integer.MAX_VALUE);
  return size;
}

Fixed version (ground truth):
/** 
 * Returns the minimum dimensions needed to lay out the components contained in the specified target container.
 * @param target  the container that needs to be laid out
 * @return the dimensions &gt;= 0 &amp;&amp; &lt;= Integer.MAX_VALUE
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 * @see #preferredLayoutSize
 * @see #maximumLayoutSize
 */
public Dimension minimumLayoutSize(Container target){
  Dimension size;
synchronized (this) {
    checkContainer(target);
    checkRequests();
    size=new Dimension(xTotal.minimum,yTotal.minimum);
  }
  Insets insets=target.getInsets();
  size.width=(int)Math.min((long)size.width + (long)insets.left + (long)insets.right,Integer.MAX_VALUE);
  size.height=(int)Math.min((long)size.height + (long)insets.top + (long)insets.bottom,Integer.MAX_VALUE);
  return size;
}
Program: 77200
Project: 77200
Buggy source:
/** 
 * Returns the alignment along the Y axis for the container. If the box is vertical, the default alignment will be returned. Otherwise, the alignment needed to place the children along the Y axis will be returned.
 * @param target  the container
 * @return the alignment >= 0.0f && <= 1.0f
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 */
public synchronized float getLayoutAlignmentY(Container target){
  checkContainer(target);
  checkRequests();
  return yTotal.alignment;
}

Fixed version (ground truth):
/** 
 * Returns the alignment along the Y axis for the container. If the box is vertical, the default alignment will be returned. Otherwise, the alignment needed to place the children along the Y axis will be returned.
 * @param target  the container
 * @return the alignment &gt;= 0.0f &amp;&amp; &lt;= 1.0f
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 */
public synchronized float getLayoutAlignmentY(Container target){
  checkContainer(target);
  checkRequests();
  return yTotal.alignment;
}
Program: 77201
Project: 77201
Buggy source:
/** 
 * Returns the maximum dimensions the target container can use to lay out the components it contains.
 * @param target  the container that needs to be laid out
 * @return the dimensions >= 0 && <= Integer.MAX_VALUE
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 * @see #preferredLayoutSize
 * @see #minimumLayoutSize
 */
public Dimension maximumLayoutSize(Container target){
  Dimension size;
synchronized (this) {
    checkContainer(target);
    checkRequests();
    size=new Dimension(xTotal.maximum,yTotal.maximum);
  }
  Insets insets=target.getInsets();
  size.width=(int)Math.min((long)size.width + (long)insets.left + (long)insets.right,Integer.MAX_VALUE);
  size.height=(int)Math.min((long)size.height + (long)insets.top + (long)insets.bottom,Integer.MAX_VALUE);
  return size;
}

Fixed version (ground truth):
/** 
 * Returns the maximum dimensions the target container can use to lay out the components it contains.
 * @param target  the container that needs to be laid out
 * @return the dimensions &gt;= 0 &amp;&amp; &lt;= Integer.MAX_VALUE
 * @exception AWTError  if the target isn't the container specified to theBoxLayout constructor
 * @see #preferredLayoutSize
 * @see #minimumLayoutSize
 */
public Dimension maximumLayoutSize(Container target){
  Dimension size;
synchronized (this) {
    checkContainer(target);
    checkRequests();
    size=new Dimension(xTotal.maximum,yTotal.maximum);
  }
  Insets insets=target.getInsets();
  size.width=(int)Math.min((long)size.width + (long)insets.left + (long)insets.right,Integer.MAX_VALUE);
  size.height=(int)Math.min((long)size.height + (long)insets.top + (long)insets.bottom,Integer.MAX_VALUE);
  return size;
}
Program: 77202
Project: 77202
Buggy source:
/** 
 * If the specified component is already a child of this then we don't bother doing anything - stacking order doesn't matter for cell renderer components (CellRendererPane doesn't paint anyway).<
 */
protected void addImpl(Component x,Object constraints,int index){
  if (x.getParent() == this) {
    return;
  }
 else {
    super.addImpl(x,constraints,index);
  }
}

Fixed version (ground truth):
/** 
 * If the specified component is already a child of this then we don't bother doing anything - stacking order doesn't matter for cell renderer components (CellRendererPane doesn't paint anyway).
 */
protected void addImpl(Component x,Object constraints,int index){
  if (x.getParent() == this) {
    return;
  }
 else {
    super.addImpl(x,constraints,index);
  }
}
Program: 77203
Project: 77203
Buggy source:
/** 
 * Remove the indices in the interval index0,index1 (inclusive) from the selection model.  This is typically called to sync the selection model width a corresponding change in the data model.  Note that (as always) index0 need not be <= index1.
 */
public void removeIndexInterval(int index0,int index1){
  int rmMinIndex=Math.min(index0,index1);
  int rmMaxIndex=Math.max(index0,index1);
  int gapLength=(rmMaxIndex - rmMinIndex) + 1;
  for (int i=rmMinIndex; i <= maxIndex; i++) {
    setState(i,value.get(i + gapLength));
  }
  int leadIndex=this.leadIndex;
  if (leadIndex == 0 && rmMinIndex == 0) {
  }
 else   if (leadIndex > rmMaxIndex) {
    leadIndex=this.leadIndex - gapLength;
  }
 else   if (leadIndex >= rmMinIndex) {
    leadIndex=rmMinIndex - 1;
  }
  int anchorIndex=this.anchorIndex;
  if (anchorIndex == 0 && rmMinIndex == 0) {
  }
 else   if (anchorIndex > rmMaxIndex) {
    anchorIndex=this.anchorIndex - gapLength;
  }
 else   if (anchorIndex >= rmMinIndex) {
    anchorIndex=rmMinIndex - 1;
  }
  if (leadIndex != this.leadIndex || anchorIndex != this.anchorIndex) {
    updateLeadAnchorIndices(anchorIndex,leadIndex);
  }
  fireValueChanged();
}

Fixed version (ground truth):
/** 
 * Remove the indices in the interval index0,index1 (inclusive) from the selection model.  This is typically called to sync the selection model width a corresponding change in the data model.  Note that (as always) index0 need not be &lt;= index1.
 */
public void removeIndexInterval(int index0,int index1){
  int rmMinIndex=Math.min(index0,index1);
  int rmMaxIndex=Math.max(index0,index1);
  int gapLength=(rmMaxIndex - rmMinIndex) + 1;
  for (int i=rmMinIndex; i <= maxIndex; i++) {
    setState(i,value.get(i + gapLength));
  }
  int leadIndex=this.leadIndex;
  if (leadIndex == 0 && rmMinIndex == 0) {
  }
 else   if (leadIndex > rmMaxIndex) {
    leadIndex=this.leadIndex - gapLength;
  }
 else   if (leadIndex >= rmMinIndex) {
    leadIndex=rmMinIndex - 1;
  }
  int anchorIndex=this.anchorIndex;
  if (anchorIndex == 0 && rmMinIndex == 0) {
  }
 else   if (anchorIndex > rmMaxIndex) {
    anchorIndex=this.anchorIndex - gapLength;
  }
 else   if (anchorIndex >= rmMinIndex) {
    anchorIndex=rmMinIndex - 1;
  }
  if (leadIndex != this.leadIndex || anchorIndex != this.anchorIndex) {
    updateLeadAnchorIndices(anchorIndex,leadIndex);
  }
  fireValueChanged();
}
Program: 77204
Project: 77204
Buggy source:
/** 
 * Returns   {@code true} if a paint triggered on a child component should causepainting to originate from this Component, or one of its ancestors. <p/> Calling  {@link #repaint} or {@link #paintImmediately(int,int,int,int)}on a Swing component will result in calling the   {@link JComponent#paintImmediately(int,int,int,int)} method ofthe first ancestor which  {@code isPaintingOrigin()} returns {@code true}, if there are any. <p/>  {@code JComponent} subclasses that need to be painted when any of theirchildren are repainted should override this method to return  {@code true}.
 * @return always returns {@code false}
 * @see #paintImmediately(int,int,int,int)
 */
protected boolean isPaintingOrigin(){
  return false;
}

Fixed version (ground truth):
/** 
 * Returns   {@code true} if a paint triggered on a child component should causepainting to originate from this Component, or one of its ancestors. <p> Calling  {@link #repaint} or {@link #paintImmediately(int,int,int,int)}on a Swing component will result in calling the   {@link JComponent#paintImmediately(int,int,int,int)} method ofthe first ancestor which  {@code isPaintingOrigin()} returns {@code true}, if there are any. <p>  {@code JComponent} subclasses that need to be painted when any of theirchildren are repainted should override this method to return  {@code true}.
 * @return always returns {@code false}
 * @see #paintImmediately(int,int,int,int)
 */
protected boolean isPaintingOrigin(){
  return false;
}
Program: 77205
Project: 77205
Buggy source:
/** 
 * Pops up an "Open File" file chooser dialog. Note that the text that appears in the approve button is determined by the L&F.
 * @param parent  the parent component of the dialog,can be <code>null</code>; see <code>showDialog</code> for details
 * @return   the return state of the file chooser on popdown:<ul> <li>JFileChooser.CANCEL_OPTION <li>JFileChooser.APPROVE_OPTION <li>JFileChooser.ERROR_OPTION if an error occurs or the dialog is dismissed </ul>
 * @exception HeadlessException if GraphicsEnvironment.isHeadless()returns true.
 * @see java.awt.GraphicsEnvironment#isHeadless
 * @see #showDialog
 */
public int showOpenDialog(Component parent) throws HeadlessException {
  setDialogType(OPEN_DIALOG);
  return showDialog(parent,null);
}

Fixed version (ground truth):
/** 
 * Pops up an "Open File" file chooser dialog. Note that the text that appears in the approve button is determined by the L&amp;F.
 * @param parent  the parent component of the dialog,can be <code>null</code>; see <code>showDialog</code> for details
 * @return   the return state of the file chooser on popdown:<ul> <li>JFileChooser.CANCEL_OPTION <li>JFileChooser.APPROVE_OPTION <li>JFileChooser.ERROR_OPTION if an error occurs or the dialog is dismissed </ul>
 * @exception HeadlessException if GraphicsEnvironment.isHeadless()returns true.
 * @see java.awt.GraphicsEnvironment#isHeadless
 * @see #showDialog
 */
public int showOpenDialog(Component parent) throws HeadlessException {
  setDialogType(OPEN_DIALOG);
  return showDialog(parent,null);
}
Program: 77206
Project: 77206
Buggy source:
/** 
 * Pops up a "Save File" file chooser dialog. Note that the text that appears in the approve button is determined by the L&F.
 * @param parent  the parent component of the dialog,can be <code>null</code>; see <code>showDialog</code> for details
 * @return   the return state of the file chooser on popdown:<ul> <li>JFileChooser.CANCEL_OPTION <li>JFileChooser.APPROVE_OPTION <li>JFileChooser.ERROR_OPTION if an error occurs or the dialog is dismissed </ul>
 * @exception HeadlessException if GraphicsEnvironment.isHeadless()returns true.
 * @see java.awt.GraphicsEnvironment#isHeadless
 * @see #showDialog
 */
public int showSaveDialog(Component parent) throws HeadlessException {
  setDialogType(SAVE_DIALOG);
  return showDialog(parent,null);
}

Fixed version (ground truth):
/** 
 * Pops up a "Save File" file chooser dialog. Note that the text that appears in the approve button is determined by the L&amp;F.
 * @param parent  the parent component of the dialog,can be <code>null</code>; see <code>showDialog</code> for details
 * @return   the return state of the file chooser on popdown:<ul> <li>JFileChooser.CANCEL_OPTION <li>JFileChooser.APPROVE_OPTION <li>JFileChooser.ERROR_OPTION if an error occurs or the dialog is dismissed </ul>
 * @exception HeadlessException if GraphicsEnvironment.isHeadless()returns true.
 * @see java.awt.GraphicsEnvironment#isHeadless
 * @see #showDialog
 */
public int showSaveDialog(Component parent) throws HeadlessException {
  setDialogType(SAVE_DIALOG);
  return showDialog(parent,null);
}
Program: 77207
Project: 77207
Buggy source:
/** 
 * Sets the property that indicates whether the <i>approve</i> and <i>cancel</i> buttons are shown in the file chooser.  This property is <code>true</code> by default.  Look and feels that always show these buttons will ignore the value of this property. This method fires a property-changed event, using the string value of <code>CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY</code> as the name of the property.
 * @param b <code>false</code> if control buttons should not beshown; otherwise, <code>true</code>
 * @beaninfo preferred: true bound: true description: Sets whether the approve & cancel buttons are shown.
 * @see #getControlButtonsAreShown
 * @see #CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY
 * @since 1.3
 */
public void setControlButtonsAreShown(boolean b){
  if (controlsShown == b) {
    return;
  }
  boolean oldValue=controlsShown;
  controlsShown=b;
  firePropertyChange(CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY,oldValue,controlsShown);
}

Fixed version (ground truth):
/** 
 * Sets the property that indicates whether the <i>approve</i> and <i>cancel</i> buttons are shown in the file chooser.  This property is <code>true</code> by default.  Look and feels that always show these buttons will ignore the value of this property. This method fires a property-changed event, using the string value of <code>CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY</code> as the name of the property.
 * @param b <code>false</code> if control buttons should not beshown; otherwise, <code>true</code>
 * @beaninfo preferred: true bound: true description: Sets whether the approve &amp; cancel buttons are shown.
 * @see #getControlButtonsAreShown
 * @see #CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY
 * @since 1.3
 */
public void setControlButtonsAreShown(boolean b){
  if (controlsShown == b) {
    return;
  }
  boolean oldValue=controlsShown;
  controlsShown=b;
  firePropertyChange(CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY,oldValue,controlsShown);
}
Program: 77208
Project: 77208
Buggy source:
/** 
 * Gets the UI object which implements the L&F for this component.
 * @return the FileChooserUI object that implements the FileChooserUI L&F
 */
public FileChooserUI getUI(){
  return (FileChooserUI)ui;
}

Fixed version (ground truth):
/** 
 * Gets the UI object which implements the L&amp;F for this component.
 * @return the FileChooserUI object that implements the FileChooserUI L&amp;F
 */
public FileChooserUI getUI(){
  return (FileChooserUI)ui;
}
Program: 77209
Project: 77209
Buggy source:
/** 
 * Returns a string that specifies the name of the L&F class that renders this component.
 * @return the string "FileChooserUI"
 * @see JComponent#getUIClassID
 * @see UIDefaults#getUI
 * @beaninfo expert: true description: A string that specifies the name of the L&F class.
 */
public String getUIClassID(){
  return uiClassID;
}

Fixed version (ground truth):
/** 
 * Returns a string that specifies the name of the L&amp;F class that renders this component.
 * @return the string "FileChooserUI"
 * @see JComponent#getUIClassID
 * @see UIDefaults#getUI
 * @beaninfo expert: true description: A string that specifies the name of the L&amp;F class.
 */
public String getUIClassID(){
  return uiClassID;
}
Program: 77210
Project: 77210
Buggy source:
/** 
 * Returns the String before a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text >= 0
 * @return the letter, word, or sentence, null for an invalid indexor part
 * @since 1.3
 */
public String getBeforeIndex(int part,int index){
  if (index < 0 || index > getCharCount() - 1) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    if (index == 0) {
      return null;
    }
  try {
    return getText(index - 1,1);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.WORD:
try {
  String s=getText(0,getCharCount());
  BreakIterator words=BreakIterator.getWordInstance(getLocale());
  words.setText(s);
  int end=words.following(index);
  end=words.previous();
  int start=words.previous();
  if (start == BreakIterator.DONE) {
    return null;
  }
  return s.substring(start,end);
}
 catch (BadLocationException e) {
  return null;
}
case AccessibleText.SENTENCE:
try {
String s=getText(0,getCharCount());
BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
sentence.setText(s);
int end=sentence.following(index);
end=sentence.previous();
int start=sentence.previous();
if (start == BreakIterator.DONE) {
  return null;
}
return s.substring(start,end);
}
 catch (BadLocationException e) {
return null;
}
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Returns the String before a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text &gt;= 0
 * @return the letter, word, or sentence, null for an invalid indexor part
 * @since 1.3
 */
public String getBeforeIndex(int part,int index){
  if (index < 0 || index > getCharCount() - 1) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    if (index == 0) {
      return null;
    }
  try {
    return getText(index - 1,1);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.WORD:
try {
  String s=getText(0,getCharCount());
  BreakIterator words=BreakIterator.getWordInstance(getLocale());
  words.setText(s);
  int end=words.following(index);
  end=words.previous();
  int start=words.previous();
  if (start == BreakIterator.DONE) {
    return null;
  }
  return s.substring(start,end);
}
 catch (BadLocationException e) {
  return null;
}
case AccessibleText.SENTENCE:
try {
String s=getText(0,getCharCount());
BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
sentence.setText(s);
int end=sentence.following(index);
end=sentence.previous();
int start=sentence.previous();
if (start == BreakIterator.DONE) {
  return null;
}
return s.substring(start,end);
}
 catch (BadLocationException e) {
return null;
}
default :
return null;
}
}
Program: 77211
Project: 77211
Buggy source:
/** 
 * Returns the String at a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text >= 0
 * @return the letter, word, or sentence,null for an invalid index or part
 * @since 1.3
 */
public String getAtIndex(int part,int index){
  if (index < 0 || index >= getCharCount()) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    try {
      return getText(index,1);
    }
 catch (    BadLocationException e) {
      return null;
    }
case AccessibleText.WORD:
  try {
    String s=getText(0,getCharCount());
    BreakIterator words=BreakIterator.getWordInstance(getLocale());
    words.setText(s);
    int end=words.following(index);
    return s.substring(words.previous(),end);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.SENTENCE:
try {
  String s=getText(0,getCharCount());
  BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
  sentence.setText(s);
  int end=sentence.following(index);
  return s.substring(sentence.previous(),end);
}
 catch (BadLocationException e) {
  return null;
}
default :
return null;
}
}

Fixed version (ground truth):
/** 
 * Returns the String at a given index.
 * @param part the AccessibleText.CHARACTER, AccessibleText.WORD,or AccessibleText.SENTENCE to retrieve
 * @param index an index within the text &gt;= 0
 * @return the letter, word, or sentence,null for an invalid index or part
 * @since 1.3
 */
public String getAtIndex(int part,int index){
  if (index < 0 || index >= getCharCount()) {
    return null;
  }
switch (part) {
case AccessibleText.CHARACTER:
    try {
      return getText(index,1);
    }
 catch (    BadLocationException e) {
      return null;
    }
case AccessibleText.WORD:
  try {
    String s=getText(0,getCharCount());
    BreakIterator words=BreakIterator.getWordInstance(getLocale());
    words.setText(s);
    int end=words.following(index);
    return s.substring(words.previous(),end);
  }
 catch (  BadLocationException e) {
    return null;
  }
case AccessibleText.SENTENCE:
try {
  String s=getText(0,getCharCount());
  BreakIterator sentence=BreakIterator.getSentenceInstance(getLocale());
  sentence.setText(s);
  int end=sentence.following(index);
  return s.substring(sentence.previous(),end);
}
 catch (BadLocationException e) {
  return null;
}
default :
return null;
}
}
Program: 77212
Project: 77212
Buggy source:
/** 
 * Returns the L&F object that renders this component.
 * @return LabelUI object
 */
public LabelUI getUI(){
  return (LabelUI)ui;
}

Fixed version (ground truth):
/** 
 * Returns the L&amp;F object that renders this component.
 * @return LabelUI object
 */
public LabelUI getUI(){
  return (LabelUI)ui;
}
Program: 77215
Project: 77215
Buggy source:
/** 
 * Returns a string that specifies the name of the l&f class that renders this component.
 * @return String "LabelUI"
 * @see JComponent#getUIClassID
 * @see UIDefaults#getUI
 */
public String getUIClassID(){
  return uiClassID;
}

Fixed version (ground truth):
/** 
 * Returns a string that specifies the name of the l&amp;f class that renders this component.
 * @return String "LabelUI"
 * @see JComponent#getUIClassID
 * @see UIDefaults#getUI
 */
public String getUIClassID(){
  return uiClassID;
}
Program: 77216
Project: 77216
Buggy source:
/** 
 * Sets the L&F object that renders this component.
 * @param ui  the LabelUI L&F object
 * @see UIDefaults#getUI
 * @beaninfo bound: true hidden: true attribute: visualUpdate true description: The UI object that implements the Component's LookAndFeel.
 */
public void setUI(LabelUI ui){
  super.setUI(ui);
  if (!disabledIconSet && disabledIcon != null) {
    setDisabledIcon(null);
  }
}

Fixed version (ground truth):
/** 
 * Sets the L&amp;F object that renders this component.
 * @param ui  the LabelUI L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo bound: true hidden: true attribute: visualUpdate true description: The UI object that implements the Component's LookAndFeel.
 */
public void setUI(LabelUI ui){
  super.setUI(ui);
  if (!disabledIconSet && disabledIcon != null) {
    setDisabledIcon(null);
  }
}
Program: 77218
Project: 77218
Buggy source:
private JCBlock makeLambdaExpressionBody(JCExpression expr,JCMethodDecl lambdaMethodDecl){
  Type restype=lambdaMethodDecl.type.getReturnType();
  boolean isLambda_void=expr.type.hasTag(VOID);
  boolean isTarget_void=restype.hasTag(VOID);
  boolean isTarget_Void=types.isSameType(restype,types.boxedClass(syms.voidType).type);
  int prevPos=make.pos;
  try {
    if (isTarget_void) {
      JCStatement stat=make.at(expr).Exec(expr);
      return make.Block(0,List.<JCStatement>of(stat));
    }
 else     if (isLambda_void && isTarget_Void) {
      ListBuffer<JCStatement> stats=new ListBuffer<>();
      stats.append(make.at(expr).Exec(expr));
      stats.append(make.Return(make.Literal(BOT,null).setType(syms.botType)));
      return make.Block(0,stats.toList());
    }
 else {
      JCExpression retExpr=transTypes.coerce(attrEnv,expr,restype);
      return make.at(retExpr).Block(0,List.<JCStatement>of(make.Return(retExpr)));
    }
  }
  finally {
    make.at(prevPos);
  }
}

Fixed version (ground truth):
private JCBlock makeLambdaExpressionBody(JCExpression expr,JCMethodDecl lambdaMethodDecl){
  Type restype=lambdaMethodDecl.type.getReturnType();
  boolean isLambda_void=expr.type.hasTag(VOID);
  boolean isTarget_void=restype.hasTag(VOID);
  boolean isTarget_Void=types.isSameType(restype,types.boxedClass(syms.voidType).type);
  if (isTarget_void) {
    JCStatement stat=make.Exec(expr);
    return make.Block(0,List.<JCStatement>of(stat));
  }
 else   if (isLambda_void && isTarget_Void) {
    ListBuffer<JCStatement> stats=new ListBuffer<>();
    stats.append(make.Exec(expr));
    stats.append(make.Return(make.Literal(BOT,null).setType(syms.botType)));
    return make.Block(0,stats.toList());
  }
 else {
    JCExpression retExpr=transTypes.coerce(attrEnv,expr,restype);
    return make.at(retExpr).Block(0,List.<JCStatement>of(make.Return(retExpr)));
  }
}
Program: 77219
Project: 77219
Buggy source:
private KlassInfo(JCClassDecl clazz){
  this.clazz=clazz;
  appendedMethodList=new ListBuffer<>();
  deserializeCases=new HashMap<String,ListBuffer<JCStatement>>();
  MethodType type=new MethodType(List.of(syms.serializedLambdaType),syms.objectType,List.<Type>nil(),syms.methodClass);
  deserMethodSym=makePrivateSyntheticMethod(STATIC,names.deserializeLambda,type,clazz.sym);
  deserParamSym=new VarSymbol(FINAL,names.fromString("String_Node_Str"),syms.serializedLambdaType,deserMethodSym);
}

Fixed version (ground truth):
private KlassInfo(Symbol kSym){
  appendedMethodList=new ListBuffer<>();
  deserializeCases=new HashMap<String,ListBuffer<JCStatement>>();
  MethodType type=new MethodType(List.of(syms.serializedLambdaType),syms.objectType,List.<Type>nil(),syms.methodClass);
  deserMethodSym=makePrivateSyntheticMethod(STATIC,names.deserializeLambda,type,kSym);
  deserParamSym=new VarSymbol(FINAL,names.fromString("String_Node_Str"),syms.serializedLambdaType,deserMethodSym);
}
Program: 77220
Project: 77220
Buggy source:
/** 
 * Returns the names of the annotation types supported by this processor.  An element of the result may be the canonical (fully qualified) name of a supported annotation type. Alternately it may be of the form &quot;<tt><i>name</i>.*</tt>&quot; representing the set of all annotation types with canonical names beginning with &quot;<tt><i>name.</i></tt>&quot;.  Finally,   {@code "*"} by itself represents the set of all annotation types,including the empty set.  Note that a processor should not claim  {@code "*"} unless it is actually processing all files;claiming unnecessary annotations may cause a performance slowdown in some environments. <p>Each string returned in the set must be accepted by the following grammar: <blockquote> <dl> <dt><i>SupportedAnnotationTypeString:</i> <dd><i>TypeName</i> <i>DotStar</i><sub><i>opt</i></sub> <dd><tt>*</tt> <p> <dt><i>DotStar:</i> <dd><tt>.</tt> <tt>*</tt> </dl> </blockquote> where <i>TypeName</i> is as defined in <cite>The Java&trade; Language Specification</cite>.
 * @return the names of the annotation types supported by this processor
 * @see javax.annotation.processing.SupportedAnnotationTypes
 * @jls 3.8 Identifiers
 * @jls 6.5.5 Meaning of Type Names
 */
Set<String> getSupportedAnnotationTypes();

Fixed version (ground truth):
/** 
 * Returns the names of the annotation types supported by this processor.  An element of the result may be the canonical (fully qualified) name of a supported annotation type. Alternately it may be of the form &quot;<tt><i>name</i>.*</tt>&quot; representing the set of all annotation types with canonical names beginning with &quot;<tt><i>name.</i></tt>&quot;.  Finally,   {@code "*"} by itself represents the set of all annotation types,including the empty set.  Note that a processor should not claim  {@code "*"} unless it is actually processing all files;claiming unnecessary annotations may cause a performance slowdown in some environments. <p>Each string returned in the set must be accepted by the following grammar: <blockquote> <dl> <dt><i>SupportedAnnotationTypeString:</i> <dd><i>TypeName</i> <i>DotStar</i><sub><i>opt</i></sub> <dd><tt>*</tt> <dt><i>DotStar:</i> <dd><tt>.</tt> <tt>*</tt> </dl> </blockquote> where <i>TypeName</i> is as defined in <cite>The Java&trade; Language Specification</cite>.
 * @return the names of the annotation types supported by this processor
 * @see javax.annotation.processing.SupportedAnnotationTypes
 * @jls 3.8 Identifiers
 * @jls 6.5.5 Meaning of Type Names
 */
Set<String> getSupportedAnnotationTypes();
Program: 77221
Project: 77221
Buggy source:
/** 
 * Returns the options recognized by this processor.  An implementation of the processing tool must provide a way to pass processor-specific options distinctly from options passed to the tool itself, see   {@link ProcessingEnvironment#getOptions getOptions}. <p>Each string returned in the set must be a period separated sequence of   {@linkplain javax.lang.model.SourceVersion#isIdentifier identifiers}: <blockquote> <dl> <dt><i>SupportedOptionString:</i> <dd><i>Identifiers</i> <p> <dt><i>Identifiers:</i> <dd> <i>Identifier</i> <dd> <i>Identifier</i>   {@code .} <i>Identifiers</i><p> <dt><i>Identifier:</i> <dd>Syntactic identifier, including keywords and literals </dl> </blockquote> <p> A tool might use this information to determine if any options provided by a user are unrecognized by any processor, in which case it may wish to report a warning.
 * @return the options recognized by this processor or anempty collection if none
 * @see javax.annotation.processing.SupportedOptions
 */
Set<String> getSupportedOptions();

Fixed version (ground truth):
/** 
 * Returns the options recognized by this processor.  An implementation of the processing tool must provide a way to pass processor-specific options distinctly from options passed to the tool itself, see   {@link ProcessingEnvironment#getOptions getOptions}. <p>Each string returned in the set must be a period separated sequence of   {@linkplain javax.lang.model.SourceVersion#isIdentifier identifiers}: <blockquote> <dl> <dt><i>SupportedOptionString:</i> <dd><i>Identifiers</i> <dt><i>Identifiers:</i> <dd> <i>Identifier</i> <dd> <i>Identifier</i>   {@code .} <i>Identifiers</i><dt><i>Identifier:</i> <dd>Syntactic identifier, including keywords and literals </dl> </blockquote> <p> A tool might use this information to determine if any options provided by a user are unrecognized by any processor, in which case it may wish to report a warning.
 * @return the options recognized by this processor or anempty collection if none
 * @see javax.annotation.processing.SupportedOptions
 */
Set<String> getSupportedOptions();
Program: 77223
Project: 77223
Buggy source:
/** 
 * Discards the referral about to be processed. A call to this method should be followed by a call to <code>getReferralContext</code> to allow the processing of other referrals to continue. The following code fragment shows a typical usage pattern. <p><blockquote><pre> } catch (ReferralException e) { if (!shallIFollow(e.getReferralInfo())) { if (!e.skipReferral()) { return; } } ctx = e.getReferralContext(); } </pre></blockquote>
 * @return true If more referral processing is pending; false otherwise.
 */
public abstract boolean skipReferral();

Fixed version (ground truth):
/** 
 * Discards the referral about to be processed. A call to this method should be followed by a call to <code>getReferralContext</code> to allow the processing of other referrals to continue. The following code fragment shows a typical usage pattern. <blockquote><pre> } catch (ReferralException e) { if (!shallIFollow(e.getReferralInfo())) { if (!e.skipReferral()) { return; } } ctx = e.getReferralContext(); } </pre></blockquote>
 * @return true If more referral processing is pending; false otherwise.
 */
public abstract boolean skipReferral();