nus-yam/ex-repair huggingface dataset:
Program: 36394
Project: 36394
Buggy source:
/** 
 * Check if the logger is above of the level of detail given
 * @see java.util.logging.Level
 * @param level logging level
 * @return true if level is above the given one
 */
public boolean levelAbove(final Level level){
  return logger.getLevel().intValue() > level.intValue();
}

Fixed version (ground truth):
/** 
 * Check if the logger is above of the level of detail given
 * @see java.util.logging.Level
 * @param level logging level
 * @return true if level is above the given one
 */
public boolean levelAbove(final Level level){
  return getLevel().intValue() > level.intValue();
}
Program: 36395
Project: 36395
Buggy source:
/** 
 * Is this global of the given Context?
 * @return true if this global belongs to the given Context
 */
public boolean isOfContext(Context context);

Fixed version (ground truth):
/** 
 * Is this global of the given Context?
 * @param ctxt the context
 * @return true if this global belongs to the given Context
 */
public boolean isOfContext(final Context ctxt);
Program: 36396
Project: 36396
Buggy source:
private Node leaveCmp(final BinaryNode binaryNode){
  ensureTypeNotUnknown(binaryNode.lhs());
  ensureTypeNotUnknown(binaryNode.rhs());
  return end(ensureSymbol(Type.BOOLEAN,binaryNode));
}

Fixed version (ground truth):
private Node leaveCmp(final BinaryNode binaryNode){
  ensureTypeNotUnknown(binaryNode.lhs());
  ensureTypeNotUnknown(binaryNode.rhs());
  Type widest=Type.widest(binaryNode.lhs().getType(),binaryNode.rhs().getType());
  ensureSymbol(widest,binaryNode.lhs());
  ensureSymbol(widest,binaryNode.rhs());
  return end(ensureSymbol(Type.BOOLEAN,binaryNode));
}
Program: 36397
Project: 36397
Buggy source:
@Override public Node leaveNEW(final UnaryNode unaryNode){
  return end(ensureSymbol(Type.OBJECT,unaryNode));
}

Fixed version (ground truth):
@Override public Node leaveNEW(final UnaryNode unaryNode){
  return end(ensureSymbol(Type.OBJECT,unaryNode.setRHS(((CallNode)unaryNode.rhs()).setIsNew())));
}
Program: 36398
Project: 36398
Buggy source:
/** 
 * Eg. var d = 17; var e; e = d; //initially typed as int for node type, should retype as double e = object; var d = 17; var e; e -= d; //initially type number, should number remain with a final conversion supplied by Store. ugly, but the computation result of the sub is numeric e = object;
 */
