nus-yam/ex-repair huggingface dataset:
Program: 71656
Project: 71656
Buggy source:
/** 
 * Returns the coordinates and type of the current path segment in the iteration. The return value is the path segment type: SEG_MOVETO, SEG_LINETO, or SEG_CLOSE. A double array of length 6 must be passed in and can be used to store the coordinates of the point(s). Each point is stored as a pair of double x,y coordinates. SEG_MOVETO and SEG_LINETO types return one point, and SEG_CLOSE does not return any points.
 * @param coords an array that holds the data returned fromthis method
 * @return the path segment type of the current path segment.
 * @exception <code>NoSuchElementException</code> if thereare no more elements in the flattening path to be returned.
 * @see PathIterator#SEG_MOVETO
 * @see PathIterator#SEG_LINETO
 * @see PathIterator#SEG_CLOSE
 */
public int currentSegment(double[] coords){
  if (isDone()) {
    throw new NoSuchElementException("String_Node_Str");
  }
  int type=holdType;
  if (type != SEG_CLOSE) {
    coords[0]=hold[holdIndex + 0];
    coords[1]=hold[holdIndex + 1];
    if (type != SEG_MOVETO) {
      type=SEG_LINETO;
    }
  }
  return type;
}

Fixed version (ground truth):
/** 
 * Returns the coordinates and type of the current path segment in the iteration. The return value is the path segment type: SEG_MOVETO, SEG_LINETO, or SEG_CLOSE. A double array of length 6 must be passed in and can be used to store the coordinates of the point(s). Each point is stored as a pair of double x,y coordinates. SEG_MOVETO and SEG_LINETO types return one point, and SEG_CLOSE does not return any points.
 * @param coords an array that holds the data returned fromthis method
 * @return the path segment type of the current path segment.
 * @exception NoSuchElementException if thereare no more elements in the flattening path to be returned.
 * @see PathIterator#SEG_MOVETO
 * @see PathIterator#SEG_LINETO
 * @see PathIterator#SEG_CLOSE
 */
public int currentSegment(double[] coords){
  if (isDone()) {
    throw new NoSuchElementException("String_Node_Str");
  }
  int type=holdType;
  if (type != SEG_CLOSE) {
    coords[0]=hold[holdIndex + 0];
    coords[1]=hold[holdIndex + 1];
    if (type != SEG_MOVETO) {
      type=SEG_LINETO;
    }
  }
  return type;
}
Program: 71657
Project: 71657
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: 71658
Project: 71658
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: 71659
Project: 71659
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: 71660
Project: 71660
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: 71662
Project: 71662
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: 71663
Project: 71663
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: 71664
Project: 71664
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: 71665
Project: 71665
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: 71666
Project: 71666
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: 71667
Project: 71667
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: 71668
Project: 71668
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: 71669
Project: 71669
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: 71670
Project: 71670
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: 71671
Project: 71671
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: 71672
Project: 71672
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: 71673
Project: 71673
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: 71674
Project: 71674
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: 71675
Project: 71675
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: 71676
Project: 71676
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: 71677
Project: 71677
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: 71678
Project: 71678
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: 71679
Project: 71679
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: 71680
Project: 71680
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: 71681
Project: 71681
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: 71682
Project: 71682
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: 71685
Project: 71685
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: 71686
Project: 71686
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: 71688
Project: 71688
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: 71689
Project: 71689
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);
}