nus-yam/ex-repair huggingface dataset:
Program: 71484
Project: 71484
Buggy source:
/** 
 * Adds the given content to the textarea document. This method gets called when we are in a textarea context.  Therefore all text that is seen belongs to the text area and is hence added to the TextAreaDocument associated with the text area.
 */
protected void textAreaContent(char[] data){
  try {
    textAreaDocument.insertString(textAreaDocument.getLength(),new String(data),null);
  }
 catch (  BadLocationException e) {
  }
}

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

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

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

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

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

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

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

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

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

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

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

Fixed version (ground truth):
/** 
 * Gets the set of units supported by this duration. <p> The supported units are   {@link ChronoUnit#SECONDS SECONDS}, and   {@link ChronoUnit#NANOS NANOS}. They are returned in the order seconds, nanos. <p> This set can be used in conjunction with   {@link #get(TemporalUnit)}to access the entire state of the duration.
 * @return a list containing the seconds and nanos units, not null
 */
@Override public List<TemporalUnit> getUnits(){
  return DurationUnits.UNITS;
}
Program: 71500
Project: 71500
Buggy source:
/** 
 * Gets the value of the specified field from this instant as an   {@code int}. <p> This queries this instant for the value for the specified field. The returned value will always be within the valid range of values for the field. If it is not possible to return the value, because the field is not supported or for some other reason, an exception is thrown. <p> If the field is a   {@link ChronoField} then the query is implemented here.The  {@link #isSupported(TemporalField) supported fields} will return validvalues based on this date-time, except  {@code INSTANT_SECONDS} which is toolarge to fit in an  {@code int} and throws a {@code DateTimeException}. All other   {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}. <p> If the field is not a   {@code ChronoField}, then the result of this method is obtained by invoking   {@code TemporalField.getFrom(TemporalAccessor)}passing   {@code this} as the argument. Whether the value can be obtained,and what the value represents, is determined by the field.
 * @param field  the field to get, not null
 * @return the value for the field
 * @throws DateTimeException if a value for the field cannot be obtained orthe value is outside the range of valid values for the field
 * @throws UnsupportedTemporalTypeException if the field is not supported orthe range of values exceeds an  {@code int}
 * @throws ArithmeticException if numeric overflow occurs
 */
@Override public int get(TemporalField field){
}

Fixed version (ground truth):
/** 
 * Gets the value of the specified field from this instant as an   {@code int}. <p> This queries this instant for the value of the specified field. The returned value will always be within the valid range of values for the field. If it is not possible to return the value, because the field is not supported or for some other reason, an exception is thrown. <p> If the field is a   {@link ChronoField} then the query is implemented here.The  {@link #isSupported(TemporalField) supported fields} will return validvalues based on this date-time, except  {@code INSTANT_SECONDS} which is toolarge to fit in an  {@code int} and throws a {@code DateTimeException}. All other   {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}. <p> If the field is not a   {@code ChronoField}, then the result of this method is obtained by invoking   {@code TemporalField.getFrom(TemporalAccessor)}passing   {@code this} as the argument. Whether the value can be obtained,and what the value represents, is determined by the field.
 * @param field  the field to get, not null
 * @return the value for the field
 * @throws DateTimeException if a value for the field cannot be obtained orthe value is outside the range of valid values for the field
 * @throws UnsupportedTemporalTypeException if the field is not supported orthe range of values exceeds an  {@code int}
 * @throws ArithmeticException if numeric overflow occurs
 */
@Override public int get(TemporalField field){
}
Program: 71501
Project: 71501
Buggy source:
/** 
 * Gets the value of the specified field from this instant as a   {@code long}. <p> This queries this instant for the value for the specified field. If it is not possible to return the value, because the field is not supported or for some other reason, an exception is thrown. <p> If the field is a   {@link ChronoField} then the query is implemented here.The  {@link #isSupported(TemporalField) supported fields} will return validvalues based on this date-time. All other  {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}. <p> If the field is not a   {@code ChronoField}, then the result of this method is obtained by invoking   {@code TemporalField.getFrom(TemporalAccessor)}passing   {@code this} as the argument. Whether the value can be obtained,and what the value represents, is determined by the field.
 * @param field  the field to get, not null
 * @return the value for the field
 * @throws DateTimeException if a value for the field cannot be obtained
 * @throws UnsupportedTemporalTypeException if the field is not supported
 * @throws ArithmeticException if numeric overflow occurs
 */
