nus-yam/ex-repair huggingface dataset:
Program: 49649
Project: 49649
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  BaseModel other=(BaseModel)obj;
  if (this.getUuid() == null) {
    if (other.getUuid() != null)     return false;
  }
 else   if (!this.getUuid().equals(other.getUuid()))   return false;
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  BaseModel other=(BaseModel)obj;
  if (this.getUuid() == null) {
    if (other.getUuid() != null) {
      return false;
    }
  }
 else   if (!this.getUuid().equals(other.getUuid())) {
    return false;
  }
  return true;
}
Program: 49650
Project: 49650
Buggy source:
public void setUuid(String uuid){
  this.uuid=uuid;
}

Fixed version (ground truth):
/** 
 * Sets the unique id of the model object.
 * @param uuid unique id of the model.
 */
public void setUuid(String uuid){
  this.uuid=uuid;
}
Program: 49651
Project: 49651
Buggy source:
/** 
 * @param uuid
 */
public Consumer(String uuid){
  super(uuid);
  this.info=new ConsumerInfo();
  this.info.setParent(this);
}

Fixed version (ground truth):
/** 
 * @param uuid unique id of consumer
 */
public Consumer(String uuid){
  super(uuid);
  this.info=new ConsumerInfo();
  this.info.setParent(this);
}
Program: 49652
Project: 49652
Buggy source:
/** 
 * Add a Product to this Consumer.
 */
public void addConsumedProduct(Product p){
  if (this.consumedProducts == null) {
    this.consumedProducts=new LinkedList<Product>();
  }
  this.consumedProducts.add(p);
}

Fixed version (ground truth):
/** 
 * Add a Product to this Consumer.
 * @param p Product to be consumed.
 */
public void addConsumedProduct(Product p){
  if (this.consumedProducts == null) {
    this.consumedProducts=new LinkedList<Product>();
  }
  this.consumedProducts.add(p);
}
Program: 49653
Project: 49653
Buggy source:
/** 
 * @param uuid
 */
public Entitlement(String uuid){
  super(uuid);
}

Fixed version (ground truth):
/** 
 * @param uuid unique id of the entitlement
 */
public Entitlement(String uuid){
  super(uuid);
}
Program: 49654
Project: 49654
Buggy source:
/** 
 * @param org the org to set
 */
public void setOwner(Owner ownerIn){
  this.owner=ownerIn;
}

Fixed version (ground truth):
/** 
 * @param ownerIn the owner to set
 */
public void setOwner(Owner ownerIn){
  this.owner=ownerIn;
}
Program: 49655
Project: 49655
Buggy source:
public JsonTestObject getParent(){
  return parent;
}

Fixed version (ground truth):
/** 
 * returns parent object
 * @return parent object
 */
public JsonTestObject getParent(){
  return parent;
}
Program: 49656
Project: 49656
Buggy source:
public void setParent(JsonTestObject p){
  parent=p;
}

Fixed version (ground truth):
/** 
 * sets the parent
 * @param p Parent
 */
public void setParent(JsonTestObject p){
  parent=p;
}
Program: 49657
Project: 49657
Buggy source:
public List<String> getStringList(){
  return stringlist;
}

Fixed version (ground truth):
/** 
 * returns the string list
 * @return the string list
 */
public List<String> getStringList(){
  return stringlist;
}
Program: 49658
Project: 49658
Buggy source:
public void setStringList(List<String> items){
  stringlist=items;
}

Fixed version (ground truth):
/** 
 * sets the list string
 * @param items items to set
 */
public void setStringList(List<String> items){
  stringlist=items;
}
Program: 49659
Project: 49659
Buggy source:
/** 
 * Lookup an object by a field name
 * @param clazz
 * @param fieldName
 * @return BaseModel if found.
 */
