nus-yam/ex-repair huggingface dataset:
Program: 49743
Project: 49743
Buggy source:
@Test public void test4(){
  String fen="String_Node_Str";
  Board board=new Board();
  board.setFen(fen);
  System.out.print(board);
  int move=Move.getFromString(board,"String_Node_Str",true);
  int value=board.see(Move.getFromIndex(move),Move.getToIndex(move),Move.getPieceMoved(move),Move.PAWN);
  System.out.println("String_Node_Str" + value);
  assertTrue(value == -225);
}

Fixed version (ground truth):
@Test public void test4(){
  testSee("String_Node_Str","String_Node_Str",-225);
}
Program: 49744
Project: 49744
Buggy source:
@Test public void testNoOtherPiecesAttack(){
  String fen="String_Node_Str";
  Board board=new Board();
  board.setFen(fen);
  System.out.print(board);
  int move=Move.getFromString(board,"String_Node_Str",true);
  System.out.println(Move.getFromIndex(move));
  int value=board.see(Move.getFromIndex(move),Move.getToIndex(move),Move.getPieceMoved(move),Move.PAWN);
  System.out.println("String_Node_Str" + value);
  assertTrue(value == 100);
}

Fixed version (ground truth):
@Test public void testNoOtherPiecesAttack(){
  testSee("String_Node_Str","String_Node_Str",100);
}
Program: 49745
Project: 49745
Buggy source:
@Test public void test2(){
  String fen="String_Node_Str";
  Board board=new Board();
  board.setFen(fen);
  System.out.print(board);
  int move=Move.getFromString(board,"String_Node_Str",true);
  int value=board.see(Move.getFromIndex(move),Move.getToIndex(move),Move.getPieceMoved(move),Move.ROOK);
  System.out.println("String_Node_Str" + value);
  assertTrue(value == 0);
}

Fixed version (ground truth):
@Test public void test2(){
  testSee("String_Node_Str","String_Node_Str",0);
}
Program: 49746
Project: 49746
Buggy source:
@Test public void test3(){
  String fen="String_Node_Str";
  Board board=new Board();
  board.setFen(fen);
  System.out.print(board);
  int move=Move.getFromString(board,"String_Node_Str",true);
  int value=board.see(Move.getFromIndex(move),Move.getToIndex(move),Move.getPieceMoved(move),Move.ROOK);
  System.out.println("String_Node_Str" + value);
  assertTrue(value == 330);
}

Fixed version (ground truth):
@Test public void test3(){
  testSee("String_Node_Str","String_Node_Str",330);
}
Program: 49747
Project: 49747
Buggy source:
@Test public void test1(){
  String fen="String_Node_Str";
  Board board=new Board();
  board.setFen(fen);
  System.out.print(board);
  int move=Move.getFromString(board,"String_Node_Str",true);
  System.out.println("String_Node_Str" + Move.toStringExt(move));
  int value=board.see(Move.getFromIndex(move),Move.getToIndex(move),Move.getPieceMoved(move),Move.PAWN);
  System.out.println("String_Node_Str" + value);
  assertTrue(value == 100);
}

Fixed version (ground truth):
@Test public void test1(){
  testSee("String_Node_Str","String_Node_Str",100);
}
Program: 49748
Project: 49748
Buggy source:
public int see(int fromIndex,int toIndex,int pieceMoved,int targetPiece){
  int d=0;
  long mayXray=pawns | bishops | rooks| queens;
  long fromSquare=1 << fromIndex;
  long all=getAll();
  long attacks=bbAttacks.getIndexAttacks(this,toIndex);
  long fromCandidates;
  seeGain[d]=SEE_PIECE_VALUES[targetPiece];
  do {
    long side=(d & 1) == 0 ? getOthers() : getMines();
    d++;
    seeGain[d]=SEE_PIECE_VALUES[pieceMoved] - seeGain[d - 1];
    attacks^=fromSquare;
    all^=fromSquare;
    if ((fromSquare & mayXray) != 0) {
      attacks|=bbAttacks.getXrayAttacks(this,toIndex,all);
    }
    if ((fromCandidates=attacks & pawns & side) != 0) {
      pieceMoved=Move.PAWN;
    }
 else     if ((fromCandidates=attacks & knights & side) != 0) {
      pieceMoved=Move.KNIGHT;
    }
 else     if ((fromCandidates=attacks & bishops & side) != 0) {
      pieceMoved=Move.BISHOP;
    }
 else     if ((fromCandidates=attacks & rooks & side) != 0) {
      pieceMoved=Move.ROOK;
    }
 else     if ((fromCandidates=attacks & queens & side) != 0) {
      pieceMoved=Move.QUEEN;
    }
 else     if ((fromCandidates=attacks & kings & side) != 0) {
      pieceMoved=Move.KING;
    }
    fromSquare=BitboardUtils.lsb(fromCandidates);
  }
 while (fromSquare != 0);
  while (--d != 0) {
    seeGain[d - 1]=-Math.max(-seeGain[d - 1],seeGain[d]);
  }
  return seeGain[0];
}

Fixed version (ground truth):
/** 
 * The SWAP algorithm https://chessprogramming.wikispaces.com/SEE+-+The+Swap+Algorithm
 */