@Override public long getLong(TemporalField field){
}

Fixed version (ground truth):
/** 
 * Gets the value of the specified field from this instant as a   {@code long}. <p> This queries this instant for the value of the specified field. If it is not possible to return the value, because the field is not supported or for some other reason, an exception is thrown. <p> If the field is a   {@link ChronoField} then the query is implemented here.The  {@link #isSupported(TemporalField) supported fields} will return validvalues based on this date-time. All other  {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}. <p> If the field is not a   {@code ChronoField}, then the result of this method is obtained by invoking   {@code TemporalField.getFrom(TemporalAccessor)}passing   {@code this} as the argument. Whether the value can be obtained,and what the value represents, is determined by the field.
 * @param field  the field to get, not null
 * @return the value for the field
 * @throws DateTimeException if a value for the field cannot be obtained
 * @throws UnsupportedTemporalTypeException if the field is not supported
 * @throws ArithmeticException if numeric overflow occurs
 */
@Override public long getLong(TemporalField field){
}
Program: 71502
Project: 71502
Buggy source:
/** 
 * Obtains an instance of   {@code LocalDate} from a year and day-of-year.<p> This returns a  {@code LocalDate} with the specified year and day-of-year.The day-of-year must be valid for the year, otherwise an exception will be thrown.
 * @param year  the year to represent, from MIN_YEAR to MAX_YEAR
 * @param dayOfYear  the day-of-year to represent, from 1 to 366
 * @return the local date, not null
 * @throws DateTimeException if the value of any field is out of range,or if the day-of-year is invalid for the month-year
 */
public static LocalDate ofYearDay(int year,int dayOfYear){
  YEAR.checkValidValue(year);
  DAY_OF_YEAR.checkValidValue(dayOfYear);
  boolean leap=IsoChronology.INSTANCE.isLeapYear(year);
  if (dayOfYear == 366 && leap == false) {
    throw new DateTimeException("String_Node_Str" + year + "String_Node_Str");
  }
  Month moy=Month.of((dayOfYear - 1) / 31 + 1);
  int monthEnd=moy.firstDayOfYear(leap) + moy.length(leap) - 1;
  if (dayOfYear > monthEnd) {
    moy=moy.plus(1);
  }
  int dom=dayOfYear - moy.firstDayOfYear(leap) + 1;
  return new LocalDate(year,moy.getValue(),dom);
}

Fixed version (ground truth):
/** 
 * Obtains an instance of   {@code LocalDate} from a year and day-of-year.<p> This returns a  {@code LocalDate} with the specified year and day-of-year.The day-of-year must be valid for the year, otherwise an exception will be thrown.
 * @param year  the year to represent, from MIN_YEAR to MAX_YEAR
 * @param dayOfYear  the day-of-year to represent, from 1 to 366
 * @return the local date, not null
 * @throws DateTimeException if the value of any field is out of range,or if the day-of-year is invalid for the year
 */
