nus-yam/ex-repair huggingface dataset:
Program: 86612
Project: 86612
Buggy source:
/** 
 * Loads a texture atlas in the Sparrow format. Use TexturePacker with no texture cropping and power of two dimensions.
 * @param xmlPath The absolute path to the xml file in the assets directory.
 */
public Atlas(String xmlPath){
  File xml=new File(xmlPath);
  String assetPath=xml.getParent();
  xml=null;
  Document doc=FP.getXML(xmlPath);
  NodeList tal=doc.getElementsByTagName("String_Node_Str");
  Node ta=tal.item(0);
  String texturePath=assetPath + File.separator + ta.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
  Log.d(TAG,"String_Node_Str" + texturePath);
  setTextureBitmap(texturePath);
  NodeList stl=ta.getChildNodes();
  int subTextureCount=stl.getLength();
  for (int i=0; i < subTextureCount; i++) {
    Node st=stl.item(i);
    if (st.getNodeType() == Node.TEXT_NODE) {
      continue;
    }
    NamedNodeMap atts=st.getAttributes();
    String name;
    int x, y, width, height;
    name=atts.getNamedItem("String_Node_Str").getNodeValue();
    x=Integer.parseInt(atts.getNamedItem("String_Node_Str").getNodeValue());
    y=Integer.parseInt(atts.getNamedItem("String_Node_Str").getNodeValue());
    width=Integer.parseInt(atts.getNamedItem("String_Node_Str").getNodeValue());
    height=Integer.parseInt(atts.getNamedItem("String_Node_Str").getNodeValue());
    mSubTextures.put(name,new SubTexture(this,x,y,width,height));
  }
}

Fixed version (ground truth):
/** 
 * Loads a texture atlas in the Sparrow format. Use TexturePacker with no texture cropping and power of two dimensions.
 * @param xmlPath The absolute path to the xml file in the assets directory.
 */
public Atlas(String xmlPath){
  File xml=new File(xmlPath);
  String assetPath=xml.getParent();
  xml=null;
  Document doc=FP.getXML(xmlPath);
  NodeList tal=doc.getElementsByTagName("String_Node_Str");
  Node ta=tal.item(0);
  String texturePath=assetPath + File.separator + ta.getAttributes().getNamedItem("String_Node_Str").getNodeValue();
  Log.d(TAG,"String_Node_Str" + texturePath);
  setTextureBitmap(texturePath);
  NodeList stl=ta.getChildNodes();
  int subTextureCount=stl.getLength();
  for (int i=0; i < subTextureCount; i++) {
    Node st=stl.item(i);
    if (st.getNodeType() == Node.TEXT_NODE) {
      continue;
    }
    NamedNodeMap atts=st.getAttributes();
    String name;
    int x, y, width, height;
    name=atts.getNamedItem("String_Node_Str").getNodeValue();
    x=Integer.parseInt(atts.getNamedItem("String_Node_Str").getNodeValue());
    y=Integer.parseInt(atts.getNamedItem("String_Node_Str").getNodeValue());
    width=Integer.parseInt(atts.getNamedItem("String_Node_Str").getNodeValue());
    height=Integer.parseInt(atts.getNamedItem("String_Node_Str").getNodeValue());
    mSubTextures.put(name,new SubTexture(this,x,y,width,height));
  }
  if (!ATLAS.contains(this)) {
    ATLAS.add(this);
  }
}
Program: 86613
Project: 86613
Buggy source:
/** 
 * Thread-safe creation the texture.
 * @param gl the GL context.
 */
public void load(){
  if (mLoaded) {
    Log.e(TAG,"String_Node_Str");
    Thread.dumpStack();
    return;
  }
  mRect.set(0,0,mSource.getWidth(),mSource.getHeight());
  TextureLoadRunnable runnable=new TextureLoadRunnable(mSource);
  GL10 agl=OpenGLSystem.getGL();
  if (agl != null) {
    runnable.run(agl);
  }
 else {
    OpenGLSystem.postRunnable(runnable);
  }
}

Fixed version (ground truth):
/** 
 * Thread-safe creation the texture.
 * @param gl the GL context.
 */
public void load(){
  mRect.set(0,0,mSource.getWidth(),mSource.getHeight());
  TextureLoadRunnable runnable=new TextureLoadRunnable(mSource);
  GL10 agl=OpenGLSystem.getGL();
  if (agl != null) {
    runnable.run(agl);
  }
 else {
    OpenGLSystem.postRunnable(runnable);
  }
}
Program: 86614
Project: 86614
Buggy source:
public Point[] getTouches(){
synchronized (mPointIndices) {
    if (mInput != null) {
      int index=0;
      for (      Integer id : mPointIndices) {
        for (int i=0; i < mInput.getPointerCount() && index < mPoints.length; i++) {
          if (mInput.getPointerId(i) == id) {
            mPoints[index].x=(int)mInput.getX(i);
            mPoints[index].y=(int)mInput.getY(i);
            index++;
            break;
          }
        }
      }
    }
    return mPoints;
  }
}

Fixed version (ground truth):
public Point[] getTouches(){
synchronized (mPointIndices) {
    MotionEvent copy=MotionEvent.obtain(mInput);
    if (mInput != null) {
      int index=0;
      for (      Integer id : mPointIndices) {
        for (int i=0; i < copy.getPointerCount() && index < mPoints.length; i++) {
          if (mInput.getPointerId(i) == id) {
            mPoints[index].x=(int)copy.getX(i);
            mPoints[index].y=(int)copy.getY(i);
            index++;
            break;
          }
        }
      }
    }
    return mPoints;
  }
}
Program: 86615
Project: 86615
Buggy source:
private static Bitmap init(String text,int x,int y,int width,int height){
  Paint p=FP.paint;
  p.reset();
  p.setTextSize(Text.size);
  if (width == 0)   width=(int)(p.measureText(text));
  if (height == 0)   height=(int)(Text.size);
  Bitmap source=Bitmap.createBitmap(width,height,Config.ARGB_8888);
  return source;
}

Fixed version (ground truth):
private static Bitmap init(String text,int x,int y,int width,int height){
  Paint p=FP.paint;
  p.reset();
  p.setTextSize(Text.size);
  if (width == 0)   width=(int)(FP.dip(p.measureText(text)));
  if (height == 0)   height=(int)(FP.dip(Text.size));
  Bitmap source=Bitmap.createBitmap(width,height,Config.ARGB_8888);
  return source;
}
Program: 86616
Project: 86616
Buggy source:
/** 
 * @private Updates the drawing buffer. 
 */