public int see(int fromIndex,int toIndex,int pieceMoved,int targetPiece){
  int d=0;
  long mayXray=pawns | bishops | rooks| queens;
  long fromSquare=0x1L << fromIndex;
  long all=getAll();
  long attacks=bbAttacks.getIndexAttacks(this,toIndex);
  long fromCandidates;
  seeGain[d]=SEE_PIECE_VALUES[targetPiece];
  do {
    long side=(d & 1) == 0 ? getOthers() : getMines();
    d++;
    seeGain[d]=SEE_PIECE_VALUES[pieceMoved] - seeGain[d - 1];
    if (Math.max(-seeGain[d - 1],seeGain[d]) < 0) {
      break;
    }
    attacks^=fromSquare;
    all^=fromSquare;
    if ((fromSquare & mayXray) != 0) {
      attacks|=bbAttacks.getXrayAttacks(this,toIndex,all);
    }
    if ((fromCandidates=attacks & pawns & side) != 0) {
      pieceMoved=Move.PAWN;
    }
 else     if ((fromCandidates=attacks & knights & side) != 0) {
      pieceMoved=Move.KNIGHT;
    }
 else     if ((fromCandidates=attacks & bishops & side) != 0) {
      pieceMoved=Move.BISHOP;
    }
 else     if ((fromCandidates=attacks & rooks & side) != 0) {
      pieceMoved=Move.ROOK;
    }
 else     if ((fromCandidates=attacks & queens & side) != 0) {
      pieceMoved=Move.QUEEN;
    }
 else     if ((fromCandidates=attacks & kings & side) != 0) {
      pieceMoved=Move.KING;
    }
    fromSquare=BitboardUtils.lsb(fromCandidates);
  }
 while (fromSquare != 0);
  while (--d != 0) {
    seeGain[d - 1]=-Math.max(-seeGain[d - 1],seeGain[d]);
  }
  return seeGain[0];
}
Program: 49749
Project: 49749
Buggy source:
/** 
 * The SWAP algorithm https://chessprogramming.wikispaces.com/SEE+-+The+Swap+Algorithm
 */
public int see(int fromIndex,int toIndex,int pieceMoved,int targetPiece){
  int d=0;
  long mayXray=pawns | bishops | rooks| queens;
  long fromSquare=1 << fromIndex;
  long all=getAll();
  long attacks=bbAttacks.getIndexAttacks(this,toIndex);
  long fromCandidates;
  seeGain[d]=SEE_PIECE_VALUES[targetPiece];
  do {
    long side=(d & 1) == 0 ? getOthers() : getMines();
    d++;
    seeGain[d]=SEE_PIECE_VALUES[pieceMoved] - seeGain[d - 1];
    attacks^=fromSquare;
    all^=fromSquare;
    if ((fromSquare & mayXray) != 0) {
      attacks|=bbAttacks.getXrayAttacks(this,toIndex,all);
    }
    if ((fromCandidates=attacks & pawns & side) != 0) {
      pieceMoved=Move.PAWN;
    }
 else     if ((fromCandidates=attacks & knights & side) != 0) {
      pieceMoved=Move.KNIGHT;
    }
 else     if ((fromCandidates=attacks & bishops & side) != 0) {
      pieceMoved=Move.BISHOP;
    }
 else     if ((fromCandidates=attacks & rooks & side) != 0) {
      pieceMoved=Move.ROOK;
    }
 else     if ((fromCandidates=attacks & queens & side) != 0) {
      pieceMoved=Move.QUEEN;
    }
 else     if ((fromCandidates=attacks & kings & side) != 0) {
      pieceMoved=Move.KING;
    }
    fromSquare=BitboardUtils.lsb(fromCandidates);
  }
 while (fromSquare != 0);
  while (--d != 0) {
    seeGain[d - 1]=-Math.max(-seeGain[d - 1],seeGain[d]);
  }
  return seeGain[0];
}

Fixed version (ground truth):
/** 
 * The SWAP algorithm https://chessprogramming.wikispaces.com/SEE+-+The+Swap+Algorithm
 */
public int see(int fromIndex,int toIndex,int pieceMoved,int targetPiece){
  int d=0;
  long mayXray=pawns | bishops | rooks| queens;
  long fromSquare=0x1L << fromIndex;
  long all=getAll();
  long attacks=bbAttacks.getIndexAttacks(this,toIndex);
  long fromCandidates;
  seeGain[d]=SEE_PIECE_VALUES[targetPiece];
  do {
    long side=(d & 1) == 0 ? getOthers() : getMines();
    d++;
    seeGain[d]=SEE_PIECE_VALUES[pieceMoved] - seeGain[d - 1];
    if (Math.max(-seeGain[d - 1],seeGain[d]) < 0)     break;
    attacks^=fromSquare;
    all^=fromSquare;
    if ((fromSquare & mayXray) != 0) {
      attacks|=bbAttacks.getXrayAttacks(this,toIndex,all);
    }
    if ((fromCandidates=attacks & pawns & side) != 0) {
      pieceMoved=Move.PAWN;
    }
 else     if ((fromCandidates=attacks & knights & side) != 0) {
      pieceMoved=Move.KNIGHT;
    }
 else     if ((fromCandidates=attacks & bishops & side) != 0) {
      pieceMoved=Move.BISHOP;
    }
 else     if ((fromCandidates=attacks & rooks & side) != 0) {
      pieceMoved=Move.ROOK;
    }
 else     if ((fromCandidates=attacks & queens & side) != 0) {
      pieceMoved=Move.QUEEN;
    }
 else     if ((fromCandidates=attacks & kings & side) != 0) {
      pieceMoved=Move.KING;
    }
    fromSquare=BitboardUtils.lsb(fromCandidates);
  }
 while (fromSquare != 0);
  while (--d != 0) {
    seeGain[d - 1]=-Math.max(-seeGain[d - 1],seeGain[d]);
  }
  return seeGain[0];
}
Program: 49750
Project: 49750
Buggy source:
/** 
 * in UCI format TODO complete
 */
