nus-yam/ex-repair huggingface dataset:
Program: 49834
Project: 49834
Buggy source:
public static JSONObject queryDefacto(String subjectUri,String propertyUri,String objectUri,List<String> languages,String from,String to,Map<String,String> subjectLabels,Map<String,String> objectLabels,Map<String,Set<String>> altSubjectLabels,Map<String,Set<String>> altObjectLabels) throws UniformInterfaceException, ClientHandlerException, JSONException {
  MultivaluedMap<String,String> queryParams=new MultivaluedMapImpl();
  queryParams.add("String_Node_Str",subjectUri);
  for (  String lang : languages) {
    queryParams.add("String_Node_Str",subjectLabels.get(lang) + "String_Node_Str" + lang);
    for (    String altLabel : altSubjectLabels.get(lang)) {
      queryParams.add("String_Node_Str",altLabel + "String_Node_Str" + lang);
    }
  }
  queryParams.add("String_Node_Str",propertyUri);
  queryParams.add("String_Node_Str",objectUri);
  for (  String lang : languages) {
    queryParams.add("String_Node_Str",objectLabels.get(lang) + "String_Node_Str" + lang);
    for (    String altLabel : altObjectLabels.get(lang)) {
      queryParams.add("String_Node_Str",altLabel + "String_Node_Str" + lang);
    }
  }
  for (  String lang : languages)   queryParams.add("String_Node_Str",lang);
  queryParams.add("String_Node_Str",from);
  queryParams.add("String_Node_Str",to);
  return new JSONObject(webResource.queryParams(queryParams).post(String.class));
}

Fixed version (ground truth):
public static JSONObject queryDefacto(String subjectUri,String propertyUri,String objectUri,List<String> languages,String from,String to,String contextSize,Map<String,String> subjectLabels,Map<String,String> objectLabels,Map<String,Set<String>> altSubjectLabels,Map<String,Set<String>> altObjectLabels) throws UniformInterfaceException, ClientHandlerException, JSONException {
  MultivaluedMap<String,String> queryParams=new MultivaluedMapImpl();
  queryParams.add("String_Node_Str",subjectUri);
  for (  String lang : languages) {
    queryParams.add("String_Node_Str",subjectLabels.get(lang) + "String_Node_Str" + lang);
    for (    String altLabel : altSubjectLabels.get(lang)) {
      queryParams.add("String_Node_Str",altLabel + "String_Node_Str" + lang);
    }
  }
  queryParams.add("String_Node_Str",propertyUri);
  queryParams.add("String_Node_Str",objectUri);
  for (  String lang : languages) {
    queryParams.add("String_Node_Str",objectLabels.get(lang) + "String_Node_Str" + lang);
    for (    String altLabel : altObjectLabels.get(lang)) {
      queryParams.add("String_Node_Str",altLabel + "String_Node_Str" + lang);
    }
  }
  for (  String lang : languages)   queryParams.add("String_Node_Str",lang);
  queryParams.add("String_Node_Str",contextSize);
  queryParams.add("String_Node_Str",from);
  queryParams.add("String_Node_Str",to);
  return new JSONObject(webResource.queryParams(queryParams).post(String.class));
}
Program: 49837
Project: 49837
Buggy source:
/** 
 * @param models
 * @return
 */
public static void checkFacts(DefactoConfig config,List<DefactoModel> defactoModel){
  SubjectObjectFactSearcher.getInstance();
  startTime=System.currentTimeMillis();
  numberOfModels=defactoModel.size();
  currentModel=1;
  DEFACTO_CONFIG=config;
  for (  DefactoModel model : defactoModel) {
    if (currentModel++ < 80)     continue;
    Evidence evidence=checkFact(model);
    System.out.println(model.getFact());
    if (!Defacto.DEFACTO_CONFIG.getBooleanSetting("String_Node_Str","String_Node_Str"))     System.out.println("String_Node_Str" + new DecimalFormat("String_Node_Str").format(evidence.getDeFactoScore()) + "String_Node_Str"+ model.isCorrect()+ "String_Node_Str");
  }
  if (DEFACTO_CONFIG.getBooleanSetting("String_Node_Str","String_Node_Str"))   writeFactTrainingDataFile();
  if (DEFACTO_CONFIG.getBooleanSetting("String_Node_Str","String_Node_Str"))   writeEvidenceTrainingDataFile();
}

Fixed version (ground truth):
/** 
 * @param models
 * @return
 */
public static void checkFacts(DefactoConfig config,List<DefactoModel> defactoModel){
  SubjectObjectFactSearcher.getInstance();
  startTime=System.currentTimeMillis();
  numberOfModels=defactoModel.size();
  currentModel=1;
  DEFACTO_CONFIG=config;
  for (  DefactoModel model : defactoModel) {
    Evidence evidence=checkFact(model);
    if (!Defacto.DEFACTO_CONFIG.getBooleanSetting("String_Node_Str","String_Node_Str"))     System.out.println("String_Node_Str" + new DecimalFormat("String_Node_Str").format(evidence.getDeFactoScore()) + "String_Node_Str"+ model.isCorrect()+ "String_Node_Str");
    if (DEFACTO_CONFIG.getBooleanSetting("String_Node_Str","String_Node_Str"))     writeEvidenceTrainingDataFile();
  }
  if (DEFACTO_CONFIG.getBooleanSetting("String_Node_Str","String_Node_Str"))   writeFactTrainingDataFile();
}
Program: 49838
Project: 49838
Buggy source:
/** 
 * @param args
 * @throws IOException 
 */