@SuppressWarnings("String_Node_Str") @Override public Node leaveBinaryNode(final BinaryNode binaryNode){
  final Type widest=Type.widest(binaryNode.lhs().getType(),binaryNode.rhs().getType());
  BinaryNode newBinaryNode=binaryNode;
switch (binaryNode.tokenType()) {
default :
    if (!binaryNode.isAssignment() || binaryNode.isSelfModifying()) {
      break;
    }
  newBinaryNode=newBinaryNode.setLHS(widen(newBinaryNode.lhs(),widest));
case ADD:
newBinaryNode=(BinaryNode)widen(newBinaryNode,widest);
}
return newBinaryNode;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Node leaveBinaryNode(final BinaryNode binaryNode){
  final Type widest=Type.widest(binaryNode.lhs().getType(),binaryNode.rhs().getType());
  BinaryNode newBinaryNode=binaryNode;
  if (isAdd(binaryNode)) {
    newBinaryNode=(BinaryNode)widen(newBinaryNode,widest);
    if (newBinaryNode.getType().isObject() && !isAddString(newBinaryNode)) {
      return new RuntimeNode(newBinaryNode,Request.ADD);
    }
  }
 else   if (binaryNode.isComparison()) {
    final Expression lhs=newBinaryNode.lhs();
    final Expression rhs=newBinaryNode.rhs();
    Type cmpWidest=Type.widest(lhs.getType(),rhs.getType());
    boolean newRuntimeNode=false, finalized=false;
switch (newBinaryNode.tokenType()) {
case EQ_STRICT:
case NE_STRICT:
      if (lhs.getType().isBoolean() != rhs.getType().isBoolean()) {
        newRuntimeNode=true;
        cmpWidest=Type.OBJECT;
        finalized=true;
      }
default :
    if (newRuntimeNode || cmpWidest.isObject()) {
      return new RuntimeNode(newBinaryNode,Request.requestFor(binaryNode)).setIsFinal(finalized);
    }
  break;
}
return newBinaryNode;
}
 else {
if (!binaryNode.isAssignment() || binaryNode.isSelfModifying()) {
return newBinaryNode;
}
checkThisAssignment(binaryNode);
newBinaryNode=newBinaryNode.setLHS(widen(newBinaryNode.lhs(),widest));
newBinaryNode=(BinaryNode)widen(newBinaryNode,widest);
}
return newBinaryNode;
}
Program: 36400
Project: 36400
Buggy source:
private void branchOptimizer(final Expression node,final Label label,final boolean state){
  if (!(node instanceof TernaryNode)) {
    if (node instanceof BinaryNode) {
      branchOptimizer((BinaryNode)node,label,state);
      return;
    }
    if (node instanceof UnaryNode) {
      branchOptimizer((UnaryNode)node,label,state);
      return;
    }
  }
  load(node);
  method.convert(Type.BOOLEAN);
  if (state) {
    method.ifne(label);
  }
 else {
    method.ifeq(label);
  }
}

Fixed version (ground truth):
private void branchOptimizer(final Expression node,final Label label,final boolean state){
  if (!(node instanceof TernaryNode)) {
    if (node instanceof BinaryNode) {
      branchOptimizer((BinaryNode)node,label,state);
      return;
    }
    if (node instanceof UnaryNode) {
      branchOptimizer((UnaryNode)node,label,state);
      return;
    }
  }
  codegen.load(node);
  method.convert(Type.BOOLEAN);
  if (state) {
    method.ifne(label);
  }
 else {
    method.ifeq(label);
  }
}
Program: 36401
Project: 36401
Buggy source:
/** 
 * Returns the identification string associated with this <code>GraphicsDevice</code>. <p> A particular program might use more than one <code>GraphicsDevice</code> in a <code>GraphicsEnvironment</code>. This method returns a <code>String</code> identifying a particular <code>GraphicsDevice</code> in the local <code>GraphicsEnvironment</code>.  Although there is no public method to set this <code>String</code>, a programmer can use the <code>String</code> for debugging purposes.  Vendors of the Java<sup><font size=-2>TM</font></sup> Runtime Environment can format the return value of the <code>String</code>.  To determine how to interpret the value of the <code>String</code>, contact the vendor of your Java Runtime.  To find out who the vendor is, from your program, call the  {@link System#getProperty(String) getProperty} method of theSystem class with "java.vendor".
 * @return a <code>String</code> that is the identificationof this <code>GraphicsDevice</code>.
 */
public abstract String getIDstring();

Fixed version (ground truth):
/** 
 * Returns the identification string associated with this <code>GraphicsDevice</code>. <p> A particular program might use more than one <code>GraphicsDevice</code> in a <code>GraphicsEnvironment</code>. This method returns a <code>String</code> identifying a particular <code>GraphicsDevice</code> in the local <code>GraphicsEnvironment</code>.  Although there is no public method to set this <code>String</code>, a programmer can use the <code>String</code> for debugging purposes.  Vendors of the Java&trade; Runtime Environment can format the return value of the <code>String</code>.  To determine how to interpret the value of the <code>String</code>, contact the vendor of your Java Runtime.  To find out who the vendor is, from your program, call the  {@link System#getProperty(String) getProperty} method of theSystem class with "java.vendor".
 * @return a <code>String</code> that is the identificationof this <code>GraphicsDevice</code>.
 */
public abstract String getIDstring();
Program: 36402
Project: 36402
Buggy source:
/** 
 * Returns an array of design limits interleaved in the form [from->to] for each axis.  For example, design limits for weight could be from 0.1 to 1.0. The values are returned in the same order returned by <code>getDesignAxisNames</code>.
 * @return an array of design limits for each axis.
 */
public float[] getDesignAxisRanges();

Fixed version (ground truth):
/** 
 * Returns an array of design limits interleaved in the form [from&rarr;to] for each axis.  For example, design limits for weight could be from 0.1 to 1.0. The values are returned in the same order returned by <code>getDesignAxisNames</code>.
 * @return an array of design limits for each axis.
 */
public float[] getDesignAxisRanges();
Program: 36403
Project: 36403
Buggy source:
/** 
 * Returns an <code>int</code> that ORs together the values for all the ranges that will be shaped. <p> For example, to check if a shaper shapes to Arabic, you would use the following: <blockquote> <code>if ((shaper.getRanges() & shaper.ARABIC) != 0) { ... </code> </blockquote> <p>Note that this method supports only the bit mask-based ranges. Call   {@link #getRangeSet()} for the enum-based ranges.
 * @return the values for all the ranges to be shaped.
 */
public int getRanges(){
  return mask & ~CONTEXTUAL_MASK;
}

Fixed version (ground truth):
/** 
 * Returns an <code>int</code> that ORs together the values for all the ranges that will be shaped. <p> For example, to check if a shaper shapes to Arabic, you would use the following: <blockquote> <code>if ((shaper.getRanges() &amp; shaper.ARABIC) != 0) { ... </code> </blockquote> <p>Note that this method supports only the bit mask-based ranges. Call   {@link #getRangeSet()} for the enum-based ranges.
 * @return the values for all the ranges to be shaped.
 */
public int getRanges(){
  return mask & ~CONTEXTUAL_MASK;
}
Program: 36405
Project: 36405
Buggy source:
/** 
 * Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into the text of the start of the selection >= 0
 */
public int getSelectionStart(){
  return JTextComponent.this.getSelectionStart();
}

Fixed version (ground truth):
/** 
 * Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into the text of the start of the selection &ge; 0
 */
public int getSelectionStart(){
  return JTextComponent.this.getSelectionStart();
}
Program: 36406
Project: 36406
Buggy source:
/** 
 * Sets the selection end to the specified position.  The new end point is constrained to be at or after the current selection start. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionEnd the end position of the text >= 0
 * @beaninfo description: ending location of the selection.
 */
public void setSelectionEnd(int selectionEnd){
  select(getSelectionStart(),selectionEnd);
}

Fixed version (ground truth):
/** 
 * Sets the selection end to the specified position.  The new end point is constrained to be at or after the current selection start. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionEnd the end position of the text &ge; 0
 * @beaninfo description: ending location of the selection.
 */
public void setSelectionEnd(int selectionEnd){
  select(getSelectionStart(),selectionEnd);
}
Program: 36407
Project: 36407
Buggy source:
/** 
 * Sets the selection start to the specified position.  The new starting point is constrained to be before or at the current selection end. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionStart the start position of the text >= 0
 * @beaninfo description: starting location of the selection.
 */
public void setSelectionStart(int selectionStart){
  select(selectionStart,getSelectionEnd());
}

Fixed version (ground truth):
/** 
 * Sets the selection start to the specified position.  The new starting point is constrained to be before or at the current selection end. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionStart the start position of the text &ge; 0
 * @beaninfo description: starting location of the selection.
 */
public void setSelectionStart(int selectionStart){
  select(selectionStart,getSelectionEnd());
}
Program: 36409
Project: 36409
Buggy source:
/** 
 * Converts the given place in the view coordinate system to the nearest representative location in the model. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pt the location in the view to translate
 * @return the offset >= 0 from the start of the document,or -1 if the component does not yet have a positive size.
 * @see TextUI#viewToModel
 */
public int viewToModel(Point pt){
  return getUI().viewToModel(this,pt);
}

Fixed version (ground truth):
/** 
 * Converts the given place in the view coordinate system to the nearest representative location in the model. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pt the location in the view to translate
 * @return the offset &ge; 0 from the start of the document,or -1 if the component does not yet have a positive size.
 * @see TextUI#viewToModel
 */
public int viewToModel(Point pt){
  return getUI().viewToModel(this,pt);
}
Program: 36410
Project: 36410
Buggy source:
/** 
 * Returns the number of characters (valid indices)
 * @return the number of characters >= 0
 */
public int getCharCount(){
  return model.getLength();
}

Fixed version (ground truth):
/** 
 * Returns the number of characters (valid indices)
 * @return the number of characters &ge; 0
 */
public int getCharCount(){
  return model.getLength();
}
Program: 36411
Project: 36411
Buggy source:
/** 
 * Converts the given location in the model to a place in the view coordinate system. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pos the position >= 0
 * @return the coordinates as a rectangle, with (r.x, r.y) as the locationin the coordinate system, or null if the component does not yet have a positive size.
 * @exception BadLocationException if the given position does notrepresent a valid location in the associated document
 * @see TextUI#modelToView
 */
public Rectangle modelToView(int pos) throws BadLocationException {
  return getUI().modelToView(this,pos);
}

Fixed version (ground truth):
/** 
 * Converts the given location in the model to a place in the view coordinate system. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pos the position &ge; 0
 * @return the coordinates as a rectangle, with (r.x, r.y) as the locationin the coordinate system, or null if the component does not yet have a positive size.
 * @exception BadLocationException if the given position does notrepresent a valid location in the associated document
 * @see TextUI#modelToView
 */
public Rectangle modelToView(int pos) throws BadLocationException {
  return getUI().modelToView(this,pos);
}
Program: 36412
Project: 36412
Buggy source:
/** 
 * Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into teh text of the end of the selection >= 0
 */
public int getSelectionEnd(){
  return JTextComponent.this.getSelectionEnd();
}

Fixed version (ground truth):
/** 
 * Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into teh text of the end of the selection &ge; 0
 */
public int getSelectionEnd(){
  return JTextComponent.this.getSelectionEnd();
}
Program: 36413
Project: 36413
Buggy source:
/** 
 * Returns the identification string associated with this <code>GraphicsDevice</code>. <p> A particular program might use more than one <code>GraphicsDevice</code> in a <code>GraphicsEnvironment</code>. This method returns a <code>String</code> identifying a particular <code>GraphicsDevice</code> in the local <code>GraphicsEnvironment</code>.  Although there is no public method to set this <code>String</code>, a programmer can use the <code>String</code> for debugging purposes.  Vendors of the Java<sup><font size=-2>TM</font></sup> Runtime Environment can format the return value of the <code>String</code>.  To determine how to interpret the value of the <code>String</code>, contact the vendor of your Java Runtime.  To find out who the vendor is, from your program, call the  {@link System#getProperty(String) getProperty} method of theSystem class with "java.vendor".
 * @return a <code>String</code> that is the identificationof this <code>GraphicsDevice</code>.
 */
public abstract String getIDstring();

Fixed version (ground truth):
/** 
 * Returns the identification string associated with this <code>GraphicsDevice</code>. <p> A particular program might use more than one <code>GraphicsDevice</code> in a <code>GraphicsEnvironment</code>. This method returns a <code>String</code> identifying a particular <code>GraphicsDevice</code> in the local <code>GraphicsEnvironment</code>.  Although there is no public method to set this <code>String</code>, a programmer can use the <code>String</code> for debugging purposes.  Vendors of the Java&trade; Runtime Environment can format the return value of the <code>String</code>.  To determine how to interpret the value of the <code>String</code>, contact the vendor of your Java Runtime.  To find out who the vendor is, from your program, call the  {@link System#getProperty(String) getProperty} method of theSystem class with "java.vendor".
 * @return a <code>String</code> that is the identificationof this <code>GraphicsDevice</code>.
 */
public abstract String getIDstring();
Program: 36414
Project: 36414
Buggy source:
/** 
 * Returns an array of design limits interleaved in the form [from->to] for each axis.  For example, design limits for weight could be from 0.1 to 1.0. The values are returned in the same order returned by <code>getDesignAxisNames</code>.
 * @return an array of design limits for each axis.
 */
public float[] getDesignAxisRanges();

Fixed version (ground truth):
/** 
 * Returns an array of design limits interleaved in the form [from&rarr;to] for each axis.  For example, design limits for weight could be from 0.1 to 1.0. The values are returned in the same order returned by <code>getDesignAxisNames</code>.
 * @return an array of design limits for each axis.
 */
public float[] getDesignAxisRanges();
Program: 36415
Project: 36415
Buggy source:
/** 
 * Returns an <code>int</code> that ORs together the values for all the ranges that will be shaped. <p> For example, to check if a shaper shapes to Arabic, you would use the following: <blockquote> <code>if ((shaper.getRanges() & shaper.ARABIC) != 0) { ... </code> </blockquote> <p>Note that this method supports only the bit mask-based ranges. Call   {@link #getRangeSet()} for the enum-based ranges.
 * @return the values for all the ranges to be shaped.
 */
public int getRanges(){
  return mask & ~CONTEXTUAL_MASK;
}

Fixed version (ground truth):
/** 
 * Returns an <code>int</code> that ORs together the values for all the ranges that will be shaped. <p> For example, to check if a shaper shapes to Arabic, you would use the following: <blockquote> <code>if ((shaper.getRanges() &amp; shaper.ARABIC) != 0) { ... </code> </blockquote> <p>Note that this method supports only the bit mask-based ranges. Call   {@link #getRangeSet()} for the enum-based ranges.
 * @return the values for all the ranges to be shaped.
 */
public int getRanges(){
  return mask & ~CONTEXTUAL_MASK;
}
Program: 36417
Project: 36417
Buggy source:
/** 
 * Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into the text of the start of the selection >= 0
 */
public int getSelectionStart(){
  return JTextComponent.this.getSelectionStart();
}

Fixed version (ground truth):
/** 
 * Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into the text of the start of the selection &ge; 0
 */
public int getSelectionStart(){
  return JTextComponent.this.getSelectionStart();
}
Program: 36418
Project: 36418
Buggy source:
/** 
 * Sets the selection end to the specified position.  The new end point is constrained to be at or after the current selection start. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionEnd the end position of the text >= 0
 * @beaninfo description: ending location of the selection.
 */
public void setSelectionEnd(int selectionEnd){
  select(getSelectionStart(),selectionEnd);
}

Fixed version (ground truth):
/** 
 * Sets the selection end to the specified position.  The new end point is constrained to be at or after the current selection start. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionEnd the end position of the text &ge; 0
 * @beaninfo description: ending location of the selection.
 */
public void setSelectionEnd(int selectionEnd){
  select(getSelectionStart(),selectionEnd);
}
Program: 36419
Project: 36419
Buggy source:
/** 
 * Sets the selection start to the specified position.  The new starting point is constrained to be before or at the current selection end. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionStart the start position of the text >= 0
 * @beaninfo description: starting location of the selection.
 */
public void setSelectionStart(int selectionStart){
  select(selectionStart,getSelectionEnd());
}

Fixed version (ground truth):
/** 
 * Sets the selection start to the specified position.  The new starting point is constrained to be before or at the current selection end. <p> This is available for backward compatibility to code that called this method on <code>java.awt.TextComponent</code>. This is implemented to forward to the <code>Caret</code> implementation which is where the actual selection is maintained.
 * @param selectionStart the start position of the text &ge; 0
 * @beaninfo description: starting location of the selection.
 */
public void setSelectionStart(int selectionStart){
  select(selectionStart,getSelectionEnd());
}
Program: 36421
Project: 36421
Buggy source:
/** 
 * Converts the given place in the view coordinate system to the nearest representative location in the model. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pt the location in the view to translate
 * @return the offset >= 0 from the start of the document,or -1 if the component does not yet have a positive size.
 * @see TextUI#viewToModel
 */
public int viewToModel(Point pt){
  return getUI().viewToModel(this,pt);
}

Fixed version (ground truth):
/** 
 * Converts the given place in the view coordinate system to the nearest representative location in the model. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pt the location in the view to translate
 * @return the offset &ge; 0 from the start of the document,or -1 if the component does not yet have a positive size.
 * @see TextUI#viewToModel
 */
public int viewToModel(Point pt){
  return getUI().viewToModel(this,pt);
}
Program: 36422
Project: 36422
Buggy source:
/** 
 * Returns the number of characters (valid indices)
 * @return the number of characters >= 0
 */
public int getCharCount(){
  return model.getLength();
}

Fixed version (ground truth):
/** 
 * Returns the number of characters (valid indices)
 * @return the number of characters &ge; 0
 */
public int getCharCount(){
  return model.getLength();
}
Program: 36423
Project: 36423
Buggy source:
/** 
 * Converts the given location in the model to a place in the view coordinate system. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pos the position >= 0
 * @return the coordinates as a rectangle, with (r.x, r.y) as the locationin the coordinate system, or null if the component does not yet have a positive size.
 * @exception BadLocationException if the given position does notrepresent a valid location in the associated document
 * @see TextUI#modelToView
 */
public Rectangle modelToView(int pos) throws BadLocationException {
  return getUI().modelToView(this,pos);
}

Fixed version (ground truth):
/** 
 * Converts the given location in the model to a place in the view coordinate system. The component must have a positive size for this translation to be computed (i.e. layout cannot be computed until the component has been sized).  The component does not have to be visible or painted.
 * @param pos the position &ge; 0
 * @return the coordinates as a rectangle, with (r.x, r.y) as the locationin the coordinate system, or null if the component does not yet have a positive size.
 * @exception BadLocationException if the given position does notrepresent a valid location in the associated document
 * @see TextUI#modelToView
 */
public Rectangle modelToView(int pos) throws BadLocationException {
  return getUI().modelToView(this,pos);
}
Program: 36424
Project: 36424
Buggy source:
/** 
 * Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into teh text of the end of the selection >= 0
 */
public int getSelectionEnd(){
  return JTextComponent.this.getSelectionEnd();
}

Fixed version (ground truth):
/** 
 * Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same. Return 0 if the text is empty, or the caret position if no selection.
 * @return the index into teh text of the end of the selection &ge; 0
 */
public int getSelectionEnd(){
  return JTextComponent.this.getSelectionEnd();
}
Program: 36425
Project: 36425
Buggy source:
private Node leaveCmp(final BinaryNode binaryNode){
  ensureTypeNotUnknown(binaryNode.lhs());
  ensureTypeNotUnknown(binaryNode.rhs());
  return end(ensureSymbol(Type.BOOLEAN,binaryNode));
}

Fixed version (ground truth):
private Node leaveCmp(final BinaryNode binaryNode){
  ensureTypeNotUnknown(binaryNode.lhs());
  ensureTypeNotUnknown(binaryNode.rhs());
  Type widest=Type.widest(binaryNode.lhs().getType(),binaryNode.rhs().getType());
  ensureSymbol(widest,binaryNode.lhs());
  ensureSymbol(widest,binaryNode.rhs());
  return end(ensureSymbol(Type.BOOLEAN,binaryNode));
}
Program: 36426
Project: 36426
Buggy source:
@Override public Node leaveNEW(final UnaryNode unaryNode){
  return end(ensureSymbol(Type.OBJECT,unaryNode));
}

Fixed version (ground truth):
@Override public Node leaveNEW(final UnaryNode unaryNode){
  return end(ensureSymbol(Type.OBJECT,unaryNode.setRHS(((CallNode)unaryNode.rhs()).setIsNew())));
}
Program: 36427
Project: 36427
Buggy source:
/** 
 * Eg. var d = 17; var e; e = d; //initially typed as int for node type, should retype as double e = object; var d = 17; var e; e -= d; //initially type number, should number remain with a final conversion supplied by Store. ugly, but the computation result of the sub is numeric e = object;
 */
@SuppressWarnings("String_Node_Str") @Override public Node leaveBinaryNode(final BinaryNode binaryNode){
  final Type widest=Type.widest(binaryNode.lhs().getType(),binaryNode.rhs().getType());
  BinaryNode newBinaryNode=binaryNode;
switch (binaryNode.tokenType()) {
default :
    if (!binaryNode.isAssignment() || binaryNode.isSelfModifying()) {
      break;
    }
  newBinaryNode=newBinaryNode.setLHS(widen(newBinaryNode.lhs(),widest));
case ADD:
newBinaryNode=(BinaryNode)widen(newBinaryNode,widest);
}
return newBinaryNode;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public Node leaveBinaryNode(final BinaryNode binaryNode){
  final Type widest=Type.widest(binaryNode.lhs().getType(),binaryNode.rhs().getType());
  BinaryNode newBinaryNode=binaryNode;
  if (isAdd(binaryNode)) {
    newBinaryNode=(BinaryNode)widen(newBinaryNode,widest);
    if (newBinaryNode.getType().isObject() && !isAddString(newBinaryNode)) {
      return new RuntimeNode(newBinaryNode,Request.ADD);
    }
  }
 else   if (binaryNode.isComparison()) {
    final Expression lhs=newBinaryNode.lhs();
    final Expression rhs=newBinaryNode.rhs();
    Type cmpWidest=Type.widest(lhs.getType(),rhs.getType());
    boolean newRuntimeNode=false, finalized=false;
switch (newBinaryNode.tokenType()) {
case EQ_STRICT:
case NE_STRICT:
      if (lhs.getType().isBoolean() != rhs.getType().isBoolean()) {
        newRuntimeNode=true;
        cmpWidest=Type.OBJECT;
        finalized=true;
      }
default :
    if (newRuntimeNode || cmpWidest.isObject()) {
      return new RuntimeNode(newBinaryNode,Request.requestFor(binaryNode)).setIsFinal(finalized);
    }
  break;
}
return newBinaryNode;
}
 else {
if (!binaryNode.isAssignment() || binaryNode.isSelfModifying()) {
return newBinaryNode;
}
checkThisAssignment(binaryNode);
newBinaryNode=newBinaryNode.setLHS(widen(newBinaryNode.lhs(),widest));
newBinaryNode=(BinaryNode)widen(newBinaryNode,widest);
}
return newBinaryNode;
}
Program: 36429
Project: 36429
Buggy source:
private void branchOptimizer(final Expression node,final Label label,final boolean state){
  if (!(node instanceof TernaryNode)) {
    if (node instanceof BinaryNode) {
      branchOptimizer((BinaryNode)node,label,state);
      return;
    }
    if (node instanceof UnaryNode) {
      branchOptimizer((UnaryNode)node,label,state);
      return;
    }
  }
  load(node);
  method.convert(Type.BOOLEAN);
  if (state) {
    method.ifne(label);
  }
 else {
    method.ifeq(label);
  }
}

Fixed version (ground truth):
private void branchOptimizer(final Expression node,final Label label,final boolean state){
  if (!(node instanceof TernaryNode)) {
    if (node instanceof BinaryNode) {
      branchOptimizer((BinaryNode)node,label,state);
      return;
    }
    if (node instanceof UnaryNode) {
      branchOptimizer((UnaryNode)node,label,state);
      return;
    }
  }
  codegen.load(node);
  method.convert(Type.BOOLEAN);
  if (state) {
    method.ifne(label);
  }
 else {
    method.ifeq(label);
  }
}
Program: 36430
Project: 36430
Buggy source:
/** 
 * Returns the extended modifier mask for this event. <P> Extended modifiers are the modifiers that ends with the _DOWN_MASK suffix, such as ALT_DOWN_MASK, BUTTON1_DOWN_MASK, and others. <P> Extended modifiers represent the state of all modal keys, such as ALT, CTRL, META, and the mouse buttons just after the event occurred. <P> For example, if the user presses <b>button 1</b> followed by <b>button 2</b>, and then releases them in the same order, the following sequence of events is generated: <PRE> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK</code> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_CLICKED</code>:  <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>MOUSE_CLICKED</code>: </PRE> <P> It is not recommended to compare the return value of this method using <code>==</code> because new modifiers can be added in the future. For example, the appropriate way to check that SHIFT and BUTTON1 are down, but CTRL is up is demonstrated by the following code: <PRE> int onmask = SHIFT_DOWN_MASK | BUTTON1_DOWN_MASK; int offmask = CTRL_DOWN_MASK; if ((event.getModifiersEx() & (onmask | offmask)) == onmask) { ... } </PRE> The above code will work even if new modifiers are added.
 * @since 1.4
 */
public int getModifiersEx(){
  return modifiers & ~JDK_1_3_MODIFIERS;
}

Fixed version (ground truth):
/** 
 * Returns the extended modifier mask for this event. <P> Extended modifiers are the modifiers that ends with the _DOWN_MASK suffix, such as ALT_DOWN_MASK, BUTTON1_DOWN_MASK, and others. <P> Extended modifiers represent the state of all modal keys, such as ALT, CTRL, META, and the mouse buttons just after the event occurred. <P> For example, if the user presses <b>button 1</b> followed by <b>button 2</b>, and then releases them in the same order, the following sequence of events is generated: <PRE> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK</code> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_CLICKED</code>:  <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>MOUSE_CLICKED</code>: </PRE> <P> It is not recommended to compare the return value of this method using <code>==</code> because new modifiers can be added in the future. For example, the appropriate way to check that SHIFT and BUTTON1 are down, but CTRL is up is demonstrated by the following code: <PRE> int onmask = SHIFT_DOWN_MASK | BUTTON1_DOWN_MASK; int offmask = CTRL_DOWN_MASK; if ((event.getModifiersEx() &amp; (onmask | offmask)) == onmask) { ... } </PRE> The above code will work even if new modifiers are added.
 * @since 1.4
 */
public int getModifiersEx(){
  return modifiers & ~JDK_1_3_MODIFIERS;
}
Program: 36432
Project: 36432
Buggy source:
/** 
 * Returns the extended modifier mask for this event. <P> Extended modifiers are the modifiers that ends with the _DOWN_MASK suffix, such as ALT_DOWN_MASK, BUTTON1_DOWN_MASK, and others. <P> Extended modifiers represent the state of all modal keys, such as ALT, CTRL, META, and the mouse buttons just after the event occurred. <P> For example, if the user presses <b>button 1</b> followed by <b>button 2</b>, and then releases them in the same order, the following sequence of events is generated: <PRE> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK</code> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_CLICKED</code>:  <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>MOUSE_CLICKED</code>: </PRE> <P> It is not recommended to compare the return value of this method using <code>==</code> because new modifiers can be added in the future. For example, the appropriate way to check that SHIFT and BUTTON1 are down, but CTRL is up is demonstrated by the following code: <PRE> int onmask = SHIFT_DOWN_MASK | BUTTON1_DOWN_MASK; int offmask = CTRL_DOWN_MASK; if ((event.getModifiersEx() & (onmask | offmask)) == onmask) { ... } </PRE> The above code will work even if new modifiers are added.
 * @since 1.4
 */
public int getModifiersEx(){
  return modifiers & ~JDK_1_3_MODIFIERS;
}

Fixed version (ground truth):
/** 
 * Returns the extended modifier mask for this event. <P> Extended modifiers are the modifiers that ends with the _DOWN_MASK suffix, such as ALT_DOWN_MASK, BUTTON1_DOWN_MASK, and others. <P> Extended modifiers represent the state of all modal keys, such as ALT, CTRL, META, and the mouse buttons just after the event occurred. <P> For example, if the user presses <b>button 1</b> followed by <b>button 2</b>, and then releases them in the same order, the following sequence of events is generated: <PRE> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK</code> <code>MOUSE_PRESSED</code>:  <code>BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_CLICKED</code>:  <code>BUTTON2_DOWN_MASK</code> <code>MOUSE_RELEASED</code>: <code>MOUSE_CLICKED</code>: </PRE> <P> It is not recommended to compare the return value of this method using <code>==</code> because new modifiers can be added in the future. For example, the appropriate way to check that SHIFT and BUTTON1 are down, but CTRL is up is demonstrated by the following code: <PRE> int onmask = SHIFT_DOWN_MASK | BUTTON1_DOWN_MASK; int offmask = CTRL_DOWN_MASK; if ((event.getModifiersEx() &amp; (onmask | offmask)) == onmask) { ... } </PRE> The above code will work even if new modifiers are added.
 * @since 1.4
 */
public int getModifiersEx(){
  return modifiers & ~JDK_1_3_MODIFIERS;
}
Program: 36439
Project: 36439
Buggy source:
/** 
 * Provides a hint to the look and feel as to the <code>KeyEvent.VK</code> constant that can be used as a mnemonic to access the panel. A return value <= 0 indicates there is no mnemonic. <p> The return value here is a hint, it is ultimately up to the look and feel to honor the return value in some meaningful way. <p> This implementation returns 0, indicating the <code>AbstractColorChooserPanel</code> does not support a mnemonic, subclasses wishing a mnemonic will need to override this.
 * @return KeyEvent.VK constant identifying the mnemonic; <= 0 for nomnemonic
 * @see #getDisplayedMnemonicIndex
 * @since 1.4
 */
public int getMnemonic(){
  return 0;
}

Fixed version (ground truth):
/** 
 * Provides a hint to the look and feel as to the <code>KeyEvent.VK</code> constant that can be used as a mnemonic to access the panel. A return value &lt;= 0 indicates there is no mnemonic. <p> The return value here is a hint, it is ultimately up to the look and feel to honor the return value in some meaningful way. <p> This implementation returns 0, indicating the <code>AbstractColorChooserPanel</code> does not support a mnemonic, subclasses wishing a mnemonic will need to override this.
 * @return KeyEvent.VK constant identifying the mnemonic; &lt;= 0 for nomnemonic
 * @see #getDisplayedMnemonicIndex
 * @since 1.4
 */
public int getMnemonic(){
  return 0;
}
Program: 36440
Project: 36440
Buggy source:
/** 
 * Provides a hint to the look and feel as to the index of the character in <code>getDisplayName</code> that should be visually identified as the mnemonic. The look and feel should only use this if <code>getMnemonic</code> returns a value > 0. <p> The return value here is a hint, it is ultimately up to the look and feel to honor the return value in some meaningful way. For example, a look and feel may wish to render each <code>AbstractColorChooserPanel</code> in a <code>JTabbedPane</code>, and further use this return value to underline a character in the <code>getDisplayName</code>. <p> This implementation returns -1, indicating the <code>AbstractColorChooserPanel</code> does not support a mnemonic, subclasses wishing a mnemonic will need to override this.
 * @return Character index to render mnemonic for; -1 to provide novisual identifier for this panel.
 * @see #getMnemonic
 * @since 1.4
 */
public int getDisplayedMnemonicIndex(){
  return -1;
}

Fixed version (ground truth):
/** 
 * Provides a hint to the look and feel as to the index of the character in <code>getDisplayName</code> that should be visually identified as the mnemonic. The look and feel should only use this if <code>getMnemonic</code> returns a value &gt; 0. <p> The return value here is a hint, it is ultimately up to the look and feel to honor the return value in some meaningful way. For example, a look and feel may wish to render each <code>AbstractColorChooserPanel</code> in a <code>JTabbedPane</code>, and further use this return value to underline a character in the <code>getDisplayName</code>. <p> This implementation returns -1, indicating the <code>AbstractColorChooserPanel</code> does not support a mnemonic, subclasses wishing a mnemonic will need to override this.
 * @return Character index to render mnemonic for; -1 to provide novisual identifier for this panel.
 * @see #getMnemonic
 * @since 1.4
 */
public int getDisplayedMnemonicIndex(){
  return -1;
}
Program: 36441
Project: 36441
Buggy source:
/** 
 * Fetches the location of other end of a logical selection.  If there is no selection, this will be the same as dot.
 * @return the mark >= 0
 */
public abstract int getMark();

Fixed version (ground truth):
/** 
 * Fetches the location of other end of a logical selection.  If there is no selection, this will be the same as dot.
 * @return the mark &gt;= 0
 */
public abstract int getMark();
Program: 36442
Project: 36442
Buggy source:
/** 
 * Fetches the location of the caret.
 * @return the dot >= 0
 */
public abstract int getDot();

Fixed version (ground truth):
/** 
 * Fetches the location of the caret.
 * @return the dot &gt;= 0
 */
public abstract int getDot();
Program: 36443
Project: 36443
Buggy source:
/** 
 * Fetches the index within the element represented. This is the location that children were added and/or removed.
 * @return the index >= 0
 */
public int getIndex();

Fixed version (ground truth):
/** 
 * Fetches the index within the element represented. This is the location that children were added and/or removed.
 * @return the index &gt;= 0
 */
public int getIndex();
Program: 36444
Project: 36444
Buggy source:
/** 
 * Returns the offset within the document of the start of the change.
 * @return the offset >= 0
 */
public int getOffset();

Fixed version (ground truth):
/** 
 * Returns the offset within the document of the start of the change.
 * @return the offset &gt;= 0
 */
public int getOffset();
Program: 36445
Project: 36445
Buggy source:
/** 
 * Returns the length of the change.
 * @return the length >= 0
 */
public int getLength();

Fixed version (ground truth):
/** 
 * Returns the length of the change.
 * @return the length &gt;= 0
 */
public int getLength();
Program: 36446
Project: 36446
Buggy source:
/** 
 * Constructs a ListDataEvent object. If index0 is > index1, index0 and index1 will be swapped such that index0 will always be <= index1.
 * @param source  the source Object (typically <code>this</code>)
 * @param type    an int specifying {@link #CONTENTS_CHANGED},  {@link #INTERVAL_ADDED}, or   {@link #INTERVAL_REMOVED}
 * @param index0  one end of the new interval
 * @param index1  the other end of the new interval
 */
public ListDataEvent(Object source,int type,int index0,int index1){
  super(source);
  this.type=type;
  this.index0=Math.min(index0,index1);
  this.index1=Math.max(index0,index1);
}

Fixed version (ground truth):
/** 
 * Constructs a ListDataEvent object. If index0 is &gt; index1, index0 and index1 will be swapped such that index0 will always be &lt;= index1.
 * @param source  the source Object (typically <code>this</code>)
 * @param type    an int specifying {@link #CONTENTS_CHANGED},  {@link #INTERVAL_ADDED}, or   {@link #INTERVAL_REMOVED}
 * @param index0  one end of the new interval
 * @param index1  the other end of the new interval
 */
public ListDataEvent(Object source,int type,int index0,int index1){
  super(source);
  this.type=type;
  this.index0=Math.min(index0,index1);
  this.index1=Math.max(index0,index1);
}
Program: 36447
Project: 36447
Buggy source:
/** 
 * Notification from the <code>UIManager</code> that the look and feel [L&F] has changed. Replaces the current UI object with the latest version from the <code>UIManager</code>.
 * @see JComponent#updateUI
 */
public void updateUI(){
  super.updateUI();
  setForeground(null);
  setBackground(null);
}

Fixed version (ground truth):
/** 
 * Notification from the <code>UIManager</code> that the look and feel [L&amp;F] has changed. Replaces the current UI object with the latest version from the <code>UIManager</code>.
 * @see JComponent#updateUI
 */
public void updateUI(){
  super.updateUI();
  setForeground(null);
  setBackground(null);
}
Program: 36448
Project: 36448
Buggy source:
/** 
 * Moves one or more rows from the inclusive range <code>start</code> to <code>end</code> to the <code>to</code> position in the model. After the move, the row that was at index <code>start</code> will be at index <code>to</code>. This method will send a <code>tableChanged</code> notification message to all the listeners. <p> <pre> Examples of moves: <p> 1. moveRow(1,3,5); a|B|C|D|e|f|g|h|i|j|k   - before a|e|f|g|h|B|C|D|i|j|k   - after <p> 2. moveRow(6,7,1); a|b|c|d|e|f|G|H|i|j|k   - before a|G|H|b|c|d|e|f|i|j|k   - after <p> </pre>
 * @param start       the starting row index to be moved
 * @param end         the ending row index to be moved
 * @param to          the destination of the rows to be moved
 * @exception ArrayIndexOutOfBoundsException  if any of the elementswould be moved out of the table's range
 */
public void moveRow(int start,int end,int to){
  int shift=to - start;
  int first, last;
  if (shift < 0) {
    first=to;
    last=end;
  }
 else {
    first=start;
    last=to + end - start;
  }
  rotate(dataVector,first,last + 1,shift);
  fireTableRowsUpdated(first,last);
}

Fixed version (ground truth):
/** 
 * Moves one or more rows from the inclusive range <code>start</code> to <code>end</code> to the <code>to</code> position in the model. After the move, the row that was at index <code>start</code> will be at index <code>to</code>. This method will send a <code>tableChanged</code> notification message to all the listeners. <p> <pre> Examples of moves: 1. moveRow(1,3,5); a|B|C|D|e|f|g|h|i|j|k   - before a|e|f|g|h|B|C|D|i|j|k   - after 2. moveRow(6,7,1); a|b|c|d|e|f|G|H|i|j|k   - before a|G|H|b|c|d|e|f|i|j|k   - after </pre>
 * @param start       the starting row index to be moved
 * @param end         the ending row index to be moved
 * @param to          the destination of the rows to be moved
 * @exception ArrayIndexOutOfBoundsException  if any of the elementswould be moved out of the table's range
 */
public void moveRow(int start,int end,int to){
  int shift=to - start;
  int first, last;
  if (shift < 0) {
    first=to;
    last=end;
  }
 else {
    first=start;
    last=to + end - start;
  }
  rotate(dataVector,first,last + 1,shift);
  fireTableRowsUpdated(first,last);
}
Program: 36449
Project: 36449
Buggy source:
/** 
 * Returns the look and feel (L&F) object that renders this component.
 * @return the <code>TableHeaderUI</code> object that renders this component
 */
public TableHeaderUI getUI(){
  return (TableHeaderUI)ui;
}

Fixed version (ground truth):
/** 
 * Returns the look and feel (L&amp;F) object that renders this component.
 * @return the <code>TableHeaderUI</code> object that renders this component
 */
public TableHeaderUI getUI(){
  return (TableHeaderUI)ui;
}