public static LocalDate ofYearDay(int year,int dayOfYear){
  YEAR.checkValidValue(year);
  DAY_OF_YEAR.checkValidValue(dayOfYear);
  boolean leap=IsoChronology.INSTANCE.isLeapYear(year);
  if (dayOfYear == 366 && leap == false) {
    throw new DateTimeException("String_Node_Str" + year + "String_Node_Str");
  }
  Month moy=Month.of((dayOfYear - 1) / 31 + 1);
  int monthEnd=moy.firstDayOfYear(leap) + moy.length(leap) - 1;
  if (dayOfYear > monthEnd) {
    moy=moy.plus(1);
  }
  int dom=dayOfYear - moy.firstDayOfYear(leap) + 1;
  return new LocalDate(year,moy.getValue(),dom);
}
Program: 71503
Project: 71503
Buggy source:
/** 
 * Returns a copy of this   {@code LocalDate} with the specified period in months added.<p> This method adds the specified amount to the months field in three steps: <ol> <li>Add the input months to the month-of-year field</li> <li>Check if the resulting date would be invalid</li> <li>Adjust the day-of-month to the last valid day if necessary</li> </ol> <p> For example, 2007-03-31 plus one month would result in the invalid date 2007-04-31. Instead of returning an invalid result, the last valid day of the month, 2007-04-30, is selected instead. <p> This instance is immutable and unaffected by this method call.
 * @param monthsToAdd  the months to add, may be negative
 * @return a {@code LocalDate} based on this date with the months added, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate plusMonths(long monthsToAdd){
  if (monthsToAdd == 0) {
    return this;
  }
  long monthCount=year * 12L + (month - 1);
  long calcMonths=monthCount + monthsToAdd;
  int newYear=YEAR.checkValidIntValue(Math.floorDiv(calcMonths,12));
  int newMonth=(int)Math.floorMod(calcMonths,12) + 1;
  return resolvePreviousValid(newYear,newMonth,day);
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the specified number of months added.<p> This method adds the specified amount to the months field in three steps: <ol> <li>Add the input months to the month-of-year field</li> <li>Check if the resulting date would be invalid</li> <li>Adjust the day-of-month to the last valid day if necessary</li> </ol> <p> For example, 2007-03-31 plus one month would result in the invalid date 2007-04-31. Instead of returning an invalid result, the last valid day of the month, 2007-04-30, is selected instead. <p> This instance is immutable and unaffected by this method call.
 * @param monthsToAdd  the months to add, may be negative
 * @return a {@code LocalDate} based on this date with the months added, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate plusMonths(long monthsToAdd){
  if (monthsToAdd == 0) {
    return this;
  }
  long monthCount=year * 12L + (month - 1);
  long calcMonths=monthCount + monthsToAdd;
  int newYear=YEAR.checkValidIntValue(Math.floorDiv(calcMonths,12));
  int newMonth=(int)Math.floorMod(calcMonths,12) + 1;
  return resolvePreviousValid(newYear,newMonth,day);
}
Program: 71504
Project: 71504
Buggy source:
/** 
 * Returns a copy of this   {@code LocalDate} with the specified period in years added.<p> This method adds the specified amount to the years field in three steps: <ol> <li>Add the input years to the year field</li> <li>Check if the resulting date would be invalid</li> <li>Adjust the day-of-month to the last valid day if necessary</li> </ol> <p> For example, 2008-02-29 (leap year) plus one year would result in the invalid date 2009-02-29 (standard year). Instead of returning an invalid result, the last valid day of the month, 2009-02-28, is selected instead. <p> This instance is immutable and unaffected by this method call.
 * @param yearsToAdd  the years to add, may be negative
 * @return a {@code LocalDate} based on this date with the years added, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate plusYears(long yearsToAdd){
  if (yearsToAdd == 0) {
    return this;
  }
  int newYear=YEAR.checkValidIntValue(year + yearsToAdd);
  return resolvePreviousValid(newYear,month,day);
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the specified number of years added.<p> This method adds the specified amount to the years field in three steps: <ol> <li>Add the input years to the year field</li> <li>Check if the resulting date would be invalid</li> <li>Adjust the day-of-month to the last valid day if necessary</li> </ol> <p> For example, 2008-02-29 (leap year) plus one year would result in the invalid date 2009-02-29 (standard year). Instead of returning an invalid result, the last valid day of the month, 2009-02-28, is selected instead. <p> This instance is immutable and unaffected by this method call.
 * @param yearsToAdd  the years to add, may be negative
 * @return a {@code LocalDate} based on this date with the years added, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate plusYears(long yearsToAdd){
  if (yearsToAdd == 0) {
    return this;
  }
  int newYear=YEAR.checkValidIntValue(year + yearsToAdd);
  return resolvePreviousValid(newYear,month,day);
}
Program: 71505
Project: 71505
Buggy source:
/** 
 * Checks if the specified unit is supported. <p> This checks if the specified unit can be added to, or subtracted from, this date-time. If false, then calling the   {@link #plus(long,TemporalUnit)} and{@link #minus(long,TemporalUnit) minus} methods will throw an exception.<p> If the unit is a  {@link ChronoUnit} then the query is implemented here.The supported units are: <ul> <li> {@code DAYS}<li>  {@code WEEKS}<li>  {@code MONTHS}<li>  {@code YEARS}<li>  {@code DECADES}<li>  {@code CENTURIES}<li>  {@code MILLENNIA}<li>  {@code ERAS}</ul> All other   {@code ChronoUnit} instances will return false.<p> If the unit is not a  {@code ChronoUnit}, then the result of this method is obtained by invoking   {@code TemporalUnit.isSupportedBy(Temporal)}passing   {@code this} as the argument.Whether the unit is supported is determined by the unit.
 * @param unit  the unit to check, null returns false
 * @return true if the unit can be added/subtracted, false if not
 */