public static void main(String[] args) throws IOException {
  org.apache.log4j.PropertyConfigurator.configure("String_Node_Str");
  DefactoConfig config=new DefactoConfig(new Ini(new File("String_Node_Str")));
  List<String> pathToFalseData=new ArrayList<String>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  for (  String falseDataDir : pathToFalseData) {
    AbstractFeature.provenance=new Instances("String_Node_Str",AbstractFeature.attributes,0);
    config.setStringSetting("String_Node_Str","String_Node_Str","String_Node_Str" + falseDataDir + "String_Node_Str");
    Defacto.checkFacts(config,getTrainingData(falseDataDir));
  }
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws IOException 
 */
public static void main(String[] args) throws IOException {
  org.apache.log4j.PropertyConfigurator.configure("String_Node_Str");
  DefactoConfig config=new DefactoConfig(new Ini(new File("String_Node_Str")));
  List<String> pathToFalseData=new ArrayList<String>(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  for (  String falseDataDir : pathToFalseData) {
    AbstractFeature.provenance=new Instances("String_Node_Str",AbstractFeature.attributes,0);
    config.setStringSetting("String_Node_Str","String_Node_Str","String_Node_Str" + falseDataDir + "String_Node_Str");
    System.out.println("String_Node_Str" + falseDataDir);
    Defacto.checkFacts(config,getTrainingData(falseDataDir));
  }
}
Program: 49839
Project: 49839
Buggy source:
@Override public String generateQuery(MetaQuery query){
  String subject=query.getSubjectLabel();
  String property=normalizePredicate(query.getPropertyLabel().substring(0,query.getPropertyLabel().length() - 3).substring(3).trim());
  String object=query.getObjectLabel();
  String queryString="String_Node_Str";
  if (query.getTopicTerms().isEmpty()) {
    if (query.getPropertyLabel().equals("String_Node_Str"))     queryString=String.format("String_Node_Str",subject,object);
 else     queryString=String.format("String_Node_Str",subject,property,object);
  }
 else {
    queryString=String.format("String_Node_Str",subject,property,object);
    for (int i=0; i < 3 && i < query.getTopicTerms().size(); i++)     queryString+="String_Node_Str" + query.getTopicTerms().get(i).getWord() + "String_Node_Str";
  }
  return queryString;
}

Fixed version (ground truth):
@Override public String generateQuery(MetaQuery query){
  String subject=query.getSubjectLabel().replace("String_Node_Str","String_Node_Str");
  String property=normalizePredicate(query.getPropertyLabel().substring(0,query.getPropertyLabel().length() - 3).substring(3).trim());
  String object=query.getObjectLabel().replace("String_Node_Str","String_Node_Str");
  String queryString="String_Node_Str";
  if (query.getTopicTerms().isEmpty()) {
    if (query.getPropertyLabel().equals("String_Node_Str"))     queryString=String.format("String_Node_Str",subject,object);
 else     queryString=String.format("String_Node_Str",subject,property,object);
  }
 else {
    queryString=String.format("String_Node_Str",subject,property,object);
    for (int i=0; i < 3 && i < query.getTopicTerms().size(); i++)     queryString+="String_Node_Str" + query.getTopicTerms().get(i).getWord() + "String_Node_Str";
  }
  return queryString;
}
Program: 49840
Project: 49840
Buggy source:
@Override public String readPage(String url,int timeout){
  try {
    return Jsoup.connect(url).timeout(timeout).get().text();
  }
 catch (  Throwable e) {
    if (e.getMessage().contains("String_Node_Str") || e.getMessage().contains("String_Node_Str") || e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e instanceof UnknownHostException|| e instanceof SSLHandshakeException|| e instanceof SocketException) {
      logger.debug(String.format("String_Node_Str",url));
    }
 else     logger.error(String.format("String_Node_Str",url),e);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String readPage(String url,int timeout){
  try {
    return Jsoup.connect(url).timeout(timeout).get().text();
  }
 catch (  Throwable e) {
    if (e.getMessage().contains("String_Node_Str") || e.getMessage().contains("String_Node_Str") || e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e.getMessage().contains("String_Node_Str")|| e instanceof UnknownHostException|| e instanceof SSLHandshakeException|| e instanceof SocketException) {
      logger.debug(String.format("String_Node_Str",url));
    }
 else     logger.error(String.format("String_Node_Str",url),e);
  }
  return "String_Node_Str";
}
Program: 49841
Project: 49841
Buggy source:
public static String fixName(String n){
  if (n.contains("String_Node_Str")) {
    n=n.replace("String_Node_Str","String_Node_Str");
  }
  if (n.equals("String_Node_Str")) {
    n="String_Node_Str";
  }
  return Character.toUpperCase(n.charAt(0)) + n.substring(1);
}

Fixed version (ground truth):
public static String fixName(String n){
  if (n.contains("String_Node_Str")) {
    n=n.replace("String_Node_Str","String_Node_Str");
  }
  return Character.toUpperCase(n.charAt(0)) + n.substring(1);
}
Program: 49842
Project: 49842
Buggy source:
@Override public void onPostLoad(){
  for (  LiquidDictionary.LiquidRegisterEvent e : events) {
    liquids.processLiquidFromDictionary(e);
  }
  containers=new LRContainerManager();
  if (LRItems.barrel != null) {
    containers.registerContainer(LRItems.barrelEmpty,LRItems.barrel,PfF.Proxy.translate("String_Node_Str"),PfFTuning.getInt(PfFTuning.Items.barrel_capacity),Blacklists.barrel);
  }
  if (LRItems.capsule != null) {
    containers.registerContainer(Forestry.items("String_Node_Str"),LRItems.capsule,PfF.Proxy.translate("String_Node_Str"),LiquidContainerRegistry.BUCKET_VOLUME,Blacklists.capsule);
  }
  if (LRItems.rcapsule != null) {
    containers.registerContainer(Forestry.items("String_Node_Str"),LRItems.rcapsule,PfF.Proxy.translate("String_Node_Str"),LiquidContainerRegistry.BUCKET_VOLUME,Blacklists.capsule);
  }
  if (LRItems.can != null) {
    containers.registerContainer(Forestry.items("String_Node_Str"),LRItems.can,PfF.Proxy.translate("String_Node_Str"),LiquidContainerRegistry.BUCKET_VOLUME,Blacklists.capsule);
  }
  bucket=new LRBucketManager(LRItems.bucket,Blacklists.ironBucket);
  if (LRItems.ItemStackWoodenBucketEmpty != null) {
    woodenBucket=new LRBucketManager(LRItems.woodenBucket,Blacklists.woodenBucket);
  }
}

Fixed version (ground truth):
@Override public void onPostLoad(){
  for (  LiquidDictionary.LiquidRegisterEvent e : events) {
    liquids.processLiquidFromDictionary(e);
  }
  containers=new LRContainerManager();
  if (LRItems.barrel != null) {
    containers.registerContainer(LRItems.barrelEmpty,LRItems.barrel,PfF.Proxy.translate("String_Node_Str"),PfFTuning.getInt(PfFTuning.Barrel.barrel_capacity),Blacklists.barrel);
  }
  if (LRItems.capsule != null) {
    containers.registerContainer(Forestry.items("String_Node_Str"),LRItems.capsule,PfF.Proxy.translate("String_Node_Str"),LiquidContainerRegistry.BUCKET_VOLUME,Blacklists.capsule);
  }
  if (LRItems.rcapsule != null) {
    containers.registerContainer(Forestry.items("String_Node_Str"),LRItems.rcapsule,PfF.Proxy.translate("String_Node_Str"),LiquidContainerRegistry.BUCKET_VOLUME,Blacklists.capsule);
  }
  if (LRItems.can != null) {
    containers.registerContainer(Forestry.items("String_Node_Str"),LRItems.can,PfF.Proxy.translate("String_Node_Str"),LiquidContainerRegistry.BUCKET_VOLUME,Blacklists.capsule);
  }
  bucket=new LRBucketManager(LRItems.bucket,Blacklists.ironBucket);
  if (LRItems.ItemStackWoodenBucketEmpty != null) {
    woodenBucket=new LRBucketManager(LRItems.woodenBucket,Blacklists.woodenBucket);
  }
}
Program: 49843
Project: 49843
Buggy source:
public static boolean isPluginLoaded(String var0){
  try {
    Class var2=Class.forName("String_Node_Str");
    Method var3=var2.getMethod("String_Node_Str",new Class[]{String.class});
    String var4=var3.invoke((Object)null,new Object[]{var0}).toString();
    boolean var1;
    if (var4.toLowerCase().equals("String_Node_Str")) {
      var1=true;
    }
 else {
      var1=false;
    }
    return var1;
  }
 catch (  Exception var5) {
    var5.printStackTrace();
    return false;
  }
}

Fixed version (ground truth):
public static boolean isPluginLoaded(String var0){
  String var2=API.class.getPackage().toString();
  String var3="String_Node_Str";
  String var4="String_Node_Str";
  if (!var2.equals(var3)) {
    var4="String_Node_Str" + var4;
  }
  try {
    Class var5=Class.forName(var4);
    Method var6=var5.getMethod("String_Node_Str",new Class[]{String.class});
    String var7=var6.invoke((Object)null,new Object[]{var0}).toString();
    boolean var1;
    if (var7.toLowerCase().equals("String_Node_Str")) {
      var1=true;
    }
 else {
      var1=false;
    }
    return var1;
  }
 catch (  Exception var8) {
    var8.printStackTrace();
    return false;
  }
}
Program: 49844
Project: 49844
Buggy source:
public static boolean isPluginLoaded(String name){
  boolean loaded;
  try {
    Class pluginCore=Class.forName("String_Node_Str");
    Method isPluginAlive=pluginCore.getMethod("String_Node_Str",new Class[]{String.class});
    String l=isPluginAlive.invoke(null,name).toString();
    if (l.toLowerCase().equals("String_Node_Str")) {
      if (API.verbose) {
        System.out.println(name + "String_Node_Str");
      }
      loaded=true;
    }
 else {
      if (API.verbose) {
        System.out.println(name + "String_Node_Str");
      }
      loaded=false;
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    return false;
  }
  return loaded;
}

Fixed version (ground truth):
public static boolean isPluginLoaded(String name){
  boolean loaded;
  String Package=API.class.getPackage().toString();
  String expectedSSP="String_Node_Str";
  String pluginCore_Class="String_Node_Str";
  if (!Package.equals(expectedSSP)) {
    pluginCore_Class="String_Node_Str" + pluginCore_Class;
  }
  try {
    Class pluginCore=Class.forName(pluginCore_Class);
    Method isPluginAlive=pluginCore.getMethod("String_Node_Str",new Class[]{String.class});
    String l=isPluginAlive.invoke(null,name).toString();
    if (l.toLowerCase().equals("String_Node_Str")) {
      if (API.verbose) {
        System.out.println(name + "String_Node_Str");
      }
      loaded=true;
    }
 else {
      if (API.verbose) {
        System.out.println(name + "String_Node_Str");
      }
      loaded=false;
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    return false;
  }
  return loaded;
}
Program: 49845
Project: 49845
Buggy source:
public static boolean isPluginLoaded(String name){
  boolean loaded;
  try {
    Class pluginCore=Class.forName("String_Node_Str");
    Method isPluginAlive=pluginCore.getMethod("String_Node_Str",new Class[]{String.class});
    String l=isPluginAlive.invoke(null,name).toString();
    if (l.toLowerCase().equals("String_Node_Str")) {
      if (API.verbose) {
        System.out.println(name + "String_Node_Str");
      }
      loaded=true;
    }
 else {
      if (API.verbose) {
        System.out.println(name + "String_Node_Str");
      }
      loaded=false;
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    return false;
  }
  return loaded;
}

Fixed version (ground truth):
public static boolean isPluginLoaded(String name){
  boolean loaded;
  String Package=API.class.getPackage().toString();
  String expectedSSP="String_Node_Str";
  String pluginCore_Class="String_Node_Str";
  if (!Package.equals(expectedSSP)) {
    pluginCore_Class="String_Node_Str" + pluginCore_Class;
  }
  try {
    Class pluginCore=Class.forName(pluginCore_Class);
    Method isPluginAlive=pluginCore.getMethod("String_Node_Str",new Class[]{String.class});
    String l=isPluginAlive.invoke(null,name).toString();
    if (l.toLowerCase().equals("String_Node_Str")) {
      if (API.verbose) {
        System.out.println(name + "String_Node_Str");
      }
      loaded=true;
    }
 else {
      if (API.verbose) {
        System.out.println(name + "String_Node_Str");
      }
      loaded=false;
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    return false;
  }
  return loaded;
}
Program: 49846
Project: 49846
Buggy source:
public BoardPanel(BoardSize boardSize,SquareConfig squareConfig,Function<BoardCoordinate,Set<BoardCoordinate>> getMovesCallback){
  super(false);
  mSquareConfig=squareConfig;
  mGetMovesCallback=getMovesCallback;
  mBoardSize=boardSize;
  mSquareLabels=new ArrayList<>(boardSize.width * boardSize.height);
  GridLayout gridLayout=new GridLayout(mBoardSize.width + 2,mBoardSize.height + 2);
  setLayout(gridLayout);
  createGrid(gridLayout);
}

Fixed version (ground truth):
public BoardPanel(BoardSize boardSize,SquareConfig squareConfig,Function<BoardCoordinate,Set<BoardCoordinate>> getMovesCallback){
  super(false);
  mSquareConfig=squareConfig;
  mGetMovesCallback=getMovesCallback;
  mBoardSize=boardSize;
  mSquareLabels=new ArrayList<>(boardSize.width * boardSize.height);
  GridLayout gridLayout=new GridLayout(mBoardSize.height + 1,mBoardSize.width + 2);
  setLayout(gridLayout);
  createGrid(gridLayout);
}
Program: 49847
Project: 49847
Buggy source:
private void createGrid(GridLayout gridLayout){
  for (int y=gridLayout.getRows() - 1; y >= 0; y--) {
    for (int x=0; x < gridLayout.getColumns(); x++) {
      add(getComponentForCell(x,y,gridLayout.getColumns() - 1,gridLayout.getRows() - 1));
    }
  }
}

Fixed version (ground truth):
private void createGrid(GridLayout gridLayout){
  for (int y=gridLayout.getRows() - 1; y >= 0; y--) {
    for (int x=0; x < gridLayout.getColumns(); x++) {
      add(getComponentForCell(x,y,gridLayout.getColumns() - 1));
    }
  }
}
Program: 49848
Project: 49848
Buggy source:
public void updateDimensions(int width,int height){
  int size=Math.min(width,height);
  setMinimumSize(new Dimension(size,size));
  setPreferredSize(new Dimension(size,size));
  setMaximumSize(new Dimension(size,size));
  revalidate();
  repaint();
}

Fixed version (ground truth):
public void updateDimensions(int width,int height){
  int newHeight=height;
  int newWidth=width;
  if (width < height) {
    newHeight=(width / (mBoardSize.width + 2)) * (mBoardSize.height + 1);
  }
 else {
    newWidth=(height / (mBoardSize.height + 1)) * (mBoardSize.width + 2);
  }
  setMinimumSize(new Dimension(newWidth,newHeight));
  setPreferredSize(new Dimension(newWidth,newHeight));
  setMaximumSize(new Dimension(newWidth,newHeight));
  revalidate();
  repaint();
}
Program: 49849
Project: 49849
Buggy source:
private JLabel getComponentForCell(int x,int y,int maxColumns,int maxRows){
  if ((x == 0 && y == 0) || (x == maxColumns) || (y == maxRows)) {
    return UiUtility.createJLabel("String_Node_Str");
  }
 else   if (x == 0) {
    JLabel label=UiUtility.createJLabel(String.valueOf(y));
    label.setHorizontalAlignment(SwingConstants.CENTER);
    return label;
  }
 else   if (y == 0) {
    JLabel label=UiUtility.createJLabel(String.valueOf((char)(x - 1 + 'A')));
    label.setHorizontalAlignment(SwingConstants.CENTER);
    return label;
  }
 else {
    SquareJLabel square=new SquareJLabel(BoardCoordinate.at(x,y));
    mSquareConfig.configureSquare(square,() -> {
      Set<BoardCoordinate> coordinates=mGetMovesCallback.apply(square.getCoordinates());
      return !coordinates.isEmpty() ? getLabelsForCoordinates(coordinates) : Collections.emptyList();
    }
);
    mSquareLabels.add(square);
    return square;
  }
}

Fixed version (ground truth):
private JLabel getComponentForCell(int x,int y,int maxColumns){
  if ((x == 0 && y == 0) || x == maxColumns) {
    return UiUtility.createJLabel("String_Node_Str");
  }
 else   if (x == 0) {
    JLabel label=UiUtility.createJLabel(String.valueOf(y));
    label.setHorizontalAlignment(SwingConstants.CENTER);
    return label;
  }
 else   if (y == 0) {
    JLabel label=UiUtility.createJLabel(String.valueOf((char)(x - 1 + 'A')));
    label.setHorizontalAlignment(SwingConstants.CENTER);
    return label;
  }
 else {
    SquareJLabel square=new SquareJLabel(BoardCoordinate.at(x,y));
    mSquareConfig.configureSquare(square,() -> {
      Set<BoardCoordinate> coordinates=mGetMovesCallback.apply(square.getCoordinates());
      return !coordinates.isEmpty() ? getLabelsForCoordinates(coordinates) : Collections.emptyList();
    }
);
    mSquareLabels.add(square);
    return square;
  }
}
Program: 49852
Project: 49852
Buggy source:
public void loadPieceType(PieceType pieceType){
  clearPieceData();
  Icon pieceIcon=PieceIconUtility.getPieceIcon(pieceType.getInternalId(),Color.WHITE);
  mImageButton.setIcon(pieceIcon);
  mImageButton.setPressedIcon(pieceIcon);
  mPieceNameField.setText(pieceType.getName());
  pieceType.getMovements().forEach(mMovementData.model::addElement);
  pieceType.getCapturingMovements().forEach(mCapturingData.model::addElement);
  pieceType.getTwoHopMovements().forEach(mTwoHopData.model::addElement);
  mBoard.addPiece(new Piece(Piece.TEAM_ONE,pieceType),BoardCoordinate.at(4,4));
  dataStream().forEach(this::refreshButtonState);
  refreshBoard();
}

Fixed version (ground truth):
public void loadPieceType(PieceType pieceType){
  clearPieceData();
  Icon pieceIcon=PieceIconUtility.getPieceIcon(pieceType.getInternalId(),Color.WHITE);
  mImageButton.setIcon(pieceIcon);
  mImageButton.setPressedIcon(pieceIcon);
  mPieceNameField.setText(pieceType.getName());
  pieceType.getMovements().forEach(mMovementData.model::addElement);
  pieceType.getCapturingMovements().forEach(mCapturingData.model::addElement);
  pieceType.getTwoHopMovements().forEach(mTwoHopData.model::addElement);
  mBoard.addPiece(new Piece(Piece.TEAM_ONE,pieceType),BoardCoordinate.at(mBoard.getBoardSize().width / 2,mBoard.getBoardSize().height / 2));
  dataStream().forEach(this::refreshButtonState);
  refreshBoard();
}
Program: 49853
Project: 49853
Buggy source:
private void deletePiece(){
  PieceType pieceType=mPieceList.getSelectedValue();
  Preconditions.checkState(!PieceTypeManager.INSTANCE.isSystemPiece(pieceType.getInternalId()));
  if (FileManager.INSTANCE.deletePiece(pieceType)) {
    PieceTypeManager.INSTANCE.unregisterPieceType(pieceType);
    mPieceListModel.removeElement(pieceType);
  }
 else {
  }
}

Fixed version (ground truth):
private void deletePiece(){
  PieceType pieceType=mPieceList.getSelectedValue();
  Preconditions.checkState(!PieceTypeManager.INSTANCE.isSystemPiece(pieceType.getInternalId()));
  if (FileManager.INSTANCE.deletePiece(pieceType)) {
    PieceTypeManager.INSTANCE.unregisterPieceType(pieceType.getInternalId());
    mPieceListModel.removeElement(pieceType);
  }
 else {
  }
}
Program: 49854
Project: 49854
Buggy source:
private void initComponents(){
  GridBagConstraints constraints=new GridBagConstraints();
  setLayout(new GridBagLayout());
  JPanel teamMetaData=new JPanel();
  teamMetaData.setOpaque(false);
  teamMetaData.setLayout(new GridBagLayout());
  teamMetaData.setBorder(BorderFactory.createTitledBorder(Messages.getString("String_Node_Str")));
  GridBagConstraints teamConstraint=new GridBagConstraints();
  teamConstraint.fill=GridBagConstraints.BOTH;
  teamConstraint.gridx=0;
  teamConstraint.gridy=0;
  teamConstraint.insets=new Insets(5,0,5,5);
  teamMetaData.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.weightx=1.0;
  teamConstraint.gridx=1;
  teamConstraint.insets=new Insets(5,0,5,0);
  teamMetaData.add(mPlayerName,teamConstraint);
  teamConstraint.gridx=0;
  teamConstraint.gridy=1;
  teamConstraint.weightx=0.0;
  teamMetaData.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.gridx=1;
  teamConstraint.weightx=1.0;
  teamMetaData.add(mTeamLabel,teamConstraint);
  teamConstraint.gridy=2;
  teamConstraint.gridx=0;
  teamConstraint.gridwidth=2;
  teamConstraint.weighty=0.1;
  teamConstraint.weightx=1.0;
  teamMetaData.add(mJailPanel,teamConstraint);
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.fill=GridBagConstraints.BOTH;
  constraints.gridy=0;
  constraints.weightx=1.0;
  constraints.weighty=0.5;
  constraints.gridwidth=2;
  constraints.insets=new Insets(10,10,10,10);
  add(teamMetaData,constraints);
}

Fixed version (ground truth):
private void initComponents(){
  GridBagConstraints constraints=new GridBagConstraints();
  setLayout(new GridBagLayout());
  JPanel teamMetadata=new JPanel();
  teamMetadata.setOpaque(false);
  teamMetadata.setLayout(new GridBagLayout());
  teamMetadata.setBorder(BorderFactory.createTitledBorder(Messages.getString("String_Node_Str")));
  GridBagConstraints teamConstraint=new GridBagConstraints();
  teamConstraint.fill=GridBagConstraints.BOTH;
  teamConstraint.gridx=0;
  teamConstraint.gridy=0;
  teamConstraint.insets=new Insets(5,0,5,5);
  teamMetadata.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.weightx=1.0;
  teamConstraint.gridx=1;
  teamConstraint.insets=new Insets(5,0,5,0);
  teamMetadata.add(mPlayerName,teamConstraint);
  teamConstraint.gridx=0;
  teamConstraint.gridy=1;
  teamConstraint.weightx=0.0;
  teamMetadata.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.gridx=1;
  teamConstraint.weightx=1.0;
  teamMetadata.add(mTeamLabel,teamConstraint);
  teamConstraint.gridy=2;
  teamConstraint.gridx=0;
  teamConstraint.gridwidth=2;
  teamConstraint.weighty=0.1;
  teamConstraint.weightx=1.0;
  teamMetadata.add(mJailPanel,teamConstraint);
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.fill=GridBagConstraints.BOTH;
  constraints.gridy=0;
  constraints.weightx=1.0;
  constraints.weighty=0.5;
  constraints.gridwidth=2;
  constraints.insets=new Insets(10,10,10,10);
  add(teamMetadata,constraints);
}
Program: 49855
Project: 49855
Buggy source:
private void initComponents(){
  GridBagConstraints constraints=new GridBagConstraints();
  setLayout(new GridBagLayout());
  JPanel teamMetaData=new JPanel();
  teamMetaData.setOpaque(false);
  teamMetaData.setLayout(new GridBagLayout());
  teamMetaData.setBorder(BorderFactory.createTitledBorder(Messages.getString("String_Node_Str")));
  GridBagConstraints teamConstraint=new GridBagConstraints();
  teamConstraint.fill=GridBagConstraints.BOTH;
  teamConstraint.gridx=0;
  teamConstraint.gridy=0;
  teamConstraint.insets=new Insets(5,0,5,0);
  teamMetaData.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.weightx=1.0;
  teamConstraint.gridx=1;
  teamMetaData.add(mPlayerName,teamConstraint);
  teamConstraint.gridx=0;
  teamConstraint.gridy=1;
  teamConstraint.weightx=0.0;
  teamMetaData.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.gridx=1;
  teamConstraint.weightx=1.0;
  teamMetaData.add(mTeamLabel,teamConstraint);
  teamConstraint.gridy=2;
  teamConstraint.gridx=0;
  teamConstraint.gridwidth=2;
  teamConstraint.weighty=0.1;
  teamConstraint.weightx=1.0;
  teamMetaData.add(mJailPanel,teamConstraint);
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.fill=GridBagConstraints.BOTH;
  constraints.gridy=0;
  constraints.weightx=1.0;
  constraints.weighty=0.5;
  constraints.gridwidth=2;
  constraints.insets=new Insets(10,10,10,10);
  add(teamMetaData,constraints);
}

Fixed version (ground truth):
private void initComponents(){
  GridBagConstraints constraints=new GridBagConstraints();
  setLayout(new GridBagLayout());
  JPanel teamMetaData=new JPanel();
  teamMetaData.setOpaque(false);
  teamMetaData.setLayout(new GridBagLayout());
  teamMetaData.setBorder(BorderFactory.createTitledBorder(Messages.getString("String_Node_Str")));
  GridBagConstraints teamConstraint=new GridBagConstraints();
  teamConstraint.fill=GridBagConstraints.BOTH;
  teamConstraint.gridx=0;
  teamConstraint.gridy=0;
  teamConstraint.insets=new Insets(5,0,5,5);
  teamMetaData.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.weightx=1.0;
  teamConstraint.gridx=1;
  teamConstraint.insets=new Insets(5,0,5,0);
  teamMetaData.add(mPlayerName,teamConstraint);
  teamConstraint.gridx=0;
  teamConstraint.gridy=1;
  teamConstraint.weightx=0.0;
  teamMetaData.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.gridx=1;
  teamConstraint.weightx=1.0;
  teamMetaData.add(mTeamLabel,teamConstraint);
  teamConstraint.gridy=2;
  teamConstraint.gridx=0;
  teamConstraint.gridwidth=2;
  teamConstraint.weighty=0.1;
  teamConstraint.weightx=1.0;
  teamMetaData.add(mJailPanel,teamConstraint);
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.fill=GridBagConstraints.BOTH;
  constraints.gridy=0;
  constraints.weightx=1.0;
  constraints.weighty=0.5;
  constraints.gridwidth=2;
  constraints.insets=new Insets(10,10,10,10);
  add(teamMetaData,constraints);
}
Program: 49856
Project: 49856
Buggy source:
public BoardPanel(BoardSize boardSize,SquareConfig squareConfig,Function<BoardCoordinate,Set<BoardCoordinate>> getMovesCallback){
  super(false);
  mSquareConfig=squareConfig;
  mGetMovesCallback=getMovesCallback;
  mBoardSize=boardSize;
  mSquareLabels=new ArrayList<>(boardSize.width * boardSize.height);
  GridLayout gridLayout=new GridLayout(mBoardSize.width + 1,mBoardSize.height + 1);
  setLayout(gridLayout);
  createGrid(gridLayout);
}

Fixed version (ground truth):
public BoardPanel(BoardSize boardSize,SquareConfig squareConfig,Function<BoardCoordinate,Set<BoardCoordinate>> getMovesCallback){
  super(false);
  mSquareConfig=squareConfig;
  mGetMovesCallback=getMovesCallback;
  mBoardSize=boardSize;
  mSquareLabels=new ArrayList<>(boardSize.width * boardSize.height);
  GridLayout gridLayout=new GridLayout(mBoardSize.width + 2,mBoardSize.height + 2);
  setLayout(gridLayout);
  createGrid(gridLayout);
}
Program: 49857
Project: 49857
Buggy source:
private void createGrid(GridLayout gridLayout){
  for (int y=gridLayout.getRows() - 1; y >= 0; y--) {
    for (int x=0; x < gridLayout.getColumns(); x++) {
      add(getComponentForCell(x,y));
    }
  }
}

Fixed version (ground truth):
private void createGrid(GridLayout gridLayout){
  for (int y=gridLayout.getRows() - 1; y >= 0; y--) {
    for (int x=0; x < gridLayout.getColumns(); x++) {
      add(getComponentForCell(x,y,gridLayout.getColumns() - 1,gridLayout.getRows() - 1));
    }
  }
}
Program: 49858
Project: 49858
Buggy source:
private JLabel getComponentForCell(int x,int y){
  if (x == 0 && y == 0) {
    return GuiUtility.createJLabel("String_Node_Str");
  }
 else   if (x == 0) {
    JLabel label=GuiUtility.createJLabel(String.valueOf(y));
    label.setHorizontalAlignment(SwingConstants.CENTER);
    return label;
  }
 else   if (y == 0) {
    JLabel label=GuiUtility.createJLabel(String.valueOf((char)(x - 1 + 'A')));
    label.setHorizontalAlignment(SwingConstants.CENTER);
    return label;
  }
 else {
    SquareJLabel square=new SquareJLabel(BoardCoordinate.at(x,y));
    mSquareConfig.configureSquare(square,() -> {
      Set<BoardCoordinate> coordinates=mGetMovesCallback.apply(square.getCoordinates());
      return !coordinates.isEmpty() ? getLabelsForCoordinates(coordinates) : Collections.emptyList();
    }
);
    mSquareLabels.add(square);
    return square;
  }
}

Fixed version (ground truth):
private JLabel getComponentForCell(int x,int y,int maxColumns,int maxRows){
  if ((x == 0 && y == 0) || (x == maxColumns) || (y == maxRows)) {
    return GuiUtility.createJLabel("String_Node_Str");
  }
 else   if (x == 0) {
    JLabel label=GuiUtility.createJLabel(String.valueOf(y));
    label.setHorizontalAlignment(SwingConstants.CENTER);
    return label;
  }
 else   if (y == 0) {
    JLabel label=GuiUtility.createJLabel(String.valueOf((char)(x - 1 + 'A')));
    label.setHorizontalAlignment(SwingConstants.CENTER);
    return label;
  }
 else {
    SquareJLabel square=new SquareJLabel(BoardCoordinate.at(x,y));
    mSquareConfig.configureSquare(square,() -> {
      Set<BoardCoordinate> coordinates=mGetMovesCallback.apply(square.getCoordinates());
      return !coordinates.isEmpty() ? getLabelsForCoordinates(coordinates) : Collections.emptyList();
    }
);
    mSquareLabels.add(square);
    return square;
  }
}
Program: 49860
Project: 49860
Buggy source:
private void initComponents(){
  GridBagConstraints constraints=new GridBagConstraints();
  setLayout(new GridBagLayout());
  JPanel teamMetadata=new JPanel();
  teamMetadata.setOpaque(false);
  teamMetadata.setLayout(new GridBagLayout());
  teamMetadata.setBorder(BorderFactory.createTitledBorder(Messages.getString("String_Node_Str")));
  GridBagConstraints teamConstraint=new GridBagConstraints();
  teamConstraint.fill=GridBagConstraints.BOTH;
  teamConstraint.gridx=0;
  teamConstraint.gridy=0;
  teamConstraint.insets=new Insets(5,0,5,5);
  teamMetadata.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.weightx=1.0;
  teamConstraint.gridx=1;
  teamMetadata.add(mPlayerName,teamConstraint);
  teamConstraint.gridx=0;
  teamConstraint.gridy=1;
  teamConstraint.weightx=0.0;
  teamMetadata.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.gridx=1;
  teamConstraint.weightx=1.0;
  teamMetadata.add(mTeamLabel,teamConstraint);
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.fill=GridBagConstraints.BOTH;
  constraints.gridy=0;
  constraints.weightx=1.0;
  constraints.weighty=0.5;
  constraints.gridwidth=2;
  constraints.insets=new Insets(10,10,10,10);
  add(teamMetadata,constraints);
  constraints.gridy=2;
  constraints.weighty=1.0;
  constraints.weightx=1.0;
  add(mJailPanel,constraints);
}

Fixed version (ground truth):
private void initComponents(){
  GridBagConstraints constraints=new GridBagConstraints();
  setLayout(new GridBagLayout());
  JPanel teamMetaData=new JPanel();
  teamMetaData.setOpaque(false);
  teamMetaData.setLayout(new GridBagLayout());
  teamMetaData.setBorder(BorderFactory.createTitledBorder(Messages.getString("String_Node_Str")));
  GridBagConstraints teamConstraint=new GridBagConstraints();
  teamConstraint.fill=GridBagConstraints.BOTH;
  teamConstraint.gridx=0;
  teamConstraint.gridy=0;
  teamConstraint.insets=new Insets(5,0,5,0);
  teamMetaData.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.weightx=1.0;
  teamConstraint.gridx=1;
  teamMetaData.add(mPlayerName,teamConstraint);
  teamConstraint.gridx=0;
  teamConstraint.gridy=1;
  teamConstraint.weightx=0.0;
  teamMetaData.add(new JLabel(Messages.getString("String_Node_Str")),teamConstraint);
  teamConstraint.gridx=1;
  teamConstraint.weightx=1.0;
  teamMetaData.add(mTeamLabel,teamConstraint);
  teamConstraint.gridy=2;
  teamConstraint.gridx=0;
  teamConstraint.gridwidth=2;
  teamConstraint.weighty=0.1;
  teamConstraint.weightx=1.0;
  teamMetaData.add(mJailPanel,teamConstraint);
  constraints.anchor=GridBagConstraints.BASELINE;
  constraints.fill=GridBagConstraints.BOTH;
  constraints.gridy=0;
  constraints.weightx=1.0;
  constraints.weighty=0.5;
  constraints.gridwidth=2;
  constraints.insets=new Insets(10,10,10,10);
  add(teamMetaData,constraints);
}
Program: 49861
Project: 49861
Buggy source:
public TeamCreationPanel(SquareConfig squareConfig){
  super(false);
  setLayout(new GridBagLayout());
  int teamIDCounter=1;
  mTeamInfos=new ArrayList<>(2);
  mTeamNameFields=new JTextField[2];
  mTeamColorFields=new JLabel[2];
  TeamInfo white=new TeamInfo();
  white.color=Color.WHITE;
  white.teamName="String_Node_Str";
  white.teamId=teamIDCounter++;
  TeamInfo black=new TeamInfo();
  black.color=Color.BLACK;
  black.teamName="String_Node_Str";
  black.teamId=teamIDCounter;
  mTeamInfos.add(white);
  mTeamInfos.add(black);
  initComponents(squareConfig);
}

Fixed version (ground truth):
public TeamCreationPanel(SquareConfig squareConfig){
  super(false);
  setLayout(new GridBagLayout());
  int teamIDCounter=1;
  mTeamInfos=new ArrayList<>(2);
  mTeamNameFields=new JTextField[2];
  mTeamColorFields=new JTextField[2];
  TeamInfo white=new TeamInfo();
  white.color=Color.WHITE;
  white.teamName="String_Node_Str";
  white.teamId=teamIDCounter++;
  TeamInfo black=new TeamInfo();
  black.color=Color.BLACK;
  black.teamName="String_Node_Str";
  black.teamId=teamIDCounter;
  mTeamInfos.add(white);
  mTeamInfos.add(black);
  initComponents(squareConfig);
}
Program: 49862
Project: 49862
Buggy source:
private void createMouseListener(JLabel colorField,TeamInfo teamInfo){
  colorField.addMouseListener(new MouseListener(){
    @Override public void mouseClicked(    MouseEvent e){
      Color c=JColorChooser.showDialog(colorField,Messages.getString("String_Node_Str"),colorField.getBackground());
      colorField.setBackground(c);
      teamInfo.color=c;
    }
    @Override public void mousePressed(    MouseEvent e){
    }
    @Override public void mouseReleased(    MouseEvent e){
    }
    @Override public void mouseEntered(    MouseEvent e){
    }
    @Override public void mouseExited(    MouseEvent e){
    }
  }
);
}

Fixed version (ground truth):
private void createMouseListener(JTextField colorField,TeamInfo teamInfo){
  colorField.addMouseListener(new MouseListener(){
    @Override public void mouseClicked(    MouseEvent e){
      Color c=JColorChooser.showDialog(colorField,Messages.getString("String_Node_Str"),colorField.getBackground());
      colorField.setBackground(c);
      teamInfo.color=c;
    }
    @Override public void mousePressed(    MouseEvent e){
    }
    @Override public void mouseReleased(    MouseEvent e){
    }
    @Override public void mouseEntered(    MouseEvent e){
    }
    @Override public void mouseExited(    MouseEvent e){
    }
  }
);
}
Program: 49864
Project: 49864
Buggy source:
private void refreshNavigationButtonState(){
  mUndoButton.setVisible(mGame.canUndoMove());
  mUndoButton.setEnabled(mGame.canUndoMove());
  mForwardButton.setVisible(mGame.hasNextMove());
  mBackButton.setVisible(mGame.hasPreviousMove());
  mForwardButton.setEnabled(mGame.hasNextMove());
  mBackButton.setEnabled(mGame.hasPreviousMove());
}

Fixed version (ground truth):
private void refreshNavigationButtonState(){
  mUndoButton.setVisible(!mGame.hasPreviousMove() && !mGame.hasNextMove());
  mUndoButton.setEnabled(mGame.canUndoMove());
  mForwardButton.setVisible(mGame.hasPreviousMove() || mGame.hasNextMove());
  mBackButton.setVisible(mGame.hasPreviousMove() || mGame.hasNextMove());
  mForwardButton.setEnabled(mGame.hasNextMove());
  mBackButton.setEnabled(mGame.hasPreviousMove());
}
Program: 49866
Project: 49866
Buggy source:
public static void playMove(MoveBuilder moveBuilder){
  if (moveBuilder.needsPromotion()) {
    createPromotionPopup(moveBuilder);
  }
 else {
    mGame.executeMove(moveBuilder.build());
    changeTurns(mGame.getResult());
    boardRefresh();
  }
}

Fixed version (ground truth):
public static void playMove(MoveBuilder moveBuilder){
  if (moveBuilder.needsPromotion() && !moveBuilder.hasPromotionType()) {
    createPromotionPopup(moveBuilder);
  }
 else {
    mGame.executeMove(moveBuilder.build());
    changeTurns(mGame.getResult());
    boardRefresh();
  }
}
Program: 49867
Project: 49867
Buggy source:
private List<BoardCoordinate> getVerticalPathSpaces(int maxSteps){
  int least=Math.min(mOrigin.y,mDestination.y);
  int most=Math.max(mOrigin.y,mDestination.y);
  List<BoardCoordinate> spaces=new ArrayList<>();
  for (int y=least + 1; y <= most; y++) {
    if (Math.abs(mOrigin.y - y) <= maxSteps) {
      spaces.add(BoardCoordinate.at(mOrigin.x,y));
    }
  }
  spaces.remove(mOrigin);
  return spaces;
}

Fixed version (ground truth):
private List<BoardCoordinate> getVerticalPathSpaces(int maxSteps){
  int least=Math.min(mOrigin.y,mDestination.y);
  int most=Math.max(mOrigin.y,mDestination.y);
  List<BoardCoordinate> spaces=new ArrayList<>();
  for (int y=least; y <= most; y++) {
    if (Math.abs(mOrigin.y - y) <= maxSteps) {
      spaces.add(BoardCoordinate.at(mOrigin.x,y));
    }
  }
  spaces.remove(mOrigin);
  int direction=(int)Math.signum(mDestination.y - mOrigin.y);
  if (direction < 0) {
    spaces=Lists.reverse(spaces);
  }
  return spaces;
}
Program: 49868
Project: 49868
Buggy source:
private List<BoardCoordinate> getHorizontalPathSpaces(int maxSteps){
  int least=Math.min(mOrigin.x,mDestination.x);
  int most=Math.max(mOrigin.x,mDestination.x);
  List<BoardCoordinate> spaces=new ArrayList<>();
  for (int x=least; x <= most; x++) {
    if (Math.abs(mOrigin.x - x) <= maxSteps) {
      spaces.add(BoardCoordinate.at(x,mOrigin.y));
    }
  }
  spaces.remove(mOrigin);
  return spaces;
}

Fixed version (ground truth):
private List<BoardCoordinate> getHorizontalPathSpaces(int maxSteps){
  int least=Math.min(mOrigin.x,mDestination.x);
  int most=Math.max(mOrigin.x,mDestination.x);
  List<BoardCoordinate> spaces=new ArrayList<>();
  for (int x=least; x <= most; x++) {
    if (Math.abs(mOrigin.x - x) <= maxSteps) {
      spaces.add(BoardCoordinate.at(x,mOrigin.y));
    }
  }
  spaces.remove(mOrigin);
  int direction=(int)Math.signum(mDestination.x - mOrigin.x);
  if (direction < 0) {
    spaces=Lists.reverse(spaces);
  }
  return spaces;
}
Program: 49869
Project: 49869
Buggy source:
@Test public void return7Spaces(){
  PathMaker target=new PathMaker(BoardCoordinate.at(1,1),BoardCoordinate.at(8,1));
  assertEquals(7,target.getPathToDestination(PieceType.UNLIMITED).size());
}

Fixed version (ground truth):
@Test public void return7Spaces(){
  PathMaker target=new PathMaker(BoardCoordinate.at(1,1),BoardCoordinate.at(8,1));
  assertEquals(7,target.getPathToDestination().size());
}
Program: 49870
Project: 49870
Buggy source:
@Test public void returnEmptyListFor1_1And2_3(){
  PathMaker target=new PathMaker(BoardCoordinate.at(1,1),BoardCoordinate.at(2,3));
  assertTrue(target.getPathToDestination(PieceType.UNLIMITED).isEmpty());
}

Fixed version (ground truth):
@Test public void returnEmptyListFor1_1And2_3(){
  PathMaker target=new PathMaker(BoardCoordinate.at(1,1),BoardCoordinate.at(2,3));
  assertTrue(target.getPathToDestination().isEmpty());
}
Program: 49871
Project: 49871
Buggy source:
@Test public void notReturn1_1Given1_1And8_1(){
  PathMaker target=new PathMaker(BoardCoordinate.at(1,1),BoardCoordinate.at(8,1));
  List<BoardCoordinate> moves=target.getPathToDestination(PieceType.UNLIMITED);
  assertFalse(moves.contains(BoardCoordinate.at(1,1)));
}

Fixed version (ground truth):
@Test public void notReturn1_1Given1_1And8_1(){
  PathMaker target=new PathMaker(BoardCoordinate.at(1,1),BoardCoordinate.at(8,1));
  List<BoardCoordinate> moves=target.getPathToDestination();
  assertFalse(moves.contains(BoardCoordinate.at(1,1)));
}
Program: 49872
Project: 49872
Buggy source:
public Set<BoardCoordinate> getMovesFrom(BoardCoordinate origin){
  Piece piece=getPiece(origin);
  Set<BoardCoordinate> allPossibleMoves=piece.getMovesFrom(origin,mBoardSize);
  Set<BoardCoordinate> capturingMoves=piece.getCapturingMovesFrom(origin,mBoardSize);
  Set<BoardCoordinate> validMoves=Sets.newHashSetWithExpectedSize(allPossibleMoves.size());
  for (  BoardCoordinate move : allPossibleMoves) {
    if (!isBlocked(origin,move) && !doesFriendlyPieceExistAt(origin,move)) {
      validMoves.add(move);
    }
  }
  for (  BoardCoordinate move : capturingMoves) {
    if (!isBlocked(origin,move) && doesPieceExistAt(move) && !doesFriendlyPieceExistAt(origin,move)) {
      validMoves.add(move);
    }
  }
  return validMoves;
}

Fixed version (ground truth):
public Set<BoardCoordinate> getMovesFrom(BoardCoordinate origin){
  Piece piece=getPiece(origin);
  Set<BoardCoordinate> allPossibleMoves=piece.getMovesFrom(origin,mBoardSize);
  Set<BoardCoordinate> capturingMoves=piece.getCapturingMovesFrom(origin,mBoardSize);
  Set<BoardCoordinate> validMoves=Sets.newHashSetWithExpectedSize(allPossibleMoves.size());
  for (  BoardCoordinate move : allPossibleMoves) {
    if (!isBlocked(origin,move) && !doesPieceExistAt(move)) {
      validMoves.add(move);
    }
  }
  for (  BoardCoordinate move : capturingMoves) {
    if (!isBlocked(origin,move) && doesPieceExistAt(move) && !doesFriendlyPieceExistAt(origin,move)) {
      validMoves.add(move);
    }
  }
  return validMoves;
}
Program: 49873
Project: 49873
Buggy source:
public static PieceType getKnightPieceType(){
  Set<TwoHopMovement> twoHopMovements=Sets.newHashSet(TwoHopMovement.with(2,1));
  return new PieceType("String_Node_Str",null,null,twoHopMovements);
}

Fixed version (ground truth):
public static PieceType getKnightPieceType(){
  Set<TwoHopMovement> twoHopMovements=Sets.newHashSet(TwoHopMovement.with(2,1));
  return new PieceType("String_Node_Str",null,twoHopMovements);
}
Program: 49874
Project: 49874
Buggy source:
public static PieceType getRookPieceType(){
  Map<Direction,Integer> movements=Maps.newHashMap();
  for (  Direction direction : Direction.ADJACENT_DIRECTIONS) {
    movements.put(direction,UNLIMITED);
  }
  return new PieceType("String_Node_Str",movements,null,null);
}

Fixed version (ground truth):
public static PieceType getRookPieceType(){
  Map<Direction,Integer> movements=Maps.newHashMap();
  for (  Direction direction : Direction.ADJACENT_DIRECTIONS) {
    movements.put(direction,UNLIMITED);
  }
  return new PieceType("String_Node_Str",movements,null);
}
Program: 49875
Project: 49875
Buggy source:
public static PieceType getQueenPieceType(){
  Map<Direction,Integer> movements=Maps.newHashMap();
  for (  Direction direction : Direction.values()) {
    movements.put(direction,UNLIMITED);
  }
  return new PieceType("String_Node_Str",movements,null,null);
}

Fixed version (ground truth):
public static PieceType getQueenPieceType(){
  Map<Direction,Integer> movements=Maps.newHashMap();
  for (  Direction direction : Direction.values()) {
    movements.put(direction,UNLIMITED);
  }
  return new PieceType("String_Node_Str",movements,null);
}
Program: 49876
Project: 49876
Buggy source:
public static PieceType getBishopPieceType(){
  Map<Direction,Integer> movements=Maps.newHashMap();
  for (  Direction direction : Direction.DIAGONAL_DIRECTIONS) {
    movements.put(direction,UNLIMITED);
  }
  return new PieceType("String_Node_Str",movements,null,null);
}

Fixed version (ground truth):
public static PieceType getBishopPieceType(){
  Map<Direction,Integer> movements=Maps.newHashMap();
  for (  Direction direction : Direction.DIAGONAL_DIRECTIONS) {
    movements.put(direction,UNLIMITED);
  }
  return new PieceType("String_Node_Str",movements,null);
}
Program: 49877
Project: 49877
Buggy source:
public Set<BoardCoordinate> getCapturingMovesFrom(@NotNull BoardCoordinate startLocation,@NotNull BoardSize boardSize){
  Set<BoardCoordinate> moves=new HashSet<>();
  for (  Direction direction : mCapturingMovements.keySet()) {
    PathMaker pathMaker=new PathMaker(startLocation,direction.getFurthestPoint(startLocation,boardSize));
    moves.addAll(pathMaker.getPathToDestination(mCapturingMovements.get(direction)));
  }
  return moves;
}

Fixed version (ground truth):
public Set<BoardCoordinate> getCapturingMovesFrom(@NotNull BoardCoordinate startLocation,@NotNull BoardSize boardSize){
  return getMovesFromImpl(startLocation,boardSize,mCapturingMovements);
}