@Override public void updateBuffer(boolean clearBefore){
  if (mBuffer == null || mText == null)   return;
  Paint p=FP.paint;
  p.reset();
  p.setStyle(Style.FILL);
  p.setColor(mColor);
  p.setTextSize(mSize);
  p.setAntiAlias(true);
  p.setTextAlign(Align.LEFT);
  mWidth=(int)(p.measureText(mText));
  mHeight=(int)(mSize);
  Bitmap newBm=Bitmap.createBitmap(mWidth,(int)(mHeight + FP.dip(4)),Config.ARGB_8888);
  mSource.recycle();
  mSource=newBm;
  mBufferRect.set(0,0,mWidth,mHeight);
  getClipRect().set(mBufferRect);
  mCanvas.setBitmap(mSource);
  mCanvas.drawText(mText,0,-p.ascent(),p);
  super.updateBuffer(clearBefore);
}

Fixed version (ground truth):
/** 
 * @private Updates the drawing buffer. 
 */
@Override public void updateBuffer(boolean clearBefore){
  if (mBuffer == null || mText == null)   return;
  Paint p=FP.paint;
  p.reset();
  p.setStyle(Style.FILL);
  p.setColor(mColor);
  p.setTextSize(mSize);
  p.setAntiAlias(true);
  p.setTextAlign(Align.LEFT);
  mWidth=(int)(p.measureText(mText));
  mHeight=(int)(FP.dip(mSize));
  Bitmap newBm=Bitmap.createBitmap(mWidth,(int)(mHeight + FP.dip(4)),Config.ARGB_8888);
  mSource.recycle();
  mSource=newBm;
  mBufferRect.set(0,0,mWidth,mHeight);
  getClipRect().set(mBufferRect);
  mCanvas.setBitmap(mSource);
  mCanvas.drawText(mText,0,-p.ascent(),p);
  super.updateBuffer(clearBefore);
}
Program: 86617
Project: 86617
Buggy source:
private void console(MessageReceiver caller,String[] args){
  int page=1;
  String[] searchTerms=null;
  boolean singleHelp=false;
  if (args.length == 2) {
    singleHelp=true;
    if (args[1].matches("String_Node_Str")) {
      page=Integer.parseInt(args[1]);
    }
 else {
      searchTerms=Arrays.copyOfRange(args,1,1);
    }
  }
 else   if (args.length > 2) {
    if (args[args.length - 1].matches("String_Node_Str")) {
      page=Integer.parseInt(args[args.length - 1]);
      searchTerms=Arrays.copyOfRange(args,1,args.length - 1);
    }
 else {
      searchTerms=Arrays.copyOfRange(args,1,args.length);
    }
  }
  ArrayList<String> lines;
  if (searchTerms == null) {
    lines=Canary.help().getHelp(null,page);
  }
 else {
    if (singleHelp) {
      Canary.help().getHelp(caller,searchTerms[0]);
      return;
    }
    lines=Canary.help().getHelp(null,searchTerms,page);
  }
  if (lines == null) {
    Canary.logInfo(Translator.translate("String_Node_Str"));
  }
  for (  String l : lines) {
    Canary.logInfo(TextFormat.removeFormatting(l));
  }
}

Fixed version (ground truth):
private void console(MessageReceiver caller,String[] args){
  int page=1;
  String[] searchTerms=null;
  boolean singleHelp=false;
  if (args.length == 2) {
    singleHelp=true;
    if (args[1].matches("String_Node_Str")) {
      page=Integer.parseInt(args[1]);
    }
 else {
      searchTerms=Arrays.copyOfRange(args,1,1);
    }
  }
 else   if (args.length > 2) {
    if (args[args.length - 1].matches("String_Node_Str")) {
      page=Integer.parseInt(args[args.length - 1]);
      searchTerms=Arrays.copyOfRange(args,1,args.length - 1);
    }
 else {
      searchTerms=Arrays.copyOfRange(args,1,args.length);
    }
  }
  ArrayList<String> lines;
  if (searchTerms == null) {
    lines=Canary.help().getHelp(null,page);
  }
 else {
    if (singleHelp) {
      Canary.help().getHelp(caller,searchTerms[0]);
      return;
    }
    lines=Canary.help().getHelp(null,searchTerms,page);
  }
  if (lines == null) {
    Canary.logInfo(Translator.translate("String_Node_Str"));
    return;
  }
  for (  String l : lines) {
    Canary.logInfo(TextFormat.removeFormatting(l));
  }
}
Program: 86619
Project: 86619
Buggy source:
public PluginCommand(boolean disable,boolean reload){
  this.reload=reload;
  if (reload) {
    disable=false;
  }
 else {
    this.disable=disable;
  }
}