public String toString(){
  StringBuilder sb=new StringBuilder();
  if (depth != 0) {
    sb.append("String_Node_Str");
    sb.append(depth);
  }
  if (selDepth != 0) {
    sb.append("String_Node_Str");
    sb.append(selDepth);
  }
  if (scoreMate != null) {
    sb.append("String_Node_Str");
    sb.append(scoreMate);
  }
 else   if (scoreCp != null) {
    sb.append("String_Node_Str");
    sb.append(scoreCp);
    if (lowerBound) {
      sb.append("String_Node_Str");
    }
 else     if (upperBound) {
      sb.append("String_Node_Str");
    }
  }
  if (nodes != 0) {
    sb.append("String_Node_Str");
    sb.append(nodes);
  }
  if (time != 0) {
    sb.append("String_Node_Str");
    sb.append(time);
  }
  if (hashFull != 0) {
    sb.append("String_Node_Str");
    sb.append(hashFull);
  }
  if (nps != 0) {
    sb.append("String_Node_Str");
    sb.append(nps);
  }
  if (pv != null) {
    sb.append("String_Node_Str");
    sb.append(pv);
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * in UCI format TODO complete
 */
public String toString(){
  StringBuilder sb=new StringBuilder();
  if (depth != 0) {
    sb.append("String_Node_Str");
    sb.append(depth);
  }
  if (selDepth != 0) {
    sb.append("String_Node_Str");
    sb.append(selDepth);
  }
  if ((score < -SearchEngine.VALUE_IS_MATE) || (score > SearchEngine.VALUE_IS_MATE)) {
    sb.append("String_Node_Str");
    int x=(score < 0 ? -Evaluator.VICTORY : Evaluator.VICTORY) - score;
    if ((x & 1) != 0) {
      sb.append((x >> 1) + 1);
    }
 else {
      sb.append(x >> 1);
    }
  }
 else {
    sb.append("String_Node_Str");
    sb.append(score);
  }
  if (lowerBound) {
    sb.append("String_Node_Str");
  }
 else   if (upperBound) {
    sb.append("String_Node_Str");
  }
  if (nodes != 0) {
    sb.append("String_Node_Str");
    sb.append(nodes);
  }
  if (time != 0) {
    sb.append("String_Node_Str");
    sb.append(time);
  }
  if (hashFull != 0) {
    sb.append("String_Node_Str");
    sb.append(hashFull);
  }
  if (nps != 0) {
    sb.append("String_Node_Str");
    sb.append(nps);
  }
  if (pv != null) {
    sb.append("String_Node_Str");
    sb.append(pv);
  }
  return sb.toString();
}
Program: 49751
Project: 49751
Buggy source:
public void setScore(int score,int alpha,int beta){
  if ((score < -SearchEngine.VALUE_IS_MATE) || (score > SearchEngine.VALUE_IS_MATE)) {
    int x=(score < 0 ? -Evaluator.VICTORY : Evaluator.VICTORY) - score;
    if ((x & 1) != 0) {
      scoreMate=(x >> 1) + 1;
    }
 else {
      scoreMate=x >> 1;
    }
  }
 else {
    scoreCp=score;
  }
  upperBound=score <= alpha;
  lowerBound=score >= beta;
}

Fixed version (ground truth):
public void setScore(int score,int alpha,int beta){
  this.score=score;
  upperBound=score <= alpha;
  lowerBound=score >= beta;
}
Program: 49753
Project: 49753
Buggy source:
public void newRun() throws SearchFinishedException {
  startTime=System.currentTimeMillis();
  foundOneMove=false;
  searching=true;
  logger.debug("String_Node_Str" + board);
  positionCounter=0;
  pvPositionCounter=0;
  qsPositionCounter=0;
  bestMoveTime=0;
  globalBestMove=0;
  ponderMove=0;
  pv=null;
  initialPly=board.getMoveNumber();
  thinkToTime=Long.MAX_VALUE;
  thinkToNodes=Long.MAX_VALUE;
  thinkToDepth=Long.MAX_VALUE;
  long moveTime=searchParameters.calculateMoveTime(board);
  if (moveTime > 0) {
    thinkToTime=startTime + moveTime;
  }
  if (searchParameters.getNodes() > 0) {
    thinkToNodes=searchParameters.getNodes();
  }
  if (searchParameters.getDepth() > 0) {
    thinkToDepth=searchParameters.getDepth();
  }
  if (config.getUseBook() && config.getBook() != null && board.isUsingBook() && (config.getBookKnowledge() == 100 || ((random.nextFloat() * 100) < config.getBookKnowledge()))) {
    logger.debug("String_Node_Str");
    int bookMove=config.getBook().getMove(board);
    if (bookMove != 0) {
      globalBestMove=bookMove;
      logger.debug("String_Node_Str");
      throw new SearchFinishedException();
    }
 else {
      logger.debug("String_Node_Str");
      board.setOutBookMove(board.getMoveNumber());
    }
  }
  depth=1;
  score=eval(false,false);
  tt.newGeneration();
  aspWindows=config.getAspirationWindowSizes();
}

Fixed version (ground truth):
public void newRun() throws SearchFinishedException {
  startTime=System.currentTimeMillis();
  foundOneMove=false;
  searching=true;
  logger.debug("String_Node_Str" + board);
  positionCounter=0;
  pvPositionCounter=0;
  qsPositionCounter=0;
  bestMoveTime=0;
  globalBestMove=0;
  ponderMove=0;
  pv=null;
  initialPly=board.getMoveNumber();
  thinkToTime=Long.MAX_VALUE;
  thinkToNodes=Long.MAX_VALUE;
  thinkToDepth=Long.MAX_VALUE;
  boolean searchLimitSet=false;
  if (searchParameters.getNodes() > 0) {
    thinkToNodes=searchParameters.getNodes();
    searchLimitSet=true;
  }
  if (searchParameters.getDepth() > 0) {
    thinkToDepth=searchParameters.getDepth();
    searchLimitSet=true;
  }
  long moveTime=searchParameters.calculateMoveTime(board);
  if (moveTime > 0 || !searchLimitSet) {
    thinkToTime=startTime + moveTime;
  }
  if (config.getUseBook() && config.getBook() != null && board.isUsingBook() && (config.getBookKnowledge() == 100 || ((random.nextFloat() * 100) < config.getBookKnowledge()))) {
    logger.debug("String_Node_Str");
    int bookMove=config.getBook().getMove(board);
    if (bookMove != 0) {
      globalBestMove=bookMove;
      logger.debug("String_Node_Str");
      throw new SearchFinishedException();
    }
 else {
      logger.debug("String_Node_Str");
      board.setOutBookMove(board.getMoveNumber());
    }
  }
  depth=1;
  score=eval(false,false);
  tt.newGeneration();
  aspWindows=config.getAspirationWindowSizes();
}
Program: 49757
Project: 49757
Buggy source:
public void connect(Selector selector,SocketAddress remoteAddress,int timeout) throws IOException {
  close();
  writeBuffer.clear();
  readBuffer.clear();
  readBuffer.flip();
  currentObjectLength=0;
  try {
    SocketChannel socketChannel=selector.provider().openSocketChannel();
    Socket socket=socketChannel.socket();
    socket.setTcpNoDelay(true);
    socket.setTrafficClass(IPTOS_LOWDELAY);
    socket.connect(remoteAddress,timeout);
    socketChannel.configureBlocking(false);
    this.socketChannel=socketChannel;
    selectionKey=socketChannel.register(selector,SelectionKey.OP_READ);
    selectionKey.attach(this);
    if (DEBUG) {
      debug("String_Node_Str","String_Node_Str" + socketChannel.socket().getLocalPort() + "String_Node_Str"+ socketChannel.socket().getRemoteSocketAddress());
    }
    lastReadTime=lastWriteTime=System.currentTimeMillis();
  }
 catch (  IOException ex) {
    close();
    IOException ioEx=new IOException("String_Node_Str" + remoteAddress);
    ioEx.initCause(ex);
    throw ioEx;
  }
}

Fixed version (ground truth):
public void connect(Selector selector,SocketAddress remoteAddress,int timeout) throws IOException {
  close();
  writeBuffer.clear();
  readBuffer.clear();
  readBuffer.flip();
  currentObjectLength=0;
  try {
    SocketChannel socketChannel=selector.provider().openSocketChannel();
    Socket socket=socketChannel.socket();
    socket.setTcpNoDelay(true);
    socket.connect(remoteAddress,timeout);
    socketChannel.configureBlocking(false);
    this.socketChannel=socketChannel;
    selectionKey=socketChannel.register(selector,SelectionKey.OP_READ);
    selectionKey.attach(this);
    if (DEBUG) {
      debug("String_Node_Str","String_Node_Str" + socketChannel.socket().getLocalPort() + "String_Node_Str"+ socketChannel.socket().getRemoteSocketAddress());
    }
    lastReadTime=lastWriteTime=System.currentTimeMillis();
  }
 catch (  IOException ex) {
    close();
    IOException ioEx=new IOException("String_Node_Str" + remoteAddress);
    ioEx.initCause(ex);
    throw ioEx;
  }
}
Program: 49760
Project: 49760
Buggy source:
public ChatRmiClient(){
  client=new Client();
  client.start();
  Network.register(client);
  player=ObjectSpace.getRemoteObject(client,Network.PLAYER,IPlayer.class);
  client.addListener(new Listener(){
    public void disconnected(    Connection connection){
      EventQueue.invokeLater(new Runnable(){
        public void run(){
          chatFrame.dispose();
        }
      }
);
    }
  }
);
  String input=(String)JOptionPane.showInputDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.QUESTION_MESSAGE,null,null,"String_Node_Str");
  if (input == null || input.trim().length() == 0)   System.exit(1);
  final String host=input.trim();
  input=(String)JOptionPane.showInputDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.QUESTION_MESSAGE,null,null,"String_Node_Str");
  if (input == null || input.trim().length() == 0)   System.exit(1);
  final String name=input.trim();
  chatFrame=new ChatFrame(host);
  new ObjectSpace(client).register(Network.CHAT_FRAME,chatFrame);
  chatFrame.setSendListener(new Runnable(){
    public void run(){
      player.sendMessage(chatFrame.getSendText());
    }
  }
);
  chatFrame.setCloseListener(new Runnable(){
    public void run(){
      client.stop();
    }
  }
);
  chatFrame.setVisible(true);
  new Thread("String_Node_Str"){
    public void run(){
      try {
        client.connect(5000,host,Network.port);
      }
 catch (      IOException ex) {
        ex.printStackTrace();
        System.exit(1);
      }
      player.registerName(name);
    }
  }
.start();
}