@Override public boolean isSupported(TemporalUnit unit){
  return ChronoLocalDate.super.isSupported(unit);
}

Fixed version (ground truth):
/** 
 * Checks if the specified unit is supported. <p> This checks if the specified unit can be added to, or subtracted from, this date. If false, then calling the   {@link #plus(long,TemporalUnit)} and{@link #minus(long,TemporalUnit) minus} methods will throw an exception.<p> If the unit is a  {@link ChronoUnit} then the query is implemented here.The supported units are: <ul> <li> {@code DAYS}<li>  {@code WEEKS}<li>  {@code MONTHS}<li>  {@code YEARS}<li>  {@code DECADES}<li>  {@code CENTURIES}<li>  {@code MILLENNIA}<li>  {@code ERAS}</ul> All other   {@code ChronoUnit} instances will return false.<p> If the unit is not a  {@code ChronoUnit}, then the result of this method is obtained by invoking   {@code TemporalUnit.isSupportedBy(Temporal)}passing   {@code this} as the argument.Whether the unit is supported is determined by the unit.
 * @param unit  the unit to check, null returns false
 * @return true if the unit can be added/subtracted, false if not
 */
@Override public boolean isSupported(TemporalUnit unit){
  return ChronoLocalDate.super.isSupported(unit);
}
Program: 71506
Project: 71506
Buggy source:
/** 
 * Returns a copy of this date with the day-of-month altered. If the resulting date is invalid, an exception is thrown. <p> This instance is immutable and unaffected by this method call.
 * @param dayOfMonth  the day-of-month to set in the result, from 1 to 28-31
 * @return a {@code LocalDate} based on this date with the requested day, not null
 * @throws DateTimeException if the day-of-month value is invalid,or if the day-of-month is invalid for the month-year
 */