public Object lookupByFieldName(Class<?> clazz,String fieldName,String value){
  String key=clazz.getName();
  if (!objects.containsKey(key)) {
    return null;
  }
  List typelist=(List)objects.get(key);
  for (int i=0; i < typelist.size(); i++) {
    Object o=typelist.get(i);
    logger.debug("String_Node_Str" + o);
    String getter="String_Node_Str" + fieldName.substring(0,1).toUpperCase() + fieldName.substring(1);
    logger.debug("String_Node_Str" + getter);
    Object v=MethodUtil.callMethod(o,getter,new Object[0]);
    logger.debug("String_Node_Str" + v);
    if (v != null && v.equals(value)) {
      return o;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Lookup an object by a field name
 * @param clazz class to lookup
 * @param fieldName field to use
 * @param value value to match
 * @return BaseModel if found, null otherwise.
 */
public Object lookupByFieldName(Class<?> clazz,String fieldName,String value){
  String key=clazz.getName();
  if (!objects.containsKey(key)) {
    return null;
  }
  List typelist=(List)objects.get(key);
  for (int i=0; i < typelist.size(); i++) {
    Object o=typelist.get(i);
    logger.debug("String_Node_Str" + o);
    String getter="String_Node_Str" + fieldName.substring(0,1).toUpperCase() + fieldName.substring(1);
    logger.debug("String_Node_Str" + getter);
    Object v=MethodUtil.callMethod(o,getter,new Object[0]);
    logger.debug("String_Node_Str" + v);
    if (v != null && v.equals(value)) {
      return o;
    }
  }
  return null;
}
Program: 49660
Project: 49660
Buggy source:
/** 
 * Store an object
 * @param u
 */
public Object store(Object u){
  String key=u.getClass().getName();
  if (!objects.containsKey(key)) {
    List newtype=new LinkedList();
    newtype.add(u);
    objects.put(u.getClass().getName(),newtype);
  }
  List typelist=(List)objects.get(key);
  typelist.add(u);
  return u;
}

Fixed version (ground truth):
/** 
 * Store an object
 * @param u object to store
 * @return The stored object
 */
public Object store(Object u){
  String key=u.getClass().getName();
  if (!objects.containsKey(key)) {
    List newtype=new LinkedList();
    newtype.add(u);
    objects.put(u.getClass().getName(),newtype);
  }
  List typelist=(List)objects.get(key);
  typelist.add(u);
  return u;
}
Program: 49661
Project: 49661
Buggy source:
/** 
 * Delete an object 
 * @param clazz to lookup  
 * @param uuidIn to lookup and delete
 */
public void delete(Class clazz,BaseModel removeMe){
  String key=clazz.getName();
  List typelist=(List)objects.get(key);
  typelist.remove(removeMe);
}

Fixed version (ground truth):
/** 
 * Delete an object 
 * @param clazz to lookup  
 * @param removeMe model to remove
 */
public void delete(Class clazz,BaseModel removeMe){
  String key=clazz.getName();
  List typelist=(List)objects.get(key);
  typelist.remove(removeMe);
}
Program: 49662
Project: 49662
Buggy source:
/** 
 * Get a List of objects by type
 * @param clazz
 * @return List if found. null if not.
 */
public List<Object> listObjectsByClass(Class<?> clazz){
  List<Object> retval=null;
  retval=(List<Object>)objects.get(clazz.getName());
  if (retval == null) {
    retval=new LinkedList();
  }
  return retval;
}

Fixed version (ground truth):
/** 
 * Get a List of objects by type
 * @param clazz class to lookup
 * @return List if found. null if not.
 */
public List<Object> listObjectsByClass(Class<?> clazz){
  List<Object> retval=null;
  retval=(List<Object>)objects.get(clazz.getName());
  if (retval == null) {
    retval=new LinkedList();
  }
  return retval;
}
Program: 49663
Project: 49663
Buggy source:
/** 
 * Lookup an Owner by UUID
 * @param uuid to lookup
 * @return Owner
 */
public BaseModel lookupByUUID(Class<?> clazz,String uuid){
  return (BaseModel)lookupByFieldName(clazz,"String_Node_Str",uuid);
}

Fixed version (ground truth):
/** 
 * Lookup an Owner by UUID
 * @param clazz class to lookup
 * @param uuid to lookup
 * @return BaseModel if found, null otherwise.
 */
public BaseModel lookupByUUID(Class<?> clazz,String uuid){
  return (BaseModel)lookupByFieldName(clazz,"String_Node_Str",uuid);
}
Program: 49664
Project: 49664
Buggy source:
public void addConsumer(Consumer c){
  c.setOwner(this);
  if (this.consumers == null) {
    this.consumers=new LinkedList<Consumer>();
  }
  this.consumers.add(c);
}

Fixed version (ground truth):
/** 
 * Add a consumer to this owner
 * @param c consumer for this owner.
 */
public void addConsumer(Consumer c){
  c.setOwner(this);
  if (this.consumers == null) {
    this.consumers=new LinkedList<Consumer>();
  }
  this.consumers.add(c);
}
Program: 49665
Project: 49665
Buggy source:
public void addEntitlementPool(EntitlementPool pool){
  pool.setOwner(this);
  if (this.entitlementPools == null) {
    this.entitlementPools=new LinkedList<EntitlementPool>();
  }
  this.entitlementPools.add(pool);
}

Fixed version (ground truth):
/** 
 * add owner to the pool, and reference to the pool.
 * @param pool EntitlementPool for this owner.
 */
public void addEntitlementPool(EntitlementPool pool){
  pool.setOwner(this);
  if (this.entitlementPools == null) {
    this.entitlementPools=new LinkedList<EntitlementPool>();
  }
  this.entitlementPools.add(pool);
}
Program: 49666
Project: 49666
Buggy source:
/** 
 * Get the list of 
 * @return
 */
public List<String> getCompatibleConsumerTypes(){
  return null;
}

Fixed version (ground truth):
/** 
 * Get the list of compatible consumer types
 * @return list of compatible consumer types
 */
public List<String> getCompatibleConsumerTypes(){
  return null;
}
Program: 49667
Project: 49667
Buggy source:
/** 
 * Create a new instance of the classname passed in.
 * @param className
 * @return instance of class passed in.
 */
public static Object callNewMethod(String className,Object... args){
  Object retval=null;
  try {
    Class clazz=Thread.currentThread().getContextClassLoader().loadClass(className);
    System.out.println("String_Node_Str" + clazz.getName());
    if (args == null || args.length == 0) {
      retval=clazz.newInstance();
    }
 else {
      try {
        Constructor[] ctors=clazz.getConstructors();
        for (        Constructor ctor : ctors) {
          if (isCompatible(ctor.getParameterTypes(),args)) {
            return ctor.newInstance(args);
          }
        }
      }
 catch (      IllegalArgumentException e) {
        throw new RuntimeException(e);
      }
catch (      InvocationTargetException e) {
        throw new RuntimeException(e);
      }
    }
  }
 catch (  InstantiationException e) {
    throw new RuntimeException(e);
  }
catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
catch (  ClassNotFoundException e) {
    throw new RuntimeException(e);
  }
  return retval;
}

Fixed version (ground truth):
/** 
 * Create a new instance of the classname passed in.
 * @param className the class to construct
 * @param args arguments to the ctor of the given className
 * @return instance of class passed in.
 */
public static Object callNewMethod(String className,Object... args){
  Object retval=null;
  try {
    Class clazz=Thread.currentThread().getContextClassLoader().loadClass(className);
    System.out.println("String_Node_Str" + clazz.getName());
    if (args == null || args.length == 0) {
      retval=clazz.newInstance();
    }
 else {
      try {
        Constructor[] ctors=clazz.getConstructors();
        for (        Constructor ctor : ctors) {
          if (isCompatible(ctor.getParameterTypes(),args)) {
            return ctor.newInstance(args);
          }
        }
      }
 catch (      IllegalArgumentException e) {
        throw new RuntimeException(e);
      }
catch (      InvocationTargetException e) {
        throw new RuntimeException(e);
      }
    }
  }
 catch (  InstantiationException e) {
    throw new RuntimeException(e);
  }
catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
  }
catch (  ClassNotFoundException e) {
    throw new RuntimeException(e);
  }
  return retval;
}
Program: 49668
Project: 49668
Buggy source:
public static void callSetter(Object o,String fieldName,Object param){
  String setter="String_Node_Str" + fieldName.substring(0,1).toUpperCase() + fieldName.substring(1);
  MethodUtil.callMethod(o,setter,param);
}

Fixed version (ground truth):
/** 
 * Calls the setter for the <code>fieldName</code> of the object <code>o</code> with the given <code>param</code> 
 * @param o object being modified
 * @param fieldName field to be set
 * @param param value to be used
 */
public static void callSetter(Object o,String fieldName,Object param){
  String setter="String_Node_Str" + fieldName.substring(0,1).toUpperCase() + fieldName.substring(1);
  MethodUtil.callMethod(o,setter,param);
}
Program: 49669
Project: 49669
Buggy source:
/** 
 * This position may be a draw with a the pawn in a, c, f, h and in 7th with the defending king near
 */
private static int endgameKQKP(Board board,boolean whiteDominant){
  long ranks12=BitboardUtils.RANK[whiteDominant ? 0 : 7] | BitboardUtils.RANK[whiteDominant ? 1 : 6];
  long pawn=board.pawns;
  long pawnZone;
  if ((BitboardUtils.A & pawn) != 0) {
    pawnZone=(BitboardUtils.FILES_LEFT[3]) & ranks12;
  }
 else   if ((BitboardUtils.C & pawn) != 0) {
    pawnZone=(BitboardUtils.FILES_LEFT[4]) & ranks12;
  }
 else   if ((BitboardUtils.F & pawn) != 0) {
    pawnZone=(BitboardUtils.FILES_RIGHT[3]) & ranks12;
  }
 else   if ((BitboardUtils.F & pawn) != 0) {
    pawnZone=(BitboardUtils.FILES_RIGHT[4]) & ranks12;
  }
 else {
    return Evaluator.NO_VALUE;
  }
  long dominantKing=board.kings & (whiteDominant ? board.whites : board.blacks);
  long otherKing=board.kings & (whiteDominant ? board.blacks : board.whites);
  int dominantKingIndex=BitboardUtils.square2Index(dominantKing);
  int pawnIndex=BitboardUtils.square2Index(pawn);
  if ((pawnZone & otherKing) != 0 && BitboardUtils.distance(dominantKingIndex,pawnIndex) >= 2) {
    return Evaluator.DRAW;
  }
  return Evaluator.NO_VALUE;
}

Fixed version (ground truth):
/** 
 * This position may be a draw with a the pawn in a, c, f, h and in 7th with the defending king near
 */
private static int endgameKQKP(Board board,boolean whiteDominant){
  long ranks12=whiteDominant ? BitboardUtils.R1 | BitboardUtils.R2 : BitboardUtils.R7 | BitboardUtils.R8;
  long pawn=board.pawns;
  long pawnZone;
  if ((BitboardUtils.A & pawn) != 0) {
    pawnZone=(BitboardUtils.FILES_LEFT[3]) & ranks12;
  }
 else   if ((BitboardUtils.C & pawn) != 0) {
    pawnZone=(BitboardUtils.FILES_LEFT[4]) & ranks12;
  }
 else   if ((BitboardUtils.F & pawn) != 0) {
    pawnZone=(BitboardUtils.FILES_RIGHT[3]) & ranks12;
  }
 else   if ((BitboardUtils.H & pawn) != 0) {
    pawnZone=(BitboardUtils.FILES_RIGHT[4]) & ranks12;
  }
 else {
    return Evaluator.NO_VALUE;
  }
  long dominantKing=board.kings & (whiteDominant ? board.whites : board.blacks);
  long otherKing=board.kings & (whiteDominant ? board.blacks : board.whites);
  int dominantKingIndex=BitboardUtils.square2Index(dominantKing);
  int pawnIndex=BitboardUtils.square2Index(pawn);
  if ((pawnZone & otherKing) != 0 && BitboardUtils.distance(dominantKingIndex,pawnIndex) >= 1) {
    return Evaluator.DRAW;
  }
  return Evaluator.NO_VALUE;
}
Program: 49670
Project: 49670
Buggy source:
public void run(){
  try {
    prepareRun();
    while (true) {
      runStepped();
    }
  }
 catch (  SearchFinishedException ignored) {
  }
  finishRun();
}

Fixed version (ground truth):
public void run(){
  int bestMove=Move.NONE, ponderMove=Move.NONE;
synchronized (searchLock) {
    try {
      prepareRun();
      while (true) {
        runStepped();
      }
    }
 catch (    SearchFinishedException ignored) {
    }
    board.undoMove(initialPly);
    bestMove=globalBestMove;
    ponderMove=globalPonderMove;
    searching=false;
  }
  if (observer != null) {
    observer.bestMove(bestMove,ponderMove);
  }
  if (debug) {
    searchStats();
  }
}
Program: 49671
Project: 49671
Buggy source:
private void prepareRun() throws SearchFinishedException {
  startTime=System.currentTimeMillis();
  setSearchLimits(searchParameters,false);
  panicTime=false;
  engineIsWhite=board.getTurn();
  logger.debug("String_Node_Str" + board);
  positionCounter=0;
  pvPositionCounter=0;
  qsPositionCounter=0;
  globalBestMove=Move.NONE;
  ponderMove=Move.NONE;
  initialPly=board.getMoveNumber();
  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 != Move.NONE) {
      globalBestMove=bookMove;
      logger.debug("String_Node_Str");
      throw new SearchFinishedException();
    }
 else {
      logger.debug("String_Node_Str");
      board.setOutBookMove(board.getMoveNumber());
    }
  }
  depth=1;
  boolean foundTT=tt.search(board,0,false);
  if (canUseTT(0,-Evaluator.MATE,Evaluator.MATE)) {
    rootScore=tt.getScore();
  }
 else {
    rootScore=evaluate(foundTT,0);
  }
  tt.newGeneration();
  aspWindows=ASPIRATION_WINDOW_SIZES;
}