Fixed version (ground truth):
public PluginCommand(boolean disable,boolean reload){
  this.reload=reload;
  this.disable=reload ? false : disable;
}
Program: 86621
Project: 86621
Buggy source:
public void execute(MessageReceiver caller,String[] args){
  Player player=Canary.getServer().matchPlayer(args[1]);
  PermissionNode node=PermissionNode.fromString(args[2]);
  boolean result=false;
  boolean hasPath=false;
  if (player == null) {
    OfflinePlayer oplayer=Canary.getServer().getOfflinePlayer(args[1]);
    result=oplayer.hasPermission(node.getName());
    hasPath=oplayer.getPermissionProvider().pathExists(node.getName());
  }
 else {
    result=player.hasPermission(node.getName());
    hasPath=player.getPermissionProvider().pathExists(node.getName());
  }
  if (hasPath) {
    if (result) {
      caller.message(Colors.LIGHT_GREEN + node.getName() + "String_Node_Str");
    }
 else {
      caller.message(Colors.LIGHT_RED + node.getName() + "String_Node_Str");
    }
  }
 else {
    if (result) {
      caller.message(Colors.LIGHT_GREEN + node.getName() + "String_Node_Str");
    }
 else {
      caller.message(Colors.YELLOW + node.getName() + "String_Node_Str"+ Translator.translate("String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
public void execute(MessageReceiver caller,String[] args){
  Player player=Canary.getServer().matchPlayer(args[1]);
  PermissionNode node=PermissionNode.fromString(args[2]);
  boolean result;
  boolean hasPath;
  if (player == null) {
    OfflinePlayer oplayer=Canary.getServer().getOfflinePlayer(args[1]);
    result=oplayer.hasPermission(node.getName());
    hasPath=oplayer.getPermissionProvider().pathExists(node.getName());
  }
 else {
    result=player.hasPermission(node.getName());
    hasPath=player.getPermissionProvider().pathExists(node.getName());
  }
  if (hasPath) {
    if (result) {
      caller.message(Colors.LIGHT_GREEN + node.getName() + "String_Node_Str");
    }
 else {
      caller.message(Colors.LIGHT_RED + node.getName() + "String_Node_Str");
    }
  }
 else {
    if (result) {
      caller.message(Colors.LIGHT_GREEN + node.getName() + "String_Node_Str");
    }
 else {
      caller.message(Colors.YELLOW + node.getName() + "String_Node_Str"+ Translator.translate("String_Node_Str"));
    }
  }
}
Program: 86622
Project: 86622
Buggy source:
/** 
 * Get whether auto heal is enabled.
 * @return true or false. Returns value of canSpawnMonsters() if auto-heal is 'default'
 */
public boolean isAutoHealEnabled(){
  if (cfg.getString("String_Node_Str","String_Node_Str") == "String_Node_Str") {
    return this.canSpawnMonsters();
  }
  return getBoolean("String_Node_Str",false);
}

Fixed version (ground truth):
/** 
 * Get whether auto heal is enabled.
 * @return true or false. Returns value of canSpawnMonsters() if auto-heal is 'default'
 */
public boolean isAutoHealEnabled(){
  if (cfg.getString("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
    return this.canSpawnMonsters();
  }
  return getBoolean("String_Node_Str",false);
}
Program: 86623
Project: 86623
Buggy source:
/** 
 * Converts this DataAccess object into a string representation.<br> Format: Table : tableName { [`columnName`,'fieldName'] }
 * @return
 */
@Override public String toString(){
  StringBuilder sb=new StringBuilder();
  Map<Column,Object> columns=null;
  try {
    columns=this.toDatabaseEntryList();
  }
 catch (  DatabaseTableInconsistencyException dtie) {
  }
  for (  Column column : columns.keySet()) {
    sb.append("String_Node_Str").append(column.columnName()).append("String_Node_Str").append(columns.get(column)).append("String_Node_Str");
  }
  return "String_Node_Str" + this.tableName + "String_Node_Str"+ sb.toString()+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Converts this DataAccess object into a string representation.<br> Format: Table : tableName { [`columnName`,'fieldName'] }
 * @return
 */
@Override public String toString(){
  StringBuilder sb=new StringBuilder();
  Map<Column,Object> columns=null;
  try {
    columns=this.toDatabaseEntryList();
  }
 catch (  DatabaseTableInconsistencyException dtie) {
  }
  if (columns != null) {
    for (    Column column : columns.keySet()) {
      sb.append("String_Node_Str").append(column.columnName()).append("String_Node_Str").append(columns.get(column)).append("String_Node_Str");
    }
  }
  return "String_Node_Str" + this.tableName + "String_Node_Str"+ sb.toString()+ "String_Node_Str";
}
Program: 86624
Project: 86624
Buggy source:
public void createTable(DataAccess data) throws DatabaseWriteException {
  Connection conn=pool.getConnectionFromPool();
  PreparedStatement ps=null;
  try {
    StringBuilder fields=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    String primary=null;
    Column column=null;
    while (it.hasNext()) {
      column=it.next();
      fields.append("String_Node_Str").append(column.columnName()).append("String_Node_Str");
      fields.append(this.getDataTypeSyntax(column.dataType()));
      if (column.autoIncrement()) {
        fields.append("String_Node_Str");
      }
      if (column.columnType().equals(Column.ColumnType.PRIMARY)) {
        primary=column.columnName();
      }
      if (it.hasNext()) {
        fields.append("String_Node_Str");
      }
    }
    if (primary != null) {
      fields.append("String_Node_Str").append(primary).append("String_Node_Str");
    }
    ps=conn.prepareStatement("String_Node_Str" + data.getName() + "String_Node_Str"+ fields.toString()+ "String_Node_Str");
    ps.execute();
  }
 catch (  SQLException ex) {
    throw new DatabaseWriteException("String_Node_Str" + data.getName() + "String_Node_Str"+ ex.getMessage());
  }
catch (  DatabaseTableInconsistencyException ex) {
    Canary.logStacktrace(ex.getMessage() + "String_Node_Str" + data.getName()+ "String_Node_Str",ex);
  }
 finally {
    this.closePS(ps);
    pool.returnConnectionToPool(conn);
  }
}

Fixed version (ground truth):
public void createTable(DataAccess data) throws DatabaseWriteException {
  Connection conn=pool.getConnectionFromPool();
  PreparedStatement ps=null;
  try {
    StringBuilder fields=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    String primary=null;
    Column column;
    while (it.hasNext()) {
      column=it.next();
      fields.append("String_Node_Str").append(column.columnName()).append("String_Node_Str");
      fields.append(this.getDataTypeSyntax(column.dataType()));
      if (column.autoIncrement()) {
        fields.append("String_Node_Str");
      }
      if (column.columnType().equals(Column.ColumnType.PRIMARY)) {
        primary=column.columnName();
      }
      if (it.hasNext()) {
        fields.append("String_Node_Str");
      }
    }
    if (primary != null) {
      fields.append("String_Node_Str").append(primary).append("String_Node_Str");
    }
    ps=conn.prepareStatement("String_Node_Str" + data.getName() + "String_Node_Str"+ fields.toString()+ "String_Node_Str");
    ps.execute();
  }
 catch (  SQLException ex) {
    throw new DatabaseWriteException("String_Node_Str" + data.getName() + "String_Node_Str"+ ex.getMessage());
  }
catch (  DatabaseTableInconsistencyException ex) {
    Canary.logStacktrace(ex.getMessage() + "String_Node_Str" + data.getName()+ "String_Node_Str",ex);
  }
 finally {
    this.closePS(ps);
    pool.returnConnectionToPool(conn);
  }
}
Program: 86627
Project: 86627
Buggy source:
@Override public void updateSchema(DataAccess schemaTemplate) throws DatabaseWriteException {
  Connection conn=pool.getConnectionFromPool();
  PreparedStatement ps=null;
  ResultSet rs=null;
  try {
    DatabaseMetaData metadata=conn.getMetaData();
    rs=metadata.getTables(null,null,schemaTemplate.getName(),null);
    if (!rs.first()) {
      this.createTable(schemaTemplate);
    }
 else {
      LinkedList<String> toRemove=new LinkedList<String>();
      HashMap<String,Column> toAdd=new HashMap<String,Column>();
      Iterator<Column> it=schemaTemplate.getTableLayout().iterator();
      Column column=null;
      while (it.hasNext()) {
        column=it.next();
        toAdd.put(column.columnName(),column);
      }
      for (      String col : this.getColumnNames(schemaTemplate)) {
        if (!toAdd.containsKey(col)) {
          toRemove.add(col);
        }
 else {
          toAdd.remove(col);
        }
      }
      for (      String name : toRemove) {
        this.deleteColumn(schemaTemplate.getName(),name);
      }
      for (      Map.Entry<String,Column> entry : toAdd.entrySet()) {
        this.insertColumn(schemaTemplate.getName(),entry.getValue());
      }
    }
  }
 catch (  SQLException sqle) {
    throw new DatabaseWriteException("String_Node_Str" + sqle.getMessage());
  }
catch (  DatabaseTableInconsistencyException dtie) {
    Canary.logStacktrace("String_Node_Str" + dtie.getMessage(),dtie);
  }
 finally {
    this.closeRS(rs);
    this.closePS(ps);
    pool.returnConnectionToPool(conn);
  }
}

Fixed version (ground truth):
@Override public void updateSchema(DataAccess schemaTemplate) throws DatabaseWriteException {
  Connection conn=pool.getConnectionFromPool();
  PreparedStatement ps=null;
  ResultSet rs=null;
  try {
    DatabaseMetaData metadata=conn.getMetaData();
    rs=metadata.getTables(null,null,schemaTemplate.getName(),null);
    if (!rs.first()) {
      this.createTable(schemaTemplate);
    }
 else {
      LinkedList<String> toRemove=new LinkedList<String>();
      HashMap<String,Column> toAdd=new HashMap<String,Column>();
      Iterator<Column> it=schemaTemplate.getTableLayout().iterator();
      Column column;
      while (it.hasNext()) {
        column=it.next();
        toAdd.put(column.columnName(),column);
      }
      for (      String col : this.getColumnNames(schemaTemplate)) {
        if (!toAdd.containsKey(col)) {
          toRemove.add(col);
        }
 else {
          toAdd.remove(col);
        }
      }
      for (      String name : toRemove) {
        this.deleteColumn(schemaTemplate.getName(),name);
      }
      for (      Map.Entry<String,Column> entry : toAdd.entrySet()) {
        this.insertColumn(schemaTemplate.getName(),entry.getValue());
      }
    }
  }
 catch (  SQLException sqle) {
    throw new DatabaseWriteException("String_Node_Str" + sqle.getMessage());
  }
catch (  DatabaseTableInconsistencyException dtie) {
    Canary.logStacktrace("String_Node_Str" + dtie.getMessage(),dtie);
  }
 finally {
    this.closeRS(rs);
    this.closePS(ps);
    pool.returnConnectionToPool(conn);
  }
}
Program: 86629
Project: 86629
Buggy source:
@Override public void remove(String tableName,String[] fieldNames,Object[] fieldValues) throws DatabaseWriteException {
  Connection conn=pool.getConnectionFromPool();
  ResultSet rs=null;
  try {
    rs=this.getResultSet(conn,tableName,fieldNames,fieldValues,true);
    if (rs != null) {
      if (rs.next()) {
        rs.deleteRow();
      }
    }
  }
 catch (  DatabaseReadException dre) {
    Canary.logStacktrace(dre.getMessage(),dre);
  }
catch (  SQLException ex) {
    Canary.logStacktrace(ex.getMessage(),ex);
  }
 finally {
    try {
      PreparedStatement st=rs.getStatement() instanceof PreparedStatement ? (PreparedStatement)rs.getStatement() : null;
      this.closeRS(rs);
      this.closePS(st);
      pool.returnConnectionToPool(conn);
    }
 catch (    SQLException ex) {
      Canary.logStacktrace(ex.getMessage(),ex);
    }
  }
}

Fixed version (ground truth):
@Override public void remove(String tableName,String[] fieldNames,Object[] fieldValues) throws DatabaseWriteException {
  Connection conn=pool.getConnectionFromPool();
  ResultSet rs=null;
  try {
    rs=this.getResultSet(conn,tableName,fieldNames,fieldValues,true);
    if (rs != null) {
      if (rs.next()) {
        rs.deleteRow();
      }
    }
  }
 catch (  DatabaseReadException dre) {
    Canary.logStacktrace(dre.getMessage(),dre);
  }
catch (  SQLException ex) {
    Canary.logStacktrace(ex.getMessage(),ex);
  }
 finally {
    try {
      PreparedStatement st=rs != null && rs.getStatement() instanceof PreparedStatement ? (PreparedStatement)rs.getStatement() : null;
      this.closeRS(rs);
      this.closePS(st);
      pool.returnConnectionToPool(conn);
    }
 catch (    SQLException ex) {
      Canary.logStacktrace(ex.getMessage(),ex);
    }
  }
}
Program: 86631
Project: 86631
Buggy source:
public ResultSet getResultSet(Connection conn,String tableName,String[] fieldNames,Object[] fieldValues,boolean limitOne) throws DatabaseReadException {
  PreparedStatement ps=null;
  ResultSet toRet=null;
  try {
    if (fieldNames.length > 0) {
      StringBuilder sb=new StringBuilder();
      for (int i=0; i < fieldNames.length && i < fieldValues.length; i++) {
        sb.append("String_Node_Str").append(fieldNames[i]);
        if (i + 1 < fieldNames.length) {
          sb.append("String_Node_Str");
        }
 else {
          sb.append("String_Node_Str");
        }
      }
      if (limitOne) {
        sb.append("String_Node_Str");
      }
      ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str"+ sb.toString());
      for (int i=0; i < fieldNames.length && i < fieldValues.length; i++) {
        ps.setObject(i + 1,this.convert(fieldValues[i]));
      }
      toRet=ps.executeQuery();
    }
 else {
      if (limitOne) {
        ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str");
      }
 else {
        ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str");
      }
      toRet=ps.executeQuery();
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseReadException("String_Node_Str" + tableName);
  }
catch (  Exception ex) {
    Logger.getLogger(MySQLDatabase.class.getName()).log(Level.SEVERE,null,ex);
  }
  return toRet;
}

Fixed version (ground truth):
public ResultSet getResultSet(Connection conn,String tableName,String[] fieldNames,Object[] fieldValues,boolean limitOne) throws DatabaseReadException {
  PreparedStatement ps;
  ResultSet toRet=null;
  try {
    if (fieldNames.length > 0) {
      StringBuilder sb=new StringBuilder();
      for (int i=0; i < fieldNames.length && i < fieldValues.length; i++) {
        sb.append("String_Node_Str").append(fieldNames[i]);
        if (i + 1 < fieldNames.length) {
          sb.append("String_Node_Str");
        }
 else {
          sb.append("String_Node_Str");
        }
      }
      if (limitOne) {
        sb.append("String_Node_Str");
      }
      ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str"+ sb.toString());
      for (int i=0; i < fieldNames.length && i < fieldValues.length; i++) {
        ps.setObject(i + 1,this.convert(fieldValues[i]));
      }
      toRet=ps.executeQuery();
    }
 else {
      if (limitOne) {
        ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str");
      }
 else {
        ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str");
      }
      toRet=ps.executeQuery();
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseReadException("String_Node_Str" + tableName);
  }
catch (  Exception ex) {
    Logger.getLogger(MySQLDatabase.class.getName()).log(Level.SEVERE,null,ex);
  }
  return toRet;
}
Program: 86632
Project: 86632
Buggy source:
public boolean doesEntryExist(DataAccess data) throws DatabaseWriteException {
  Connection conn=pool.getConnectionFromPool();
  PreparedStatement ps=null;
  ResultSet rs=null;
  boolean toRet=false;
  try {
    StringBuilder sb=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    Column column=null;
    while (it.hasNext()) {
      column=it.next();
      if (!column.autoIncrement()) {
        if (sb.length() > 0) {
          sb.append("String_Node_Str").append(column.columnName());
        }
 else {
          sb.append("String_Node_Str").append(column.columnName());
        }
        sb.append("String_Node_Str");
      }
    }
    ps=conn.prepareStatement("String_Node_Str" + data.getName() + "String_Node_Str"+ sb.toString());
    it=columns.keySet().iterator();
    int index=1;
    while (it.hasNext()) {
      column=it.next();
      if (!column.autoIncrement()) {
        ps.setObject(index,this.convert(columns.get(column)));
        index++;
      }
    }
    rs=ps.executeQuery();
    if (rs != null) {
      toRet=rs.next();
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseWriteException(ex.getMessage() + "String_Node_Str" + data.toString());
  }
catch (  DatabaseTableInconsistencyException ex) {
    Logger.getLogger(MySQLDatabase.class.getName()).log(Level.SEVERE,null,ex);
  }
 finally {
    this.closePS(ps);
    this.closeRS(rs);
    pool.returnConnectionToPool(conn);
  }
  return toRet;
}

Fixed version (ground truth):
public boolean doesEntryExist(DataAccess data) throws DatabaseWriteException {
  Connection conn=pool.getConnectionFromPool();
  PreparedStatement ps=null;
  ResultSet rs=null;
  boolean toRet=false;
  try {
    StringBuilder sb=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    Column column;
    while (it.hasNext()) {
      column=it.next();
      if (!column.autoIncrement()) {
        if (sb.length() > 0) {
          sb.append("String_Node_Str").append(column.columnName());
        }
 else {
          sb.append("String_Node_Str").append(column.columnName());
        }
        sb.append("String_Node_Str");
      }
    }
    ps=conn.prepareStatement("String_Node_Str" + data.getName() + "String_Node_Str"+ sb.toString());
    it=columns.keySet().iterator();
    int index=1;
    while (it.hasNext()) {
      column=it.next();
      if (!column.autoIncrement()) {
        ps.setObject(index,this.convert(columns.get(column)));
        index++;
      }
    }
    rs=ps.executeQuery();
    if (rs != null) {
      toRet=rs.next();
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseWriteException(ex.getMessage() + "String_Node_Str" + data.toString());
  }
catch (  DatabaseTableInconsistencyException ex) {
    Logger.getLogger(MySQLDatabase.class.getName()).log(Level.SEVERE,null,ex);
  }
 finally {
    this.closePS(ps);
    this.closeRS(rs);
    pool.returnConnectionToPool(conn);
  }
  return toRet;
}
Program: 86635
Project: 86635
Buggy source:
@Override public void update(DataAccess data,String[] fieldNames,Object[] fieldValues) throws DatabaseWriteException {
  if (!doesEntryExist(data)) {
    return;
  }
  PreparedStatement ps=null;
  try {
    String updateClause="String_Node_Str" + data.getName() + "String_Node_Str";
    StringBuilder set=new StringBuilder();
    StringBuilder where=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    Column column=null;
    while (it.hasNext()) {
      column=it.next();
      if (where.length() > 0) {
        where.append("String_Node_Str").append(column.columnName());
      }
 else {
        where.append(column.columnName());
      }
      set.append("String_Node_Str");
      set.append(convert(columns.get(column)));
    }
    for (int index=0; index < fieldNames.length && index < fieldValues.length; index++) {
      if (where.length() > 0) {
        where.append("String_Node_Str").append(fieldNames[index]);
      }
 else {
        where.append(fieldNames[index]);
      }
      where.append("String_Node_Str");
      where.append(fieldValues[index]);
    }
    ps=conn.prepareStatement(String.format(updateClause,set.toString(),where.toString()));
    ps.execute();
  }
 catch (  SQLException ex) {
    Canary.logStacktrace(ex.getMessage(),ex);
  }
catch (  DatabaseTableInconsistencyException dbtiex) {
    Canary.logStacktrace(dbtiex.getMessage(),dbtiex);
  }
 finally {
    closePS(ps);
  }
}

Fixed version (ground truth):
@Override public void update(DataAccess data,String[] fieldNames,Object[] fieldValues) throws DatabaseWriteException {
  if (!doesEntryExist(data)) {
    return;
  }
  PreparedStatement ps=null;
  try {
    String updateClause="String_Node_Str" + data.getName() + "String_Node_Str";
    StringBuilder set=new StringBuilder();
    StringBuilder where=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    Column column;
    while (it.hasNext()) {
      column=it.next();
      if (where.length() > 0) {
        where.append("String_Node_Str").append(column.columnName());
      }
 else {
        where.append(column.columnName());
      }
      set.append("String_Node_Str");
      set.append(convert(columns.get(column)));
    }
    for (int index=0; index < fieldNames.length && index < fieldValues.length; index++) {
      if (where.length() > 0) {
        where.append("String_Node_Str").append(fieldNames[index]);
      }
 else {
        where.append(fieldNames[index]);
      }
      where.append("String_Node_Str");
      where.append(fieldValues[index]);
    }
    ps=conn.prepareStatement(String.format(updateClause,set.toString(),where.toString()));
    ps.execute();
  }
 catch (  SQLException ex) {
    Canary.logStacktrace(ex.getMessage(),ex);
  }
catch (  DatabaseTableInconsistencyException dbtiex) {
    Canary.logStacktrace(dbtiex.getMessage(),dbtiex);
  }
 finally {
    closePS(ps);
  }
}
Program: 86636
Project: 86636
Buggy source:
@Override public void updateSchema(DataAccess schemaTemplate) throws DatabaseWriteException {
  PreparedStatement ps=null;
  ResultSet rs=null;
  try {
    DatabaseMetaData metadata=conn.getMetaData();
    rs=metadata.getTables(null,null,schemaTemplate.getName(),null);
    if (!rs.next()) {
      createTable(schemaTemplate);
    }
 else {
      LinkedList<String> toRemove=new LinkedList<String>();
      HashMap<String,Column> toAdd=new HashMap<String,Column>();
      Iterator<Column> it=schemaTemplate.getTableLayout().iterator();
      Column column=null;
      while (it.hasNext()) {
        column=it.next();
        toAdd.put(column.columnName(),column);
      }
      for (      String col : getColumnNames(schemaTemplate)) {
        if (!toAdd.containsKey(col)) {
          toRemove.add(col);
        }
 else {
          toAdd.remove(col);
        }
      }
      for (      String name : toRemove) {
        deleteColumn(schemaTemplate.getName(),name);
      }
      for (      Map.Entry<String,Column> entry : toAdd.entrySet()) {
        insertColumn(schemaTemplate.getName(),entry.getValue());
      }
    }
  }
 catch (  SQLException sqle) {
    throw new DatabaseWriteException("String_Node_Str" + sqle.getMessage());
  }
catch (  DatabaseTableInconsistencyException dtie) {
    Canary.logStacktrace("String_Node_Str" + dtie.getMessage(),dtie);
  }
 finally {
    closeRS(rs);
    closePS(ps);
  }
}

Fixed version (ground truth):
@Override public void updateSchema(DataAccess schemaTemplate) throws DatabaseWriteException {
  PreparedStatement ps=null;
  ResultSet rs=null;
  try {
    DatabaseMetaData metadata=conn.getMetaData();
    rs=metadata.getTables(null,null,schemaTemplate.getName(),null);
    if (!rs.next()) {
      createTable(schemaTemplate);
    }
 else {
      LinkedList<String> toRemove=new LinkedList<String>();
      HashMap<String,Column> toAdd=new HashMap<String,Column>();
      Iterator<Column> it=schemaTemplate.getTableLayout().iterator();
      Column column;
      while (it.hasNext()) {
        column=it.next();
        toAdd.put(column.columnName(),column);
      }
      for (      String col : getColumnNames(schemaTemplate)) {
        if (!toAdd.containsKey(col)) {
          toRemove.add(col);
        }
 else {
          toAdd.remove(col);
        }
      }
      for (      String name : toRemove) {
        deleteColumn(schemaTemplate.getName(),name);
      }
      for (      Map.Entry<String,Column> entry : toAdd.entrySet()) {
        insertColumn(schemaTemplate.getName(),entry.getValue());
      }
    }
  }
 catch (  SQLException sqle) {
    throw new DatabaseWriteException("String_Node_Str" + sqle.getMessage());
  }
catch (  DatabaseTableInconsistencyException dtie) {
    Canary.logStacktrace("String_Node_Str" + dtie.getMessage(),dtie);
  }
 finally {
    closeRS(rs);
    closePS(ps);
  }
}
Program: 86637
Project: 86637
Buggy source:
public ResultSet getResultSet(Connection conn,String tableName,String[] fieldNames,Object[] fieldValues,boolean limitOne) throws DatabaseReadException {
  PreparedStatement ps=null;
  ResultSet toRet=null;
  try {
    if (fieldNames.length > 0) {
      StringBuilder sb=new StringBuilder();
      for (int i=0; i < fieldNames.length && i < fieldValues.length; i++) {
        sb.append("String_Node_Str").append(fieldNames[i]);
        if (i + 1 < fieldNames.length) {
          sb.append("String_Node_Str");
        }
 else {
          sb.append("String_Node_Str");
        }
      }
      if (limitOne) {
        sb.append("String_Node_Str");
      }
      ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str"+ sb.toString());
      for (int i=0; i < fieldNames.length && i < fieldValues.length; i++) {
        ps.setObject(i + 1,convert(fieldValues[i]));
      }
      toRet=ps.executeQuery();
    }
 else {
      if (limitOne) {
        ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str");
      }
 else {
        ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str");
      }
      toRet=ps.executeQuery();
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseReadException("String_Node_Str" + tableName);
  }
catch (  Exception ex) {
    Logger.getLogger(SQLiteDatabase.class.getName()).log(Level.SEVERE,null,ex);
  }
  return toRet;
}

Fixed version (ground truth):
public ResultSet getResultSet(Connection conn,String tableName,String[] fieldNames,Object[] fieldValues,boolean limitOne) throws DatabaseReadException {
  PreparedStatement ps;
  ResultSet toRet=null;
  try {
    if (fieldNames.length > 0) {
      StringBuilder sb=new StringBuilder();
      for (int i=0; i < fieldNames.length && i < fieldValues.length; i++) {
        sb.append("String_Node_Str").append(fieldNames[i]);
        if (i + 1 < fieldNames.length) {
          sb.append("String_Node_Str");
        }
 else {
          sb.append("String_Node_Str");
        }
      }
      if (limitOne) {
        sb.append("String_Node_Str");
      }
      ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str"+ sb.toString());
      for (int i=0; i < fieldNames.length && i < fieldValues.length; i++) {
        ps.setObject(i + 1,convert(fieldValues[i]));
      }
      toRet=ps.executeQuery();
    }
 else {
      if (limitOne) {
        ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str");
      }
 else {
        ps=conn.prepareStatement("String_Node_Str" + tableName + "String_Node_Str");
      }
      toRet=ps.executeQuery();
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseReadException("String_Node_Str" + tableName);
  }
catch (  Exception ex) {
    Logger.getLogger(SQLiteDatabase.class.getName()).log(Level.SEVERE,null,ex);
  }
  return toRet;
}
Program: 86638
Project: 86638
Buggy source:
public boolean doesEntryExist(DataAccess data) throws DatabaseWriteException {
  PreparedStatement ps=null;
  ResultSet rs=null;
  boolean toRet=false;
  try {
    StringBuilder sb=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    Column column=null;
    while (it.hasNext()) {
      column=it.next();
      if (!column.autoIncrement()) {
        if (sb.length() > 0) {
          sb.append("String_Node_Str").append(column.columnName());
        }
 else {
          sb.append("String_Node_Str").append(column.columnName());
        }
        sb.append("String_Node_Str");
      }
    }
    ps=conn.prepareStatement("String_Node_Str" + data.getName() + "String_Node_Str"+ sb.toString());
    it=columns.keySet().iterator();
    int index=1;
    while (it.hasNext()) {
      column=it.next();
      if (!column.autoIncrement()) {
        ps.setObject(index,convert(columns.get(column)));
        index++;
      }
    }
    rs=ps.executeQuery();
    if (rs != null) {
      toRet=rs.next();
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseWriteException(ex.getMessage() + "String_Node_Str" + data.toString());
  }
catch (  DatabaseTableInconsistencyException ex) {
    Logger.getLogger(SQLiteDatabase.class.getName()).log(Level.SEVERE,null,ex);
  }
 finally {
    closePS(ps);
    closeRS(rs);
  }
  return toRet;
}

Fixed version (ground truth):
public boolean doesEntryExist(DataAccess data) throws DatabaseWriteException {
  PreparedStatement ps=null;
  ResultSet rs=null;
  boolean toRet=false;
  try {
    StringBuilder sb=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    Column column;
    while (it.hasNext()) {
      column=it.next();
      if (!column.autoIncrement()) {
        if (sb.length() > 0) {
          sb.append("String_Node_Str").append(column.columnName());
        }
 else {
          sb.append("String_Node_Str").append(column.columnName());
        }
        sb.append("String_Node_Str");
      }
    }
    ps=conn.prepareStatement("String_Node_Str" + data.getName() + "String_Node_Str"+ sb.toString());
    it=columns.keySet().iterator();
    int index=1;
    while (it.hasNext()) {
      column=it.next();
      if (!column.autoIncrement()) {
        ps.setObject(index,convert(columns.get(column)));
        index++;
      }
    }
    rs=ps.executeQuery();
    if (rs != null) {
      toRet=rs.next();
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseWriteException(ex.getMessage() + "String_Node_Str" + data.toString());
  }
catch (  DatabaseTableInconsistencyException ex) {
    Logger.getLogger(SQLiteDatabase.class.getName()).log(Level.SEVERE,null,ex);
  }
 finally {
    closePS(ps);
    closeRS(rs);
  }
  return toRet;
}
Program: 86639
Project: 86639
Buggy source:
@Override public void insert(DataAccess data) throws DatabaseWriteException {
  File file=new File("String_Node_Str" + data.getName() + "String_Node_Str");
  if (!file.exists()) {
    try {
      file.createNewFile();
      initFile(file,data.getName());
    }
 catch (    IOException e) {
      throw new DatabaseWriteException(e.getMessage());
    }
  }
  Document dbTable=null;
  try {
    FileInputStream in=new FileInputStream(file);
    dbTable=fileBuilder.build(in);
    in.close();
    insertData(file,data,dbTable);
  }
 catch (  JDOMException e) {
    throw new DatabaseWriteException(e.getMessage(),e);
  }
catch (  IOException e) {
    throw new DatabaseWriteException(e.getMessage(),e);
  }
catch (  DatabaseTableInconsistencyException e) {
    throw new DatabaseWriteException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void insert(DataAccess data) throws DatabaseWriteException {
  File file=new File("String_Node_Str" + data.getName() + "String_Node_Str");
  if (!file.exists()) {
    try {
      file.createNewFile();
      initFile(file,data.getName());
    }
 catch (    IOException e) {
      throw new DatabaseWriteException(e.getMessage());
    }
  }
  Document dbTable;
  try {
    FileInputStream in=new FileInputStream(file);
    dbTable=fileBuilder.build(in);
    in.close();
    insertData(file,data,dbTable);
  }
 catch (  JDOMException e) {
    throw new DatabaseWriteException(e.getMessage(),e);
  }
catch (  IOException e) {
    throw new DatabaseWriteException(e.getMessage(),e);
  }
catch (  DatabaseTableInconsistencyException e) {
    throw new DatabaseWriteException(e.getMessage(),e);
  }
}
Program: 86640
Project: 86640
Buggy source:
/** 
 * Generates the next auto-increment ID for this table
 * @param doc
 * @param col
 * @return
 * @throws DatabaseTableInconsistencyException
 */
private int getIncrementId(Document doc,Column col) throws DatabaseTableInconsistencyException {
  int id=0;
  int index=doc.getRootElement().getChildren().size() - 1;
  if (index < 0) {
    return 1;
  }
  Element c=doc.getRootElement().getChildren().get(index);
  try {
    String num=c.getChildText(col.columnName());
    if (num != null) {
      id=Integer.valueOf(num);
      id++;
      return id;
    }
 else {
      return 1;
    }
  }
 catch (  NumberFormatException e) {
    throw new DatabaseTableInconsistencyException(col.columnName() + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Generates the next auto-increment ID for this table
 * @param doc
 * @param col
 * @return
 * @throws DatabaseTableInconsistencyException
 */
private int getIncrementId(Document doc,Column col) throws DatabaseTableInconsistencyException {
  int id;
  int index=doc.getRootElement().getChildren().size() - 1;
  if (index < 0) {
    return 1;
  }
  Element c=doc.getRootElement().getChildren().get(index);
  try {
    String num=c.getChildText(col.columnName());
    if (num != null) {
      id=Integer.valueOf(num);
      id++;
      return id;
    }
 else {
      return 1;
    }
  }
 catch (  NumberFormatException e) {
    throw new DatabaseTableInconsistencyException(col.columnName() + "String_Node_Str");
  }
}
Program: 86641
Project: 86641
Buggy source:
@Override public void log(LogRecord logRecord){
  logRecord.setMessage(new StringBuilder("String_Node_Str").append(name).append("String_Node_Str").append(TextFormat.consoleFormat(logRecord.getMessage())).toString());
  super.log(logRecord);
}

Fixed version (ground truth):
@Override public void log(LogRecord logRecord){
  logRecord.setMessage("String_Node_Str" + name + "String_Node_Str"+ TextFormat.consoleFormat(logRecord.getMessage()));
  super.log(logRecord);
}
Program: 86642
Project: 86642
Buggy source:
/** 
 * Get the Canary.inf from a jar file
 * @param filename
 * @param priorityBase The base for plugin priority which is used to calculate the priority of new Plugins
 * @return
 */
private final PropertiesFile scan(String filename,int priorityBase){
  PropertiesFile inf=null;
  try {
    File file=new File("String_Node_Str" + filename);
    String jarName=filename.substring(0,filename.lastIndexOf("String_Node_Str"));
    inf=new PropertiesFile(file.getAbsolutePath(),"String_Node_Str");
    if (!inf.containsKey("String_Node_Str")) {
      Canary.logSevere("String_Node_Str" + file.getName() + "String_Node_Str");
      return null;
    }
    inf.setString("String_Node_Str",jarName);
    inf.setString("String_Node_Str","String_Node_Str".concat(filename));
    if (!inf.containsKey("String_Node_Str")) {
      inf.setString("String_Node_Str",simpleMain(inf.getString("String_Node_Str")));
    }
    if (!pluginPriorities.containsKey(inf.getString("String_Node_Str"))) {
      pluginPriorities.setInt(inf.getString("String_Node_Str"),priorityBase * 10);
      pluginPriorities.save();
    }
 else     if (pluginPriorities.getInt(inf.getString("String_Node_Str")) < 0) {
      return null;
    }
  }
 catch (  Throwable ex) {
    Canary.logStacktrace("String_Node_Str" + filename + "String_Node_Str",ex);
    return null;
  }
  return inf;
}

Fixed version (ground truth):
/** 
 * Get the Canary.inf from a jar file
 * @param filename
 * @param priorityBase The base for plugin priority which is used to calculate the priority of new Plugins
 * @return
 */
private final PropertiesFile scan(String filename,int priorityBase){
  PropertiesFile inf;
  try {
    File file=new File("String_Node_Str" + filename);
    String jarName=filename.substring(0,filename.lastIndexOf("String_Node_Str"));
    inf=new PropertiesFile(file.getAbsolutePath(),"String_Node_Str");
    if (!inf.containsKey("String_Node_Str")) {
      Canary.logSevere("String_Node_Str" + file.getName() + "String_Node_Str");
      return null;
    }
    inf.setString("String_Node_Str",jarName);
    inf.setString("String_Node_Str","String_Node_Str".concat(filename));
    if (!inf.containsKey("String_Node_Str")) {
      inf.setString("String_Node_Str",simpleMain(inf.getString("String_Node_Str")));
    }
    if (!pluginPriorities.containsKey(inf.getString("String_Node_Str"))) {
      pluginPriorities.setInt(inf.getString("String_Node_Str"),priorityBase * 10);
      pluginPriorities.save();
    }
 else     if (pluginPriorities.getInt(inf.getString("String_Node_Str")) < 0) {
      return null;
    }
  }
 catch (  Throwable ex) {
    Canary.logStacktrace("String_Node_Str" + filename + "String_Node_Str",ex);
    return null;
  }
  return inf;
}
Program: 86643
Project: 86643
Buggy source:
/** 
 * Moves a plugins jar file to the disabled/ folder so it won't be loaded with the next server-start/restart
 * @param name
 * @return
 */
public final boolean moveToDisabled(String name){
  Plugin plugin=this.getPlugin(name);
  if (plugin == null) {
    return false;
  }
  ((CanaryClassLoader)plugin.getClass().getClassLoader()).close();
  plugin.markClosed();
  plugins.remove(name);
  pluginPriorities.setInt(name,-1);
  plugin=null;
  return true;
}

Fixed version (ground truth):
/** 
 * Moves a plugins jar file to the disabled/ folder so it won't be loaded with the next server-start/restart
 * @param name
 * @return
 */
public final boolean moveToDisabled(String name){
  Plugin plugin=this.getPlugin(name);
  if (plugin == null) {
    return false;
  }
  ((CanaryClassLoader)plugin.getClass().getClassLoader()).close();
  plugin.markClosed();
  plugins.remove(name);
  pluginPriorities.setInt(name,-1);
  return true;
}
Program: 86644
Project: 86644
Buggy source:
/** 
 * Return home for a player with this name
 * @param player
 * @return
 */
public Warp getHome(String player){
  for (  Warp g : warps) {
    if (g.isPlayerHome()) {
      if (g.getOwner().equals(player) && g.isPlayerHome()) {
        return g;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return home for a player with this name
 * @param player
 * @return
 */
public Warp getHome(String player){
  for (  Warp g : warps) {
    if (g.isPlayerHome()) {
      if (g.getOwner().equals(player)) {
        return g;
      }
    }
  }
  return null;
}
Program: 86645
Project: 86645
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object obj){
  if (obj == this) {
    return true;
  }
  if (obj instanceof PlayerListEntry) {
    PlayerListEntry other=(PlayerListEntry)obj;
    if (!other.getName().equals(this.name)) {
      return false;
    }
    if (other.getPing() != this.ping) {
      return false;
    }
    if (other.isShown() != this.shown) {
      return false;
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object obj){
  if (obj == this) {
    return true;
  }
  if (obj instanceof PlayerListEntry) {
    PlayerListEntry other=(PlayerListEntry)obj;
    if (!other.getName().equals(this.name)) {
      return false;
    }
    if (other.getPing() != this.ping) {
      return false;
    }
    return other.isShown() == this.shown;
  }
  return false;
}