public LocalDate withDayOfMonth(int dayOfMonth){
  if (this.day == dayOfMonth) {
    return this;
  }
  return of(year,month,dayOfMonth);
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the day-of-month altered.<p> If the resulting date is invalid, an exception is thrown. <p> This instance is immutable and unaffected by this method call.
 * @param dayOfMonth  the day-of-month to set in the result, from 1 to 28-31
 * @return a {@code LocalDate} based on this date with the requested day, not null
 * @throws DateTimeException if the day-of-month value is invalid,or if the day-of-month is invalid for the month-year
 */
public LocalDate withDayOfMonth(int dayOfMonth){
  if (this.day == dayOfMonth) {
    return this;
  }
  return of(year,month,dayOfMonth);
}
Program: 71507
Project: 71507
Buggy source:
/** 
 * Returns a copy of this date with the month-of-year altered. If the day-of-month is invalid for the year, it will be changed to the last valid day of the month. <p> This instance is immutable and unaffected by this method call.
 * @param month  the month-of-year to set in the result, from 1 (January) to 12 (December)
 * @return a {@code LocalDate} based on this date with the requested month, not null
 * @throws DateTimeException if the month-of-year value is invalid
 */
public LocalDate withMonth(int month){
  if (this.month == month) {
    return this;
  }
  MONTH_OF_YEAR.checkValidValue(month);
  return resolvePreviousValid(year,month,day);
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the month-of-year altered.<p> If the day-of-month is invalid for the year, it will be changed to the last valid day of the month. <p> This instance is immutable and unaffected by this method call.
 * @param month  the month-of-year to set in the result, from 1 (January) to 12 (December)
 * @return a {@code LocalDate} based on this date with the requested month, not null
 * @throws DateTimeException if the month-of-year value is invalid
 */
public LocalDate withMonth(int month){
  if (this.month == month) {
    return this;
  }
  MONTH_OF_YEAR.checkValidValue(month);
  return resolvePreviousValid(year,month,day);
}
Program: 71508
Project: 71508
Buggy source:
/** 
 * Returns a copy of this date with the year altered. If the day-of-month is invalid for the year, it will be changed to the last valid day of the month. <p> This instance is immutable and unaffected by this method call.
 * @param year  the year to set in the result, from MIN_YEAR to MAX_YEAR
 * @return a {@code LocalDate} based on this date with the requested year, not null
 * @throws DateTimeException if the year value is invalid
 */
public LocalDate withYear(int year){
  if (this.year == year) {
    return this;
  }
  YEAR.checkValidValue(year);
  return resolvePreviousValid(year,month,day);
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the year altered.<p> If the day-of-month is invalid for the year, it will be changed to the last valid day of the month. <p> This instance is immutable and unaffected by this method call.
 * @param year  the year to set in the result, from MIN_YEAR to MAX_YEAR
 * @return a {@code LocalDate} based on this date with the requested year, not null
 * @throws DateTimeException if the year value is invalid
 */
public LocalDate withYear(int year){
  if (this.year == year) {
    return this;
  }
  YEAR.checkValidValue(year);
  return resolvePreviousValid(year,month,day);
}
Program: 71510
Project: 71510
Buggy source:
/** 
 * Returns a copy of this   {@code LocalDate} with the specified period in weeks added.<p> This method adds the specified amount in weeks to the days field incrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded. <p> For example, 2008-12-31 plus one week would result in 2009-01-07. <p> This instance is immutable and unaffected by this method call.
 * @param weeksToAdd  the weeks to add, may be negative
 * @return a {@code LocalDate} based on this date with the weeks added, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate plusWeeks(long weeksToAdd){
  return plusDays(Math.multiplyExact(weeksToAdd,7));
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the specified number of weeks added.<p> This method adds the specified amount in weeks to the days field incrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded. <p> For example, 2008-12-31 plus one week would result in 2009-01-07. <p> This instance is immutable and unaffected by this method call.
 * @param weeksToAdd  the weeks to add, may be negative
 * @return a {@code LocalDate} based on this date with the weeks added, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate plusWeeks(long weeksToAdd){
  return plusDays(Math.multiplyExact(weeksToAdd,7));
}
Program: 71511
Project: 71511
Buggy source:
/** 
 * Obtains an instance of   {@code LocalDate} from the epoch day count.<p> This returns a  {@code LocalDate} with the specified epoch-day.The  {@link ChronoField#EPOCH_DAY EPOCH_DAY} is a simple incrementing countof days where day 0 is 1970-01-01. Negative numbers represent earlier days.
 * @param epochDay  the Epoch Day to convert, based on the epoch 1970-01-01
 * @return the local date, not null
 * @throws DateTimeException if the epoch days exceeds the supported date range
 */
public static LocalDate ofEpochDay(long epochDay){
  long zeroDay=epochDay + DAYS_0000_TO_1970;
  zeroDay-=60;
  long adjust=0;
  if (zeroDay < 0) {
    long adjustCycles=(zeroDay + 1) / DAYS_PER_CYCLE - 1;
    adjust=adjustCycles * 400;
    zeroDay+=-adjustCycles * DAYS_PER_CYCLE;
  }
  long yearEst=(400 * zeroDay + 591) / DAYS_PER_CYCLE;
  long doyEst=zeroDay - (365 * yearEst + yearEst / 4 - yearEst / 100 + yearEst / 400);
  if (doyEst < 0) {
    yearEst--;
    doyEst=zeroDay - (365 * yearEst + yearEst / 4 - yearEst / 100 + yearEst / 400);
  }
  yearEst+=adjust;
  int marchDoy0=(int)doyEst;
  int marchMonth0=(marchDoy0 * 5 + 2) / 153;
  int month=(marchMonth0 + 2) % 12 + 1;
  int dom=marchDoy0 - (marchMonth0 * 306 + 5) / 10 + 1;
  yearEst+=marchMonth0 / 10;
  int year=YEAR.checkValidIntValue(yearEst);
  return new LocalDate(year,month,dom);
}

Fixed version (ground truth):
/** 
 * Obtains an instance of   {@code LocalDate} from the epoch day count.<p> This returns a  {@code LocalDate} with the specified epoch-day.The  {@link ChronoField#EPOCH_DAY EPOCH_DAY} is a simple incrementing countof days where day 0 is 1970-01-01. Negative numbers represent earlier days.
 * @param epochDay  the Epoch Day to convert, based on the epoch 1970-01-01
 * @return the local date, not null
 * @throws DateTimeException if the epoch day exceeds the supported date range
 */
public static LocalDate ofEpochDay(long epochDay){
  long zeroDay=epochDay + DAYS_0000_TO_1970;
  zeroDay-=60;
  long adjust=0;
  if (zeroDay < 0) {
    long adjustCycles=(zeroDay + 1) / DAYS_PER_CYCLE - 1;
    adjust=adjustCycles * 400;
    zeroDay+=-adjustCycles * DAYS_PER_CYCLE;
  }
  long yearEst=(400 * zeroDay + 591) / DAYS_PER_CYCLE;
  long doyEst=zeroDay - (365 * yearEst + yearEst / 4 - yearEst / 100 + yearEst / 400);
  if (doyEst < 0) {
    yearEst--;
    doyEst=zeroDay - (365 * yearEst + yearEst / 4 - yearEst / 100 + yearEst / 400);
  }
  yearEst+=adjust;
  int marchDoy0=(int)doyEst;
  int marchMonth0=(marchDoy0 * 5 + 2) / 153;
  int month=(marchMonth0 + 2) % 12 + 1;
  int dom=marchDoy0 - (marchMonth0 * 306 + 5) / 10 + 1;
  yearEst+=marchMonth0 / 10;
  int year=YEAR.checkValidIntValue(yearEst);
  return new LocalDate(year,month,dom);
}
Program: 71512
Project: 71512
Buggy source:
/** 
 * Returns a copy of this   {@code LocalDate} with the specified period in years subtracted.<p> This method subtracts the specified amount from the years field in three steps: <ol> <li>Subtract the input years to the year field</li> <li>Check if the resulting date would be invalid</li> <li>Adjust the day-of-month to the last valid day if necessary</li> </ol> <p> For example, 2008-02-29 (leap year) minus one year would result in the invalid date 2007-02-29 (standard year). Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead. <p> This instance is immutable and unaffected by this method call.
 * @param yearsToSubtract  the years to subtract, may be negative
 * @return a {@code LocalDate} based on this date with the years subtracted, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate minusYears(long yearsToSubtract){
  return (yearsToSubtract == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1) : plusYears(-yearsToSubtract));
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the specified number of years subtracted.<p> This method subtracts the specified amount from the years field in three steps: <ol> <li>Subtract the input years from the year field</li> <li>Check if the resulting date would be invalid</li> <li>Adjust the day-of-month to the last valid day if necessary</li> </ol> <p> For example, 2008-02-29 (leap year) minus one year would result in the invalid date 2007-02-29 (standard year). Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead. <p> This instance is immutable and unaffected by this method call.
 * @param yearsToSubtract  the years to subtract, may be negative
 * @return a {@code LocalDate} based on this date with the years subtracted, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate minusYears(long yearsToSubtract){
  return (yearsToSubtract == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1) : plusYears(-yearsToSubtract));
}
Program: 71513
Project: 71513
Buggy source:
/** 
 * Returns a copy of this   {@code LocalDate} with the specified period in weeks subtracted.<p> This method subtracts the specified amount in weeks from the days field decrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded. <p> For example, 2009-01-07 minus one week would result in 2008-12-31. <p> This instance is immutable and unaffected by this method call.
 * @param weeksToSubtract  the weeks to subtract, may be negative
 * @return a {@code LocalDate} based on this date with the weeks subtracted, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate minusWeeks(long weeksToSubtract){
  return (weeksToSubtract == Long.MIN_VALUE ? plusWeeks(Long.MAX_VALUE).plusWeeks(1) : plusWeeks(-weeksToSubtract));
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the specified number of weeks subtracted.<p> This method subtracts the specified amount in weeks from the days field decrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded. <p> For example, 2009-01-07 minus one week would result in 2008-12-31. <p> This instance is immutable and unaffected by this method call.
 * @param weeksToSubtract  the weeks to subtract, may be negative
 * @return a {@code LocalDate} based on this date with the weeks subtracted, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate minusWeeks(long weeksToSubtract){
  return (weeksToSubtract == Long.MIN_VALUE ? plusWeeks(Long.MAX_VALUE).plusWeeks(1) : plusWeeks(-weeksToSubtract));
}
Program: 71514
Project: 71514
Buggy source:
/** 
 * Returns a copy of this date with the day-of-year altered. If the resulting date is invalid, an exception is thrown. <p> This instance is immutable and unaffected by this method call.
 * @param dayOfYear  the day-of-year to set in the result, from 1 to 365-366
 * @return a {@code LocalDate} based on this date with the requested day, not null
 * @throws DateTimeException if the day-of-year value is invalid,or if the day-of-year is invalid for the year
 */
public LocalDate withDayOfYear(int dayOfYear){
  if (this.getDayOfYear() == dayOfYear) {
    return this;
  }
  return ofYearDay(year,dayOfYear);
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the day-of-year altered.<p> If the resulting date is invalid, an exception is thrown. <p> This instance is immutable and unaffected by this method call.
 * @param dayOfYear  the day-of-year to set in the result, from 1 to 365-366
 * @return a {@code LocalDate} based on this date with the requested day, not null
 * @throws DateTimeException if the day-of-year value is invalid,or if the day-of-year is invalid for the year
 */
public LocalDate withDayOfYear(int dayOfYear){
  if (this.getDayOfYear() == dayOfYear) {
    return this;
  }
  return ofYearDay(year,dayOfYear);
}
Program: 71515
Project: 71515
Buggy source:
/** 
 * Gets the value of the specified field from this date as a   {@code long}. <p> This queries this date for the value for the specified field. If it is not possible to return the value, because the field is not supported or for some other reason, an exception is thrown. <p> If the field is a   {@link ChronoField} then the query is implemented here.The  {@link #isSupported(TemporalField) supported fields} will return validvalues based on this date. All other  {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}. <p> If the field is not a   {@code ChronoField}, then the result of this method is obtained by invoking   {@code TemporalField.getFrom(TemporalAccessor)}passing   {@code this} as the argument. Whether the value can be obtained,and what the value represents, is determined by the field.
 * @param field  the field to get, not null
 * @return the value for the field
 * @throws DateTimeException if a value for the field cannot be obtained
 * @throws UnsupportedTemporalTypeException if the field is not supported
 * @throws ArithmeticException if numeric overflow occurs
 */
@Override public long getLong(TemporalField field){
  if (field instanceof ChronoField) {
    if (field == EPOCH_DAY) {
      return toEpochDay();
    }
    if (field == PROLEPTIC_MONTH) {
      return getProlepticMonth();
    }
    return get0(field);
  }
  return field.getFrom(this);
}

Fixed version (ground truth):
/** 
 * Gets the value of the specified field from this date as a   {@code long}. <p> This queries this date for the value of the specified field. If it is not possible to return the value, because the field is not supported or for some other reason, an exception is thrown. <p> If the field is a   {@link ChronoField} then the query is implemented here.The  {@link #isSupported(TemporalField) supported fields} will return validvalues based on this date. All other  {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}. <p> If the field is not a   {@code ChronoField}, then the result of this method is obtained by invoking   {@code TemporalField.getFrom(TemporalAccessor)}passing   {@code this} as the argument. Whether the value can be obtained,and what the value represents, is determined by the field.
 * @param field  the field to get, not null
 * @return the value for the field
 * @throws DateTimeException if a value for the field cannot be obtained
 * @throws UnsupportedTemporalTypeException if the field is not supported
 * @throws ArithmeticException if numeric overflow occurs
 */
@Override public long getLong(TemporalField field){
  if (field instanceof ChronoField) {
    if (field == EPOCH_DAY) {
      return toEpochDay();
    }
    if (field == PROLEPTIC_MONTH) {
      return getProlepticMonth();
    }
    return get0(field);
  }
  return field.getFrom(this);
}
Program: 71516
Project: 71516
Buggy source:
/** 
 * Returns a copy of this   {@code LocalDate} with the specified period in months subtracted.<p> This method subtracts the specified amount from the months field in three steps: <ol> <li>Subtract the input months to the month-of-year field</li> <li>Check if the resulting date would be invalid</li> <li>Adjust the day-of-month to the last valid day if necessary</li> </ol> <p> For example, 2007-03-31 minus one month would result in the invalid date 2007-02-31. Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead. <p> This instance is immutable and unaffected by this method call.
 * @param monthsToSubtract  the months to subtract, may be negative
 * @return a {@code LocalDate} based on this date with the months subtracted, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate minusMonths(long monthsToSubtract){
  return (monthsToSubtract == Long.MIN_VALUE ? plusMonths(Long.MAX_VALUE).plusMonths(1) : plusMonths(-monthsToSubtract));
}

Fixed version (ground truth):
/** 
 * Returns a copy of this   {@code LocalDate} with the specified number of months subtracted.<p> This method subtracts the specified amount from the months field in three steps: <ol> <li>Subtract the input months from the month-of-year field</li> <li>Check if the resulting date would be invalid</li> <li>Adjust the day-of-month to the last valid day if necessary</li> </ol> <p> For example, 2007-03-31 minus one month would result in the invalid date 2007-02-31. Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead. <p> This instance is immutable and unaffected by this method call.
 * @param monthsToSubtract  the months to subtract, may be negative
 * @return a {@code LocalDate} based on this date with the months subtracted, not null
 * @throws DateTimeException if the result exceeds the supported date range
 */
public LocalDate minusMonths(long monthsToSubtract){
  return (monthsToSubtract == Long.MIN_VALUE ? plusMonths(Long.MAX_VALUE).plusMonths(1) : plusMonths(-monthsToSubtract));
}
Program: 71517
Project: 71517
Buggy source:
public static void main(String[] args) throws Exception {
  ProcessBuilder pb;
  OutputAnalyzer out;
  pb=ProcessTools.createJavaProcessBuilder("String_Node_Str","String_Node_Str","String_Node_Str");
  out=new OutputAnalyzer(pb.start());
  out.shouldHaveExitValue(0);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  System.out.println("String_Node_Str");
}
Program: 71518
Project: 71518
Buggy source:
/** 
 * Returns a new InputContext instance.
 */
public static InputContext getInstance(){
  return new sun.awt.im.InputMethodContext();
}

Fixed version (ground truth):
/** 
 * Returns a new InputContext instance.
 * @return a new InputContext instance
 */
public static InputContext getInstance(){
  return new sun.awt.im.InputMethodContext();
}
Program: 71519
Project: 71519
Buggy source:
/** 
 * Returns the rendering style attributes for the text range, or null.
 * @since 1.3
 */
public Map<TextAttribute,?> getStyle(){
  return style;
}

Fixed version (ground truth):
/** 
 * Returns the rendering style attributes for the text range, or null.
 * @return the rendering style attributes for the text range, or null
 * @since 1.3
 */
public Map<TextAttribute,?> getStyle(){
  return style;
}
Program: 71520
Project: 71520
Buggy source:
/** 
 * Returns the variation of the text range.
 */
public int getVariation(){
  return variation;
}

Fixed version (ground truth):
/** 
 * Returns the variation of the text range.
 * @return the variation of the text range
 */
public int getVariation(){
  return variation;
}
Program: 71521
Project: 71521
Buggy source:
/** 
 * Returns whether the text range is selected.
 */
public boolean isSelected(){
  return selected;
}

Fixed version (ground truth):
/** 
 * Returns whether the text range is selected.
 * @return whether the text range is selected
 */
public boolean isSelected(){
  return selected;
}
Program: 71522
Project: 71522
Buggy source:
/** 
 * Creates an input method event from the arguments given and dispatches it to the client component. For arguments, see   {@link java.awt.event.InputMethodEvent#InputMethodEvent}.
 */
public void dispatchInputMethodEvent(int id,AttributedCharacterIterator text,int committedCharacterCount,TextHitInfo caret,TextHitInfo visiblePosition);

Fixed version (ground truth):
/** 
 * Creates an input method event from the arguments given and dispatches it to the client component. For arguments, see   {@link java.awt.event.InputMethodEvent#InputMethodEvent}.
 * @param id the event type
 * @param text the combined committed and composed text
 * @param committedCharacterCount the number of committed characters in the text
 * @param caret the caret (a.k.a. insertion point); null ifthere's no caret within current composed text
 * @param visiblePosition the position that's most important to bevisible; null if there's no recommendation for a visible position within current composed text
 */
public void dispatchInputMethodEvent(int id,AttributedCharacterIterator text,int committedCharacterCount,TextHitInfo caret,TextHitInfo visiblePosition);