Fixed version (ground truth):
public ChatRmiClient(){
  client=new Client();
  client.start();
  Network.register(client);
  player=ObjectSpace.getRemoteObject(client,Network.PLAYER,IPlayer.class);
  client.addListener(new Listener(){
    public void disconnected(    Connection connection){
      EventQueue.invokeLater(new Runnable(){
        public void run(){
          chatFrame.dispose();
        }
      }
);
    }
  }
);
  String input=(String)JOptionPane.showInputDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.QUESTION_MESSAGE,null,null,"String_Node_Str");
  if (input == null || input.trim().length() == 0)   System.exit(1);
  final String host=input.trim();
  input=(String)JOptionPane.showInputDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.QUESTION_MESSAGE,null,null,"String_Node_Str");
  if (input == null || input.trim().length() == 0)   System.exit(1);
  final String name=input.trim();
  chatFrame=new ChatFrame(host);
  new ObjectSpace(client).register(Network.CHAT_FRAME,chatFrame);
  chatFrame.setSendListener(new Runnable(){
    public void run(){
      player.sendMessage(chatFrame.getSendText());
    }
  }
);
  chatFrame.setCloseListener(new Runnable(){
    public void run(){
      client.stop();
    }
  }
);
  chatFrame.setVisible(true);
  new Thread("String_Node_Str"){
    public void run(){
      try {
        client.connect(5000,host,Network.port);
        player.registerName(name);
      }
 catch (      IOException ex) {
        ex.printStackTrace();
        System.exit(1);
      }
    }
  }