Fixed version (ground truth):
private void prepareRun() throws SearchFinishedException {
  startTime=System.currentTimeMillis();
  setSearchLimits(searchParameters,false);
  panicTime=false;
  engineIsWhite=board.getTurn();
  logger.debug("String_Node_Str" + board);
  positionCounter=0;
  pvPositionCounter=0;
  qsPositionCounter=0;
  globalBestMove=Move.NONE;
  globalPonderMove=Move.NONE;
  initialPly=board.getMoveNumber();
  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 != Move.NONE) {
      globalBestMove=bookMove;
      logger.debug("String_Node_Str");
      throw new SearchFinishedException();
    }
 else {
      logger.debug("String_Node_Str");
      board.setOutBookMove(board.getMoveNumber());
    }
  }
  depth=1;
  boolean foundTT=tt.search(board,0,false);
  if (canUseTT(0,-Evaluator.MATE,Evaluator.MATE)) {
    rootScore=tt.getScore();
  }
 else {
    rootScore=evaluate(foundTT,0);
  }
  tt.newGeneration();
  aspWindows=ASPIRATION_WINDOW_SIZES;
}
Program: 49672
Project: 49672
Buggy source:
/** 
 * Gets the principal variation from the transposition table
 */
private String getPv(int firstMove){
  if (firstMove == Move.NONE) {
    return "String_Node_Str";
  }
  StringBuilder sb=new StringBuilder();
  List<Long> keys=new ArrayList<>();
  sb.append(Move.toString(firstMove));
  int savedMoveNumber=board.getMoveNumber();
  board.doMove(firstMove,true,false);
  int i=1;
  while (i < 256) {
    if (tt.search(board,i,false)) {
      if (tt.getBestMove() == Move.NONE || keys.contains(board.getKey())) {
        break;
      }
      keys.add(board.getKey());
      if (i == 1) {
        ponderMove=tt.getBestMove();
      }
      sb.append("String_Node_Str");
      sb.append(Move.toString(tt.getBestMove()));
      board.doMove(tt.getBestMove(),true,false);
      i++;
      if (board.isMate()) {
        break;
      }
    }
 else {
      break;
    }
  }
  board.undoMove(savedMoveNumber);
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Gets the principal variation from the transposition table
 */
private String getPv(int firstMove){
  if (firstMove == Move.NONE) {
    return "String_Node_Str";
  }
  StringBuilder sb=new StringBuilder();
  List<Long> keys=new ArrayList<>();
  sb.append(Move.toString(firstMove));
  int savedMoveNumber=board.getMoveNumber();
  board.doMove(firstMove,true,false);
  int i=1;
  while (i < 256) {
    if (tt.search(board,i,false)) {
      if (tt.getBestMove() == Move.NONE || keys.contains(board.getKey())) {
        break;
      }
      keys.add(board.getKey());
      if (i == 1) {
        globalPonderMove=tt.getBestMove();
      }
      sb.append("String_Node_Str");
      sb.append(Move.toString(tt.getBestMove()));
      board.doMove(tt.getBestMove(),true,false);
      i++;
      if (board.isMate()) {
        break;
      }
    }
 else {
      break;
    }
  }
  board.undoMove(savedMoveNumber);
  return sb.toString();
}
Program: 49673
Project: 49673
Buggy source:
/** 
 * It searches for the best movement
 */
public void go(SearchParameters searchParameters){
  if (initialized && !searching) {
    searching=true;
    setSearchParameters(searchParameters);
    run();
  }
}

Fixed version (ground truth):
/** 
 * It searches for the best movement
 */
public void go(SearchParameters searchParameters){
synchronized (startSearchLock) {
    if (!initialized || searching) {
      return;
    }
    searching=true;
  }
  setSearchParameters(searchParameters);
  run();
}
Program: 49674
Project: 49674
Buggy source:
/** 
 * Threaded version
 */
public void go(SearchParameters searchParameters){
  if (initialized && !searching) {
    searching=true;
    setSearchParameters(searchParameters);
    thread=new Thread(this);
    thread.start();
  }
}

Fixed version (ground truth):
/** 
 * Threaded version
 */
public void go(SearchParameters searchParameters){
synchronized (startSearchLock) {
    if (!initialized || searching) {
      return;
    }
    searching=true;
  }
  setSearchParameters(searchParameters);
  thread=new Thread(this);
  thread.start();
}
Program: 49675
Project: 49675
Buggy source:
/** 
 * Multiply with negative numbers (in the factor or in one of the oe components) cannot be done directly
 */
public static int oeMul(int factor,int oeValue){
  return (((oeValue >> 16) * factor) << 16) | ((oeValue & 0xffff) * factor) & 0xffff;
}

Fixed version (ground truth):
/** 
 * Multiply with negative numbers (in the factor or in one of the oe components) cannot be done directly
 */
public static int oeMul(int factor,int oeValue){
  return oe((o(oeValue) * factor),e(oeValue) * factor);
}
Program: 49676
Project: 49676
Buggy source:
public static int e(int oe){
  return (short)(oe & 0xffff);
}

Fixed version (ground truth):
/** 
 * Get the "Endgame" part
 */
public static int e(int oe){
  return (short)(oe & 0xffff);
}
Program: 49677
Project: 49677
Buggy source:
/** 
 * Merges two short Opening - Ending values in one int
 */
public static int oe(int opening,int endgame){
  return (opening << 16) | (endgame & 0xffff);
}

Fixed version (ground truth):
/** 
 * Merges two short Opening - Ending values in one int
 */
public static int oe(int opening,int endgame){
  return ((opening < 0 ? opening - 1 : opening) << 16) | (endgame & 0xffff);
}
Program: 49678
Project: 49678
Buggy source:
/** 
 * shift right each part by factor positions
 */
public static int oeShr(int factor,int oeValue){
  return (((oeValue >> (16 + factor))) << 16) | ((oeValue & 0xffff) >> factor) & 0xffff;
}

Fixed version (ground truth):
/** 
 * Shift right each part by factor positions
 */
public static int oeShr(int factor,int oeValue){
  return (((oeValue >> (16 + factor))) << 16) | ((oeValue & 0xffff) >> factor) & 0xffff;
}
Program: 49679
Project: 49679
Buggy source:
public static int o(int oe){
  return oe >> 16;
}

Fixed version (ground truth):
/** 
 * Get the "Opening" part
 */
public static int o(int oe){
  int i=oe >> 16;
  return i < 0 ? i + 1 : i;
}
Program: 49680
Project: 49680
Buggy source:
public void setScore(int score,int alpha,int beta){
  this.score=score;
  if (Math.abs(score) == Evaluator.MATE) {
    upperBound=false;
    lowerBound=false;
  }
 else {
    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: 49682
Project: 49682
Buggy source:
/** 
 * Gets a random move from the book taking care of weights
 */
public int getMove(Board board);

Fixed version (ground truth):
/** 
 * Gets a random move from the book taking care of weights
 */
int getMove(Board board);
Program: 49683
Project: 49683
Buggy source:
public int generateMoves(Board board,int moves[],int index);

Fixed version (ground truth):
int generateMoves(Board board,int moves[],int index);
Program: 49684
Project: 49684
Buggy source:
public void bestMove(int bestMove,int ponder);

Fixed version (ground truth):
void bestMove(int bestMove,int ponder);
Program: 49685
Project: 49685
Buggy source:
public void info(SearchStatusInfo info);

Fixed version (ground truth):
void info(SearchStatusInfo info);
Program: 49686
Project: 49686
Buggy source:
public String standard();

Fixed version (ground truth):
String standard();
Program: 49687
Project: 49687
Buggy source:
public String advanced();

Fixed version (ground truth):
String advanced();
Program: 49688
Project: 49688
Buggy source:
public String about();

Fixed version (ground truth):
String about();
Program: 49689
Project: 49689
Buggy source:
public String blacksVsComputer();

Fixed version (ground truth):
String blacksVsComputer();
Program: 49690
Project: 49690
Buggy source:
public String confirmRestart();

Fixed version (ground truth):
String confirmRestart();
Program: 49691
Project: 49691
Buggy source:
public String redo();

Fixed version (ground truth):
String redo();
Program: 49692
Project: 49692
Buggy source:
public String chess960();

Fixed version (ground truth):
String chess960();
Program: 49693
Project: 49693
Buggy source:
public String aboutTab();

Fixed version (ground truth):
String aboutTab();
Program: 49694
Project: 49694
Buggy source:
public String thinking();

Fixed version (ground truth):
String thinking();
Program: 49695
Project: 49695
Buggy source:
public String fen();

Fixed version (ground truth):
String fen();
Program: 49696
Project: 49696
Buggy source:
public String setFen();

Fixed version (ground truth):
String setFen();
Program: 49697
Project: 49697
Buggy source:
public String computerVsComputer();

Fixed version (ground truth):
String computerVsComputer();
Program: 49698
Project: 49698
Buggy source:
public String mode();

Fixed version (ground truth):
String mode();
Program: 49699
Project: 49699
Buggy source:
public String undo();

Fixed version (ground truth):
String undo();
Program: 49700
Project: 49700
Buggy source:
public String white();

Fixed version (ground truth):
String white();
Program: 49701
Project: 49701
Buggy source:
public String mt10s();

Fixed version (ground truth):
String mt10s();
Program: 49702
Project: 49702
Buggy source:
public String mt30s();

Fixed version (ground truth):
String mt30s();
Program: 49703
Project: 49703
Buggy source:
public String player();

Fixed version (ground truth):
String player();
Program: 49704
Project: 49704
Buggy source:
public String blacksWin();

Fixed version (ground truth):
String blacksWin();
Program: 49705
Project: 49705
Buggy source:
public String whitesVsBlacks();

Fixed version (ground truth):
String whitesVsBlacks();
Program: 49706
Project: 49706
Buggy source:
public String restart();

Fixed version (ground truth):
String restart();
Program: 49707
Project: 49707
Buggy source:
public String userMove();

Fixed version (ground truth):
String userMove();
Program: 49708
Project: 49708
Buggy source:
public String reflectionTime();

Fixed version (ground truth):
String reflectionTime();
Program: 49709
Project: 49709
Buggy source:
public String black();

Fixed version (ground truth):
String black();
Program: 49710
Project: 49710
Buggy source:
public String whitesVsComputer();

Fixed version (ground truth):
String whitesVsComputer();
Program: 49711
Project: 49711
Buggy source:
public String history();

Fixed version (ground truth):
String history();
Program: 49712
Project: 49712
Buggy source:
public String draw();

Fixed version (ground truth):
String draw();
Program: 49713
Project: 49713
Buggy source:
public String mt7s();

Fixed version (ground truth):
String mt7s();
Program: 49714
Project: 49714
Buggy source:
public String confirmYes();

Fixed version (ground truth):
String confirmYes();
Program: 49715
Project: 49715
Buggy source:
public String waitMessage();

Fixed version (ground truth):
String waitMessage();
Program: 49716
Project: 49716
Buggy source:
public String infoTab();

Fixed version (ground truth):
String infoTab();
Program: 49717
Project: 49717
Buggy source:
public String confirmNo();

Fixed version (ground truth):
String confirmNo();
Program: 49718
Project: 49718
Buggy source:
public String mt3s();

Fixed version (ground truth):
String mt3s();
Program: 49719
Project: 49719
Buggy source:
public String settingsTab();

Fixed version (ground truth):
String settingsTab();
Program: 49720
Project: 49720
Buggy source:
public String mt5s();

Fixed version (ground truth):
String mt5s();
Program: 49721
Project: 49721
Buggy source:
public String mt1s();

Fixed version (ground truth):
String mt1s();
Program: 49722
Project: 49722
Buggy source:
public String actions();

Fixed version (ground truth):
String actions();
Program: 49723
Project: 49723
Buggy source:
public String whitesWin();

Fixed version (ground truth):
String whitesWin();
Program: 49724
Project: 49724
Buggy source:
public String mt15s();

Fixed version (ground truth):
String mt15s();
Program: 49725
Project: 49725
Buggy source:
public String status();

Fixed version (ground truth):
String status();
Program: 49726
Project: 49726
Buggy source:
public void doMove(int move);

Fixed version (ground truth):
void doMove(int move);
Program: 49727
Project: 49727
Buggy source:
@Source("String_Node_Str") public ChessCss getCss();

Fixed version (ground truth):
@Source("String_Node_Str") ChessCss getCss();
Program: 49728
Project: 49728
Buggy source:
@Source("String_Node_Str") public TextResource getBoard();

Fixed version (ground truth):
@Source("String_Node_Str") TextResource getBoard();
Program: 49729
Project: 49729
Buggy source:
public KPKPosition(int idx){
  whiteKingIndex=(idx >>> 0) & 0x3F;
  blackKingIndex=(idx >>> 6) & 0x3F;
  whiteToMove=((idx >>> 12) & 0x01) != 0;
  pawnIndex=7 - ((idx >>> 13) & 0x03) + ((RANK_7 - (idx >>> 15)) << 3);
  result=RESULT_UNKNOWN;
  long blackKingSquare=BitboardUtils.index2Square((byte)blackKingIndex);
  long pawnSquare=BitboardUtils.index2Square((byte)(pawnIndex));
  long pawnAttacks=BitboardAttacks.getInstance().pawnUpwards[pawnIndex];
  long pawnSquareNextRank=BitboardUtils.index2Square((byte)(pawnIndex + 8));
  long whiteKingAttacks=BitboardAttacks.getInstance().king[whiteKingIndex];
  long blackKingAttacks=BitboardAttacks.getInstance().king[blackKingIndex];
  if (BitboardUtils.distance(whiteKingIndex,blackKingIndex) <= 1 || whiteKingIndex == pawnIndex || blackKingIndex == pawnIndex || (whiteToMove && (pawnAttacks & blackKingSquare) != 0)) {
    result=RESULT_INVALID;
  }
 else   if (whiteToMove) {
    if (BitboardUtils.getRankOfIndex(pawnIndex) == RANK_7 && whiteKingIndex != pawnIndex + DELTA_N && ((BitboardUtils.distance(blackKingIndex,pawnIndex + DELTA_N) > 1 || (whiteKingAttacks & pawnSquareNextRank) != 0))) {
      result=RESULT_WIN;
    }
  }
 else   if ((blackKingAttacks & ~(whiteKingAttacks | pawnAttacks)) == 0 || (blackKingAttacks & pawnSquare & ~whiteKingAttacks) != 0) {
    result=RESULT_DRAW;
  }
}

Fixed version (ground truth):
public KPKPosition(int idx){
  whiteKingIndex=idx & 0x3F;
  blackKingIndex=(idx >>> 6) & 0x3F;
  whiteToMove=((idx >>> 12) & 0x01) != 0;
  pawnIndex=7 - ((idx >>> 13) & 0x03) + ((RANK_7 - (idx >>> 15)) << 3);
  result=RESULT_UNKNOWN;
  long blackKingSquare=BitboardUtils.index2Square((byte)blackKingIndex);
  long pawnSquare=BitboardUtils.index2Square((byte)(pawnIndex));
  long pawnAttacks=BitboardAttacks.getInstance().pawnUpwards[pawnIndex];
  long pawnSquareNextRank=BitboardUtils.index2Square((byte)(pawnIndex + 8));
  long whiteKingAttacks=BitboardAttacks.getInstance().king[whiteKingIndex];
  long blackKingAttacks=BitboardAttacks.getInstance().king[blackKingIndex];
  if (BitboardUtils.distance(whiteKingIndex,blackKingIndex) <= 1 || whiteKingIndex == pawnIndex || blackKingIndex == pawnIndex || (whiteToMove && (pawnAttacks & blackKingSquare) != 0)) {
    result=RESULT_INVALID;
  }
 else   if (whiteToMove) {
    if (BitboardUtils.getRankOfIndex(pawnIndex) == RANK_7 && whiteKingIndex != pawnIndex + DELTA_N && ((BitboardUtils.distance(blackKingIndex,pawnIndex + DELTA_N) > 1 || (whiteKingAttacks & pawnSquareNextRank) != 0))) {
      result=RESULT_WIN;
    }
  }
 else   if ((blackKingAttacks & ~(whiteKingAttacks | pawnAttacks)) == 0 || (blackKingAttacks & pawnSquare & ~whiteKingAttacks) != 0) {
    result=RESULT_DRAW;
  }
}
Program: 49731
Project: 49731
Buggy source:
@Test public void testKPpk(){
  String fen="String_Node_Str";
  search.getBoard().setFen(fen);
  searchParams=new SearchParameters();
  searchParams.setNodes(30000);
  search.go(searchParams);
  assertTrue("String_Node_Str",search.getBestMoveScore() < -ExperimentalEvaluator.QUEEN);
}

Fixed version (ground truth):
@Test public void testKPpk(){
  String fen="String_Node_Str";
  search.getBoard().setFen(fen);
  searchParams=new SearchParameters();
  searchParams.setNodes(30000);
  search.go(searchParams);
  assertTrue("String_Node_Str",search.getBestMoveScore() < -Config.QUEEN);
}
Program: 49732
Project: 49732
Buggy source:
@Test public void testPawnPromotion(){
  fen="String_Node_Str";
  board.setFen(fen);
  System.out.print(board.toString());
  assertTrue("String_Node_Str",kpkBitbase.probe(board));
  fen="String_Node_Str";
  board.setFen(fen);
  System.out.print(board.toString());
  assertTrue("String_Node_Str",kpkBitbase.probe(board) == false);
}

Fixed version (ground truth):
@Test public void testPawnPromotion(){
  fen="String_Node_Str";
  board.setFen(fen);
  System.out.print(board.toString());
  assertTrue("String_Node_Str",kpkBitbase.probe(board));
  fen="String_Node_Str";
  board.setFen(fen);
  System.out.print(board.toString());
  assertTrue("String_Node_Str",!kpkBitbase.probe(board));
}
Program: 49733
Project: 49733
Buggy source:
@Before public void setUp() throws Exception {
  movegen=new MagicMoveGenerator();
  legalMovegen=new LegalMoveGenerator();
  BitboardUtils b=new BitboardUtils();
  b.toString();
  testBoards=new Board[tests.length];
  for (int i=0; i < tests.length; i++) {
    testBoards[i]=new Board();
    testBoards[i].setFen(tests[i]);
  }
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  movegen=new MagicMoveGenerator();
  legalMovegen=new LegalMoveGenerator();
  BitboardUtils b=new BitboardUtils();
  testBoards=new Board[tests.length];
  for (int i=0; i < tests.length; i++) {
    testBoards[i]=new Board();
    testBoards[i].setFen(tests[i]);
  }
}
Program: 49734
Project: 49734
Buggy source:
@Override public void info(SearchStatusInfo info){
  if (bestMove != search.getBestMove()) {
    bestMove=search.getBestMove();
    solutionTime=(int)info.getTime();
    solutionNodes=info.getNodes();
  }
  boolean found=bestMoves.length > 0 ? false : true;
  for (  int move : bestMoves) {
    if (move == search.getBestMove()) {
      found=true;
      break;
    }
  }
  for (  int move : avoidMoves) {
    if (move == search.getBestMove()) {
      found=false;
      break;
    }
  }
  solutionFound=found;
  if (found) {
    logger.debug(TestColors.ANSI_GREEN + info.toString() + TestColors.ANSI_RESET);
  }
 else {
    logger.debug(TestColors.ANSI_RED + info.toString() + TestColors.ANSI_RESET);
  }
}

Fixed version (ground truth):
@Override public void info(SearchStatusInfo info){
  if (bestMove != search.getBestMove()) {
    bestMove=search.getBestMove();
    solutionTime=(int)info.getTime();
    solutionNodes=info.getNodes();
  }
  boolean found=bestMoves.length <= 0;
  for (  int move : bestMoves) {
    if (move == search.getBestMove()) {
      found=true;
      break;
    }
  }
  for (  int move : avoidMoves) {
    if (move == search.getBestMove()) {
      found=false;
      break;
    }
  }
  solutionFound=found;
  if (found) {
    logger.debug(TestColors.ANSI_GREEN + info.toString() + TestColors.ANSI_RESET);
  }
 else {
    logger.debug(TestColors.ANSI_RED + info.toString() + TestColors.ANSI_RESET);
  }
}
Program: 49735
Project: 49735
Buggy source:
public int getPieceIntAt(long square){
  return ((pawns & square) != 0 ? Piece.PAWN : ((queens & square) != 0 ? Piece.QUEEN : ((rooks & square) != 0 ? Piece.ROOK : ((bishops & square) != 0 ? Piece.BISHOP : ((knights & square) != 0 ? Piece.KNIGHT : ((kings & square) != 0 ? Piece.KING : '.'))))));
}

Fixed version (ground truth):
public int getPieceIntAt(long square){
  return ((pawns & square) != 0 ? Piece.PAWN : ((knights & square) != 0 ? Piece.KNIGHT : ((bishops & square) != 0 ? Piece.BISHOP : ((rooks & square) != 0 ? Piece.ROOK : ((queens & square) != 0 ? Piece.QUEEN : ((kings & square) != 0 ? Piece.KING : '.'))))));
}
Program: 49736
Project: 49736
Buggy source:
public char getPieceAt(long square){
  char p=((pawns & square) != 0 ? 'p' : ((queens & square) != 0 ? 'q' : ((rooks & square) != 0 ? 'r' : ((bishops & square) != 0 ? 'b' : ((knights & square) != 0 ? 'n' : ((kings & square) != 0 ? 'k' : '.'))))));
  return ((whites & square) != 0 ? Character.toUpperCase(p) : p);
}

Fixed version (ground truth):
public char getPieceAt(long square){
  char p=((pawns & square) != 0 ? 'p' : ((knights & square) != 0 ? 'n' : ((bishops & square) != 0 ? 'b' : ((rooks & square) != 0 ? 'r' : ((queens & square) != 0 ? 'q' : ((kings & square) != 0 ? 'k' : '.'))))));
  return ((whites & square) != 0 ? Character.toUpperCase(p) : p);
}
Program: 49737
Project: 49737
Buggy source:
private int evalAttacks(Board board,AttacksInfo ai,int us){
  long pawnAttacks=ai.pawnAttacks[W] & (us == 0 ? board.whites : board.blacks);
  int attacks=PAWN_ATTACKS[Piece.KNIGHT] * BitboardUtils.popCount(pawnAttacks & board.knights) + PAWN_ATTACKS[Piece.BISHOP] * BitboardUtils.popCount(pawnAttacks & board.bishops) + PAWN_ATTACKS[Piece.ROOK] * BitboardUtils.popCount(pawnAttacks & board.rooks) + PAWN_ATTACKS[Piece.QUEEN] * BitboardUtils.popCount(pawnAttacks & board.queens);
  long otherWeak=(us == 0 ? board.blacks : board.whites) & ai.attackedSquares[us] & ~ai.pawnAttacks[1 - us];
  if (otherWeak != 0) {
    long attackedByMinor=otherWeak & (ai.knightAttacks[us] | ai.bishopAttacks[us]);
    while (attackedByMinor != 0) {
      long lsb=BitboardUtils.lsb(attackedByMinor);
      attacks+=MINOR_ATTACKS[board.getPieceIntAt(lsb)];
      attackedByMinor&=~lsb;
    }
    long attackedByMajor=otherWeak & (ai.rookAttacks[us] | ai.queenAttacks[us]);
    while (attackedByMajor != 0) {
      long lsb=BitboardUtils.lsb(attackedByMajor);
      attacks+=MAJOR_ATTACKS[board.getPieceIntAt(lsb)];
      attackedByMajor&=~lsb;
    }
  }
  return attacks;
}

Fixed version (ground truth):
private int evalAttacks(Board board,AttacksInfo ai,int us){
  int attacks=0;
  long others=(us == 0 ? board.blacks : board.whites);
  long attackedByPawn=others & ai.pawnAttacks[us];
  while (attackedByPawn != 0) {
    long lsb=BitboardUtils.lsb(attackedByPawn);
    attacks+=PAWN_ATTACKS[board.getPieceIntAt(lsb)];
    attackedByPawn&=~lsb;
  }
  long otherWeak=others & ai.attackedSquares[us] & ~ai.pawnAttacks[1 - us];
  if (otherWeak != 0) {
    long attackedByMinor=otherWeak & (ai.knightAttacks[us] | ai.bishopAttacks[us]);
    while (attackedByMinor != 0) {
      long lsb=BitboardUtils.lsb(attackedByMinor);
      attacks+=MINOR_ATTACKS[board.getPieceIntAt(lsb)];
      attackedByMinor&=~lsb;
    }
    long attackedByMajor=otherWeak & (ai.rookAttacks[us] | ai.queenAttacks[us]);
    while (attackedByMajor != 0) {
      long lsb=BitboardUtils.lsb(attackedByMajor);
      attacks+=MAJOR_ATTACKS[board.getPieceIntAt(lsb)];
      attackedByMajor&=~lsb;
    }
  }
  long superiorAttacks=others & ai.pawnAttacks[us] & (board.knights | board.bishops | board.rooks| board.queens) | others & (ai.knightAttacks[us] | ai.bishopAttacks[us]) & (board.rooks | board.queens) | others & ai.rookAttacks[us] & board.queens;
  int superiorAttacksCount=BitboardUtils.popCount(superiorAttacks);
  if (superiorAttacksCount >= 2) {
    attacks+=superiorAttacksCount * HUNG_PIECES;
  }
  return attacks;
}
Program: 49738
Project: 49738
Buggy source:
public void run(){
  setSearchLimits(searchParameters);
  try {
    newRun();
    while (true) {
      runStepped();
    }
  }
 catch (  SearchFinishedException ignored) {
  }
  finishRun();
}

Fixed version (ground truth):
public void run(){
  try {
    newRun();
    while (true) {
      runStepped();
    }
  }
 catch (  SearchFinishedException ignored) {
  }
  finishRun();
}
Program: 49739
Project: 49739
Buggy source:
private void runStepped() throws SearchFinishedException {
  selDepth=0;
  int failHighCount=0;
  int failLowCount=0;
  int initialScore=rootScore;
  int alpha=(initialScore - aspWindows[failLowCount] > -Evaluator.VICTORY ? initialScore - aspWindows[failLowCount] : -Evaluator.VICTORY);
  int beta=(initialScore + aspWindows[failHighCount] < Evaluator.VICTORY ? initialScore + aspWindows[failHighCount] : Evaluator.VICTORY);
  while (true) {
    aspirationWindowProbe++;
    rootScore=search(NODE_ROOT,depth * PLY,alpha,beta,false,0);
    if (rootScore <= alpha) {
      failLowCount++;
      alpha=(failLowCount < aspWindows.length && (initialScore - aspWindows[failLowCount] > -Evaluator.VICTORY) ? initialScore - aspWindows[failLowCount] : -Evaluator.VICTORY);
    }
 else     if (rootScore >= beta) {
      failHighCount++;
      beta=(failHighCount < aspWindows.length && (initialScore + aspWindows[failHighCount] < Evaluator.VICTORY) ? initialScore + aspWindows[failHighCount] : Evaluator.VICTORY);
    }
 else {
      aspirationWindowHit++;
      break;
    }
  }
  if ((thinkToTime != Long.MAX_VALUE) && ((rootScore <= -VALUE_IS_MATE) || (rootScore > VALUE_IS_MATE))) {
    throw new SearchFinishedException();
  }
  depth++;
  if (depth == MAX_DEPTH || depth > thinkToDepth) {
    throw new SearchFinishedException();
  }
}

Fixed version (ground truth):
private void runStepped() throws SearchFinishedException {
  selDepth=0;
  int failHighCount=0;
  int failLowCount=0;
  int initialScore=rootScore;
  int alpha=(initialScore - aspWindows[failLowCount] > -Evaluator.VICTORY ? initialScore - aspWindows[failLowCount] : -Evaluator.VICTORY);
  int beta=(initialScore + aspWindows[failHighCount] < Evaluator.VICTORY ? initialScore + aspWindows[failHighCount] : Evaluator.VICTORY);
  while (true) {
    aspirationWindowProbe++;
    rootScore=search(NODE_ROOT,depth * PLY,alpha,beta,false,0);
    if (rootScore <= alpha) {
      failLowCount++;
      alpha=(failLowCount < aspWindows.length && (initialScore - aspWindows[failLowCount] > -Evaluator.VICTORY) ? initialScore - aspWindows[failLowCount] : -Evaluator.VICTORY);
    }
 else     if (rootScore >= beta) {
      failHighCount++;
      beta=(failHighCount < aspWindows.length && (initialScore + aspWindows[failHighCount] < Evaluator.VICTORY) ? initialScore + aspWindows[failHighCount] : Evaluator.VICTORY);
    }
 else {
      aspirationWindowHit++;
      break;
    }
  }
  if (depth <= 6) {
    notifyMoveFound(globalBestMove,bestMoveScore,alpha,beta);
  }
  depth++;
  if (((thinkToTime != Long.MAX_VALUE) && ((rootScore <= -VALUE_IS_MATE) || (rootScore > VALUE_IS_MATE))) || (depth == MAX_DEPTH) || (depth > thinkToDepth)) {
    throw new SearchFinishedException();
  }
}
Program: 49740
Project: 49740
Buggy source:
private void newRun() throws SearchFinishedException {
  foundOneMove=false;
  searching=true;
  logger.debug("String_Node_Str" + board);
  positionCounter=0;
  pvPositionCounter=0;
  qsPositionCounter=0;
  globalBestMove=Move.NONE;
  ponderMove=Move.NONE;
  pv=null;
  initialPly=board.getMoveNumber();
  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;
  rootScore=evaluate(tt.search(board,0,false),0);
  tt.newGeneration();
  aspWindows=config.getAspirationWindowSizes();
}

Fixed version (ground truth):
private void newRun() throws SearchFinishedException {
  startTime=System.currentTimeMillis();
  setSearchLimits(searchParameters);
  foundOneMove=false;
  searching=true;
  logger.debug("String_Node_Str" + board);
  positionCounter=0;
  pvPositionCounter=0;
  qsPositionCounter=0;
  globalBestMove=Move.NONE;
  ponderMove=Move.NONE;
  pv=null;
  initialPly=board.getMoveNumber();
  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;
  rootScore=evaluate(tt.search(board,0,false),0);
  tt.newGeneration();
  aspWindows=config.getAspirationWindowSizes();
}
Program: 49741
Project: 49741
Buggy source:
public void setSearchLimits(SearchParameters searchParameters){
  startTime=System.currentTimeMillis();
  thinkToNodes=searchParameters.getNodes();
  thinkToDepth=searchParameters.getDepth();
  thinkToTime=searchParameters.calculateMoveTime(board,startTime);
}

Fixed version (ground truth):
public void setSearchLimits(SearchParameters searchParameters){
  thinkToNodes=searchParameters.getNodes();
  thinkToDepth=searchParameters.getDepth();
  thinkToTime=searchParameters.calculateMoveTime(board,startTime);
}
Program: 49742
Project: 49742
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=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];
}

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];
    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];
}