.start();
}
Program: 49761
Project: 49761
Buggy source:
public void queue(Runnable runnable){
synchronized (runnables) {
    runnables.addFirst(runnable);
  }
  int lag=lagMillisMax + (int)(Math.random() * (lagMillisMax - lagMillisMin));
  threadPool.schedule(new Runnable(){
    public void run(){
      Runnable runnable;
synchronized (runnables) {
        runnable=runnables.removeLast();
      }
      runnable.run();
    }
  }
,lag,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
public void queue(Runnable runnable){
synchronized (runnables) {
    runnables.addFirst(runnable);
  }
  int lag=lagMillisMin + (int)(Math.random() * (lagMillisMax - lagMillisMin));
  threadPool.schedule(new Runnable(){
    public void run(){
      Runnable runnable;
synchronized (runnables) {
        runnable=runnables.removeLast();
      }
      runnable.run();
    }
  }
,lag,TimeUnit.MILLISECONDS);
}
Program: 49763
Project: 49763
Buggy source:
public void connect(Selector selector,SocketAddress remoteAddress,int timeout) throws IOException {
  close();
  try {
    SocketChannel socketChannel=selector.provider().openSocketChannel();
    Socket socket=socketChannel.socket();
    socket.setTcpNoDelay(true);
    socket.setTrafficClass(IPTOS_LOWDELAY);
    socket.connect(remoteAddress,timeout);
    socketChannel.configureBlocking(false);
    this.socketChannel=socketChannel;
    selectionKey=socketChannel.register(selector,SelectionKey.OP_READ);
    selectionKey.attach(this);
    if (DEBUG) {
      debug("String_Node_Str","String_Node_Str" + socketChannel.socket().getLocalPort() + "String_Node_Str"+ socketChannel.socket().getRemoteSocketAddress());
    }
    if (keepAliveTime > 0)     lastCommunicationTime=System.currentTimeMillis();
  }
 catch (  IOException ex) {
    close();
    IOException ioEx=new IOException("String_Node_Str" + remoteAddress);
    ioEx.initCause(ex);
    throw ioEx;
  }
}

Fixed version (ground truth):
public void connect(Selector selector,SocketAddress remoteAddress,int timeout) throws IOException {
  close();
  writeBuffer.clear();
  readBuffer.clear();
  readBuffer.flip();
  try {
    SocketChannel socketChannel=selector.provider().openSocketChannel();
    Socket socket=socketChannel.socket();
    socket.setTcpNoDelay(true);
    socket.setTrafficClass(IPTOS_LOWDELAY);
    socket.connect(remoteAddress,timeout);
    socketChannel.configureBlocking(false);
    this.socketChannel=socketChannel;
    selectionKey=socketChannel.register(selector,SelectionKey.OP_READ);
    selectionKey.attach(this);
    if (DEBUG) {
      debug("String_Node_Str","String_Node_Str" + socketChannel.socket().getLocalPort() + "String_Node_Str"+ socketChannel.socket().getRemoteSocketAddress());
    }
    if (keepAliveTime > 0)     lastCommunicationTime=System.currentTimeMillis();
  }
 catch (  IOException ex) {
    close();
    IOException ioEx=new IOException("String_Node_Str" + remoteAddress);
    ioEx.initCause(ex);
    throw ioEx;
  }
}
Program: 49766
Project: 49766
Buggy source:
/** 
 * Creates new form GeneralPanel
 */
public GeneralPanel(){
  initComponents();
  QuickOpenerProperty customSeparator=PrefsUtil.load(null,"String_Node_Str",getOSSeparator());
  jLabel2.setText(customSeparator.getValue());
  QuickOpenerProperty customShell=PrefsUtil.load(null,"String_Node_Str",null);
  cShellLabel.setText((customShell.getValue() == null) ? "String_Node_Str" : customShell.getValue());
  QuickOpenerProperty customFileManager=PrefsUtil.load(null,"String_Node_Str",null);
  cFileManagerLabel.setText(customFileManager.getValue() == null ? "String_Node_Str" : customFileManager.getValue());
  QuickOpenerProperty confirmation=PrefsUtil.load(null,"String_Node_Str","String_Node_Str");
  boolean isConfirmSelected=Boolean.parseBoolean(confirmation.getValue());
  confirmationCheckBox.setSelected(isConfirmSelected);
  shellConfigureButton.setEnabled(!getAvailableConfigurators().isEmpty());
}

Fixed version (ground truth):
/** 
 * Creates new form GeneralPanel
 */
public GeneralPanel(){
  initComponents();
  QuickOpenerProperty customSeparator=PrefsUtil.load(null,"String_Node_Str",getOSSeparator());
  jLabel2.setText(customSeparator.getValue());
  QuickOpenerProperty customShell=PrefsUtil.load(null,"String_Node_Str",null);
  cShellLabel.setText((customShell.getValue() == null) ? "String_Node_Str" : customShell.getValue());
  QuickOpenerProperty customFileManager=PrefsUtil.load(null,"String_Node_Str",null);
  cFileManagerLabel.setText(customFileManager.getValue() == null ? "String_Node_Str" : customFileManager.getValue());
  QuickOpenerProperty confirmation=PrefsUtil.load(null,"String_Node_Str","String_Node_Str");
  boolean isConfirmSelected=Boolean.parseBoolean(confirmation.getValue());
  confirmationCheckBox.setSelected(isConfirmSelected);
  shellConfigureButton.setEnabled(!getAvailableConfigurators().isEmpty());
  fileManagerConfigureButton.setEnabled(!getAvailableFileManagerConfigurators().isEmpty());
}
Program: 49767
Project: 49767
Buggy source:
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
    String path=(String)jTable2.getModel().getValueAt(row,1);
    cmdTextField.setText(path);
  }
}

Fixed version (ground truth):
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    if (-1 != thisrow) {
      final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
      String path=(String)jTable2.getModel().getValueAt(row,1);
      cmdTextField.setText(path);
    }
  }
}
Program: 49768
Project: 49768
Buggy source:
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
    String path=(String)jTable2.getModel().getValueAt(row,1);
    cmdTextField.setText(path);
  }
}

Fixed version (ground truth):
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    if (-1 != thisrow) {
      final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
      String path=(String)jTable2.getModel().getValueAt(row,1);
      cmdTextField.setText(path);
    }
  }
}
Program: 49769
Project: 49769
Buggy source:
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
    String path=(String)jTable2.getModel().getValueAt(row,1);
    cmdTextField.setText(path);
  }
}

Fixed version (ground truth):
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    if (-1 != thisrow) {
      final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
      String path=(String)jTable2.getModel().getValueAt(row,1);
      cmdTextField.setText(path);
    }
  }
}
Program: 49770
Project: 49770
Buggy source:
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
    String path=(String)jTable2.getModel().getValueAt(row,1);
    cmdTextField.setText(path);
  }
}

Fixed version (ground truth):
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    if (-1 != thisrow) {
      final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
      String path=(String)jTable2.getModel().getValueAt(row,1);
      cmdTextField.setText(path);
    }
  }
}
Program: 49771
Project: 49771
Buggy source:
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
    String description=(String)jTable2.getModel().getValueAt(row,0);
    String command=(String)jTable2.getModel().getValueAt(row,1);
    cmddescription.setText(description);
    cmdvalue.setText(command);
  }
}

Fixed version (ground truth):
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    if (-1 != thisrow) {
      final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
      String description=(String)jTable2.getModel().getValueAt(row,0);
      String command=(String)jTable2.getModel().getValueAt(row,1);
      cmddescription.setText(description);
      cmdvalue.setText(command);
    }
  }
}
Program: 49772
Project: 49772
Buggy source:
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
    String desc=(String)jTable2.getModel().getValueAt(row,0);
    String path=(String)jTable2.getModel().getValueAt(row,1);
    folderDescriptionTextField.setText(desc);
    favoritePathTextField.setText(path);
  }
}

Fixed version (ground truth):
private void jTable2MouseClicked(java.awt.event.MouseEvent evt){
  if (evt.getClickCount() == 1) {
    final int thisrow=jTable2.getSelectedRow();
    if (-1 != thisrow) {
      final int row=jTable2.getRowSorter().convertRowIndexToModel(thisrow);
      String desc=(String)jTable2.getModel().getValueAt(row,0);
      String path=(String)jTable2.getModel().getValueAt(row,1);
      folderDescriptionTextField.setText(desc);
      favoritePathTextField.setText(path);
    }
  }
}
Program: 49773
Project: 49773
Buggy source:
public Class getColumnClass(int c){
  return String.class;
}

Fixed version (ground truth):
@Override public Class getColumnClass(int c){
  return String.class;
}
Program: 49774
Project: 49774
Buggy source:
public PropertyTableModel(String prefix){
  try {
    List<QuickOpenerProperty> prefs=PrefsUtil.getAllMatching(prefix);
    this.data=new Object[prefs.size()][2];
    for (int i=0; i < prefs.size(); i++) {
      QuickOpenerProperty pref=prefs.get(i);
      this.data[i]=new String[]{pref.getDescription(),pref.getValue()};
    }
  }
 catch (  BackingStoreException ex) {
    Exceptions.printStackTrace(ex);
  }
}

Fixed version (ground truth):
public PropertyTableModel(String prefix){
  setColumnNames(prefix);
  try {
    List<QuickOpenerProperty> prefs=PrefsUtil.getAllMatching(prefix);
    this.data=new Object[prefs.size()][2];
    for (int i=0; i < prefs.size(); i++) {
      QuickOpenerProperty pref=prefs.get(i);
      this.data[i]=new String[]{pref.getDescription(),pref.getValue()};
    }
  }
 catch (  BackingStoreException ex) {
    Exceptions.printStackTrace(ex);
  }
}
Program: 49775
Project: 49775
Buggy source:
public static String getFileFromSelectedNode(boolean isFolder){
  TopComponent topActive=TopComponent.getRegistry().getActivated();
  Node[] nodes=topActive.getActivatedNodes();
  if (nodes.length == 1) {
    DataObject dataObj=nodes[0].getLookup().lookup(DataObject.class);
    return (dataObj != null) ? getPathFromDataObject(dataObj,isFolder) : null;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public static String getFileFromSelectedNode(boolean isFolder){
  try {
    TopComponent topActive=TopComponent.getRegistry().getActivated();
    Node[] nodes=topActive.getActivatedNodes();
    if (nodes.length == 1) {
      DataObject dataObj=nodes[0].getLookup().lookup(DataObject.class);
      return (dataObj != null) ? getPathFromDataObject(dataObj,isFolder) : null;
    }
 else {
      return null;
    }
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 49776
Project: 49776
Buggy source:
public static File getFileFromDataObject(DataObject dataObj,boolean isFolder){
  File current=FileUtil.toFile(dataObj.getPrimaryFile());
  if (!isFolder) {
    return current;
  }
 else {
    return (current.isDirectory()) ? current : current.getParentFile();
  }
}

Fixed version (ground truth):
public static File getFileFromDataObject(DataObject dataObj,boolean isFolder){
  try {
    File current=FileUtil.toFile(dataObj.getPrimaryFile());
    if (!isFolder) {
      return current;
    }
 else {
      return (current.isDirectory()) ? current : current.getParentFile();
    }
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 49777
Project: 49777
Buggy source:
public static String getPathFromDataObject(DataObject dataObj,boolean isFolder){
  return getFileFromDataObject(dataObj,isFolder).getAbsolutePath();
}

Fixed version (ground truth):
public static String getPathFromDataObject(DataObject dataObj,boolean isFolder){
  try {
    return getFileFromDataObject(dataObj,isFolder).getAbsolutePath();
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 49778
Project: 49778
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  File toOpen=PathFinder.getFileFromDataObject(dataObj,true);
  try {
    Commands.getPlatform().browseInFileSystem(toOpen);
  }
 catch (  Exception ex) {
    JOptionPane.showMessageDialog(null,ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  File toOpen=PathFinder.getFileFromDataObject(dataObj,true);
  if (toOpen == null) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
    return;
  }
  try {
    Commands.getPlatform().browseInFileSystem(toOpen);
  }
 catch (  Exception ex) {
  }
}
Program: 49779
Project: 49779
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  String path=PathFinder.getPathFromDataObject(dataObj,false);
  try {
    Toolkit toolkit=Toolkit.getDefaultToolkit();
    Clipboard clipboard=toolkit.getSystemClipboard();
    StringSelection strSel=new StringSelection(path);
    clipboard.setContents(strSel,null);
  }
 catch (  Exception ex) {
    JOptionPane.showMessageDialog(null,ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  String path=PathFinder.getPathFromDataObject(dataObj,false);
  if (path == null) {
    JOptionPane.showMessageDialog(null,"String_Node_Str");
    return;
  }
  try {
    Toolkit toolkit=Toolkit.getDefaultToolkit();
    Clipboard clipboard=toolkit.getSystemClipboard();
    StringSelection strSel=new StringSelection(path);
    clipboard.setContents(strSel,null);
  }
 catch (  Exception ex) {
  }
}
Program: 49780
Project: 49780
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  try {
    String path=PathFinder.getPathFromDataObject(dataObj,true);
    Commands.getPlatform().openInShell(path);
  }
 catch (  Exception ex) {
    JOptionPane.showMessageDialog(null,ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  try {
    String path=PathFinder.getPathFromDataObject(dataObj,true);
    if (path == null) {
      JOptionPane.showMessageDialog(null,"String_Node_Str");
      return;
    }
    Commands.getPlatform().openInShell(path);
  }
 catch (  Exception ex) {
  }
}
Program: 49781
Project: 49781
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  String path=PathFinder.getPathFromDataObject(dataObj,false);
  if (path == null) {
    NotifyDescriptor d=new NotifyDescriptor.Message(QuickMessages.NO_FILE_IN_SELECTION,NotifyDescriptor.WARNING_MESSAGE);
    DialogDisplayer.getDefault().notify(d);
    return;
  }
  try {
    Toolkit toolkit=Toolkit.getDefaultToolkit();
    Clipboard clipboard=toolkit.getSystemClipboard();
    StringSelection strSel=new StringSelection(path);
    clipboard.setContents(strSel,null);
  }
 catch (  Exception ex) {
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  String path=PathFinder.getPathFromDataObject(dataObj,false);
  if (path == null) {
    NotifyDescriptor d=new NotifyDescriptor.Message(QuickMessages.NO_FILE_IN_SELECTION,NotifyDescriptor.WARNING_MESSAGE);
    DialogDisplayer.getDefault().notify(d);
    return;
  }
  String ossep=getOSSeparator();
  QuickOpenerProperty prop=PrefsUtil.load(null,"String_Node_Str",ossep);
  if (!prop.getValue().equals(ossep)) {
    String torep=(ossep.equals("String_Node_Str")) ? "String_Node_Str" : ossep;
    String repl=(prop.getValue().equals("String_Node_Str")) ? "String_Node_Str" : prop.getValue();
    path=path.replaceAll(torep,repl);
  }
  try {
    Toolkit toolkit=Toolkit.getDefaultToolkit();
    Clipboard clipboard=toolkit.getSystemClipboard();
    StringSelection strSel=new StringSelection(path);
    clipboard.setContents(strSel,null);
  }
 catch (  Exception ex) {
  }
}
Program: 49782
Project: 49782
Buggy source:
private static File getActiveFileFromDataObject(DataObject dataObj,boolean isFolder){
  if (dataObj == null) {
    return null;
  }
 else {
    try {
      if ((dataObj instanceof DataFolder)) {
        DataFolder df=(DataFolder)dataObj;
        FileObject fobj=df.getPrimaryFile();
        File found=getFileFromFileObject(fobj);
        if (found == null) {
          return null;
        }
 else {
          return isFolder ? found.getParentFile() : found;
        }
      }
 else       if (dataObj instanceof MultiDataObject) {
        MultiDataObject mdo=(MultiDataObject)dataObj;
        FileObject fobj=mdo.getPrimaryFile();
        File found=getFileFromFileObject(fobj);
        if (found == null) {
          return null;
        }
 else {
          return isFolder ? found.getParentFile() : found;
        }
      }
 else {
        return getFileFromDataObject(dataObj,isFolder);
      }
    }
 catch (    Exception e) {
      return null;
    }
  }
}

Fixed version (ground truth):
private static File getActiveFileFromDataObject(DataObject dataObj,boolean isFolder){
  if (dataObj == null) {
    return null;
  }
 else {
    try {
      File toReturn=getFileFromDataObject(dataObj,isFolder);
      if (toReturn != null && toReturn.exists()) {
        return toReturn;
      }
 else {
        if ((dataObj instanceof DataFolder)) {
          DataFolder df=(DataFolder)dataObj;
          FileObject fobj=df.getPrimaryFile();
          File found=getFileFromFileObject(fobj);
          if (found == null) {
            return null;
          }
 else {
            return isFolder ? found.getParentFile() : found;
          }
        }
 else         if (dataObj instanceof MultiDataObject) {
          MultiDataObject mdo=(MultiDataObject)dataObj;
          FileObject fobj=mdo.getPrimaryFile();
          File found=getFileFromFileObject(fobj);
          if (found == null) {
            return null;
          }
 else {
            return isFolder ? found.getParentFile() : found;
          }
        }
      }
    }
 catch (    Exception e) {
      return null;
    }
    return null;
  }
}
Program: 49783
Project: 49783
Buggy source:
private void setIntentData(){
  Intent intent=getIntent();
  if (null != intent.getStringExtra("String_Node_Str")) {
    version=intent.getStringExtra("String_Node_Str");
  }
  if (null != intent.getStringExtra("String_Node_Str")) {
    search=intent.getStringExtra("String_Node_Str");
  }
  if (null != intent.getParcelableArrayListExtra("String_Node_Str")) {
    index=0;
    items=intent.getParcelableArrayListExtra("String_Node_Str");
  }
}

Fixed version (ground truth):
private void setIntentData(){
  Intent intent=getIntent();
  if (null != intent.getStringExtra("String_Node_Str")) {
    version=intent.getStringExtra("String_Node_Str");
  }
  if (null != intent.getStringExtra("String_Node_Str")) {
    search=intent.getStringExtra("String_Node_Str");
  }
  if (null != intent.getParcelableArrayListExtra("String_Node_Str")) {
    items=intent.getParcelableArrayListExtra("String_Node_Str");
  }
}
Program: 49784
Project: 49784
Buggy source:
private void resume(){
  String wanted="String_Node_Str";
  String current=((TextView)header.findViewById(R.id.version)).getText().toString();
  if (bible != null) {
    wanted=bible.getVersionName(bible.getVersion());
  }
  if (refresh || !wanted.equals(current)) {
    refresh=false;
    handler.sendEmptyMessage(CHECKBIBLEDATA);
    if (bible == null) {
      bible=Bible.getBible(getBaseContext());
    }
 else {
      bible.checkLocale();
    }
    Log.d(TAG,"String_Node_Str" + version);
    if ("String_Node_Str".equals(version)) {
      version=bible.getVersion();
    }
    if (version.endsWith("String_Node_Str")) {
      bible.setDefaultVersion();
    }
    handler.sendEmptyMessage(SHOWDATA);
  }
  synced=false;
  if (bible != null) {
    final long mtime=System.currentTimeMillis();
    bible.checkBibleData(false,new Runnable(){
      @Override public void run(){
        synced=true;
        if (notifySync) {
          String duration=String.valueOf(System.currentTimeMillis() - mtime);
          handler.sendMessage(handler.obtainMessage(SYNCED,duration));
        }
      }
    }
);
  }
  handler.sendEmptyMessage(DISMISSBAR);
}

Fixed version (ground truth):
private void resume(){
  String wanted="String_Node_Str";
  String current=((TextView)header.findViewById(R.id.version)).getText().toString();
  if (bible != null) {
    wanted=bible.getVersionName(bible.getVersion());
  }
  if (refresh || !wanted.equals(current)) {
    refresh=false;
    handler.sendEmptyMessage(CHECKBIBLEDATA);
    if (bible == null) {
      bible=Bible.getBible(getBaseContext());
    }
 else {
      bible.checkLocale();
    }
    Log.d(TAG,"String_Node_Str" + version);
    if ("String_Node_Str".equals(version)) {
      version=bible.getVersion();
    }
    if (version.endsWith("String_Node_Str")) {
      bible.setDefaultVersion();
    }
    handler.sendEmptyMessage(SHOWDATA);
  }
  if (bible != null) {
    final long mtime=System.currentTimeMillis();
    bible.checkBibleData(false,new Runnable(){
      @Override public void run(){
        synced=true;
        if (notifySync) {
          String duration=String.valueOf(System.currentTimeMillis() - mtime);
          handler.sendMessage(handler.obtainMessage(SYNCED,duration));
        }
      }
    }
);
  }
  handler.sendEmptyMessage(DISMISSBAR);
}
Program: 49786
Project: 49786
Buggy source:
@Override public void onTextChanged(CharSequence s,int start,int before,int after){
  filter=s;
  adapter.getFilter().filter(s);
}

Fixed version (ground truth):
@Override public void onTextChanged(CharSequence s,int start,int before,int after){
  adapter.getFilter().filter(s);
}
Program: 49787
Project: 49787
Buggy source:
static void refresh(long id){
  if (resume) {
    boolean changed=false;
    String code=queue.get(String.valueOf(id));
    if (code != null) {
      queue.remove(String.valueOf(id));
      queue.remove(code);
      data.clear();
      for (      Map<String,String> map : versions) {
        if (String.valueOf(map.get("String_Node_Str")).equalsIgnoreCase(code)) {
          changed=true;
          String action=bible.getContext().getString(R.string.uninstall);
          map.put("String_Node_Str",action);
          map.put("String_Node_Str",action);
        }
        data.add(map);
      }
      if (changed) {
        adapter.notifyDataSetChanged();
        adapter.getFilter().filter(filter);
      }
    }
  }
}

Fixed version (ground truth):
static void refresh(long id){
  if (resume) {
    boolean changed=false;
    String code=queue.get(String.valueOf(id));
    if (code != null) {
      queue.remove(String.valueOf(id));
      queue.remove(code);
synchronized (data) {
        data.clear();
        for (        Map<String,String> map : versions) {
          if (String.valueOf(map.get("String_Node_Str")).equalsIgnoreCase(code)) {
            changed=true;
            String action=bible.getContext().getString(R.string.uninstall);
            map.put("String_Node_Str",action);
            map.put("String_Node_Str",action);
          }
          data.add(map);
        }
      }
      if (changed) {
        adapter.notifyDataSetChanged();
        query.setText("String_Node_Str");
      }
    }
  }
}
Program: 49788
Project: 49788
Buggy source:
@Override protected FilterResults performFiltering(CharSequence prefix){
  FilterResults results=new FilterResults();
  String filter=null;
  if (prefix != null && prefix.length() > 0) {
    filter=prefix.toString().toLowerCase(Locale.US);
  }
  data.clear();
  for (  Map<String,String> map : versions) {
    if (filter == null) {
      data.add(map);
    }
 else {
      for (      String value : map.values()) {
        if (value.toLowerCase(Locale.US).contains(filter)) {
          data.add(map);
          break;
        }
      }
    }
  }
  results.count=data.size();
  return results;
}

Fixed version (ground truth):
@Override protected FilterResults performFiltering(CharSequence prefix){
  FilterResults results=new FilterResults();
  String filter=null;
  if (prefix != null && prefix.length() > 0) {
    filter=prefix.toString().toLowerCase(Locale.US);
  }
synchronized (data) {
    data.clear();
    for (    Map<String,String> map : versions) {
      if (filter == null) {
        data.add(map);
      }
 else {
        for (        String value : map.values()) {
          if (value.toLowerCase(Locale.US).contains(filter)) {
            data.add(map);
            break;
          }
        }
      }
    }
  }
  results.count=data.size();
  return results;
}
Program: 49789
Project: 49789
Buggy source:
void setVersions(String json){
  if (json == null || json.length() == 0) {
    return;
  }
  data.clear();
  versions=parseVersions(json);
  for (  Map<String,String> map : versions) {
    data.add(map);
  }
  refresh(0);
  adapter.notifyDataSetChanged();
  adapter.getFilter().filter(filter);
}

Fixed version (ground truth):
void setVersions(String json){
  if (json == null || json.length() == 0) {
    return;
  }
  versions=parseVersions(json);
synchronized (data) {
    data.clear();
    for (    Map<String,String> map : versions) {
      data.add(map);
    }
  }
  refresh(0);
  adapter.notifyDataSetChanged();
  query.setText("String_Node_Str");
}
Program: 49790
Project: 49790
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  View view=super.getView(position,convertView,parent);
  final TextView action=(TextView)view.findViewById(R.id.action);
  if (action != null) {
    action.setTag(position);
    action.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        int position=(Integer)view.getTag();
        @SuppressWarnings("String_Node_Str") Map<String,String> map=(Map<String,String>)getItem(position);
        clickVersion((TextView)view,map);
      }
    }
);
  }
  return view;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  if (data.size() <= position) {
synchronized (data) {
      data.clear();
      for (      Map<String,String> map : versions) {
        data.add(map);
      }
    }
  }
  View view=super.getView(position,convertView,parent);
  final TextView action=(TextView)view.findViewById(R.id.action);
  if (action != null) {
    action.setTag(position);
    action.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        int position=(Integer)view.getTag();
        @SuppressWarnings("String_Node_Str") Map<String,String> map=(Map<String,String>)getItem(position);
        clickVersion((TextView)view,map);
      }
    }
);
  }
  return view;
}