nus-yam/ex-repair huggingface dataset:
Program: 178660
Project: 178660
Buggy source:
private void processBuildSpecLine(String line,HashSet<String> buildSpecFiles) throws IOException {
  Scanner scanner=new Scanner(line);
  scanner.useDelimiter("String_Node_Str");
  if (scanner.hasNext()) {
    String tag=scanner.next();
    Path workingDir;
    String sourceFile;
switch (tag) {
case "String_Node_Str":
      workingDir=Paths.get(scanner.next());
    scanner.next();
  scanner.next();
sourceFile=scanner.next();
buildSpecFiles.add(workingDir.resolve(sourceFile).normalize().toString());
break;
case "String_Node_Str":
scanner.next();
workingDir=Paths.get(scanner.next());
sourceFile=scanner.next();
buildSpecFiles.add(workingDir.resolve(sourceFile).normalize().toString());
break;
default :
return;
}
}
}

Fixed version (ground truth):
private void processBuildSpecLine(String line,HashSet<String> buildSpecFiles) throws IOException {
  Scanner scanner=new Scanner(line);
  scanner.useDelimiter("String_Node_Str");
  if (scanner.hasNext()) {
    String tag=scanner.next();
    Path workingDir;
    String sourceFile;
    try {
switch (tag) {
case "String_Node_Str":
        workingDir=Paths.get(scanner.next());
      scanner.next();
    scanner.next();
  sourceFile=scanner.next();
buildSpecFiles.add(workingDir.resolve(sourceFile).normalize().toString());
break;
case "String_Node_Str":
scanner.next();
workingDir=Paths.get(scanner.next());
sourceFile=scanner.next();
buildSpecFiles.add(workingDir.resolve(sourceFile).normalize().toString());
break;
default :
return;
}
}
 catch (NoSuchElementException e) {
return;
}
}
}
Program: 178664
Project: 178664
Buggy source:
private void processBuildSpecLine(String line,HashSet<String> buildSpecFiles) throws IOException {
  Scanner scanner=new Scanner(line);
  scanner.useDelimiter("String_Node_Str");
  if (scanner.hasNext()) {
    String tag=scanner.next();
    if (!tag.equals("String_Node_Str")) {
      return;
    }
    Path workingDir=Paths.get(scanner.next());
    scanner.next();
    scanner.next();
    String sourceFile=scanner.next();
    buildSpecFiles.add(workingDir.resolve(sourceFile).normalize().toString());
  }
}

Fixed version (ground truth):
private void processBuildSpecLine(String line,HashSet<String> buildSpecFiles) throws IOException {
  Scanner scanner=new Scanner(line);
  scanner.useDelimiter("String_Node_Str");
  if (scanner.hasNext()) {
    String tag=scanner.next();
    Path workingDir;
    String sourceFile;
switch (tag) {
case "String_Node_Str":
      workingDir=Paths.get(scanner.next());
    scanner.next();
  scanner.next();
sourceFile=scanner.next();
buildSpecFiles.add(workingDir.resolve(sourceFile).normalize().toString());
break;
case "String_Node_Str":
scanner.next();
workingDir=Paths.get(scanner.next());
sourceFile=scanner.next();
buildSpecFiles.add(workingDir.resolve(sourceFile).normalize().toString());
break;
default :
return;
}
}
}
Program: 178666
Project: 178666
Buggy source:
@DataBoundConstructor public KlocworkDesktopBuilder(KlocworkDesktopConfig desktopConfig){
  this.desktopConfig=desktopConfig;
}

Fixed version (ground truth):
@DataBoundConstructor public KlocworkDesktopBuilder(KlocworkDesktopConfig desktopConfig){
  this.desktopConfig=desktopConfig;
  this.analysisSkipped=false;
}
Program: 178668
Project: 178668
Buggy source:
public List<String> call() throws IOException {
  List<String> validFiles=new ArrayList<String>();
  HashSet<String> buildSpecFiles=new HashSet<String>();
  if (diffFileList != null) {
    populateFileList();
  }
  try (Scanner scanner=new Scanner(Paths.get(buildSpec))){
    while (scanner.hasNextLine()) {
      processBuildSpecLine(scanner.nextLine(),buildSpecFiles);
    }
  }
   for (  String file : fileList) {
    if (buildSpecFiles.contains(file)) {
      validFiles.add(file);
    }
  }
  return validFiles;
}

Fixed version (ground truth):
public List<String> call() throws IOException {
  List<String> validFiles=new ArrayList<String>();
  HashSet<String> buildSpecFiles=new HashSet<String>();
  populateFileList();
  try (Scanner scanner=new Scanner(Paths.get(buildSpec))){
    while (scanner.hasNextLine()) {
      processBuildSpecLine(scanner.nextLine(),buildSpecFiles);
    }
  }
   for (  String file : fileList) {
    if (buildSpecFiles.contains(file)) {
      validFiles.add(file);
    }
  }
  return validFiles;
}
Program: 178669
Project: 178669
Buggy source:
private void populateFileList() throws IOException {
  Path diffFileListPath=Paths.get(diffFileList);
  if (!diffFileListPath.isAbsolute()) {
    diffFileListPath=Paths.get(workspace,diffFileList);
  }
  try (Scanner scanner=new Scanner(diffFileListPath)){
    while (scanner.hasNextLine()) {
      fileList.add(diffFileListPath.resolveSibling(scanner.nextLine()).normalize().toString());
    }
  }
 }

Fixed version (ground truth):
private void populateFileList() throws IOException {
  Path diffFileListPath=Paths.get(diffFileList);
  if (!diffFileListPath.isAbsolute()) {
    diffFileListPath=Paths.get(workspace,diffFileList);
  }
  if (Files.exists(diffFileListPath)) {
    try (Scanner scanner=new Scanner(diffFileListPath)){
      while (scanner.hasNextLine()) {
        fileList.add(diffFileListPath.resolveSibling(scanner.nextLine()).normalize().toString());
      }
    }
   }
 else {
    throw new IOException("String_Node_Str" + diffFileList + "String_Node_Str"+ "String_Node_Str");
  }
}
Program: 178670
Project: 178670
Buggy source:
public KlocworkBuildSpecParser(String workspace,List<String> fileList,String buildSpec){
  this.workspace=workspace;
  this.fileList=fileList;
  this.buildSpec=buildSpec;
  this.diffFileList=null;
}

Fixed version (ground truth):
public KlocworkBuildSpecParser(String workspace,String diffFileList,String buildSpec) throws IOException {
  this.workspace=workspace;
  this.fileList=new ArrayList<String>();
  this.buildSpec=buildSpec;
  this.diffFileList=diffFileList;
}
Program: 178672
Project: 178672
Buggy source:
public boolean satisfied(Assignment asign){
  HashSet<Integer> values=new HashSet<Integer>(9);
  for (  SudokuTile v : variables) {
    Integer val=(Integer)asign.getValue(v);
    if (val != null && values.contains(val))     return false;
    values.add(val);
  }
  return true;
}

Fixed version (ground truth):
public boolean satisfied(Assignment asign){
  HashSet<Integer> values=new HashSet<Integer>(9);
  for (  SudokuTile v : variables) {
    Integer val=(Integer)asign.getValue(v);
    if (val == null || values.contains(val)) {
      return false;
    }
    values.add(val);
  }
  return true;
}
Program: 178673
Project: 178673
Buggy source:
/** 
 * Returns a list of constraints associated with the problem.
 */
public List<Constraint> constraints(){
  if (constraints.size() == 0) {
    for (int row=0; row < 9; row++) {
      AllDiff constr=new AllDiff();
      for (int col=0; col < 9; col++) {
        constr.variables.add(tiles.get(row * 9 + col));
      }
      constraints.add(constr);
    }
    for (int col=0; col < 9; col++) {
      AllDiff constr=new AllDiff();
      for (int row=0; row < 9; row++) {
        constr.variables.add(tiles.get(row * 9 + col));
      }
      constraints.add(constr);
    }
    for (int gridRow=0; gridRow < 3; gridRow++) {
      for (int gridCol=0; gridCol < 3; gridCol++) {
        AllDiff constr=new AllDiff();
        for (int row=0; row < 3; row++) {
          for (int col=0; col < 3; col++) {
            int piece=(gridRow * 3 + row) * 8 + gridCol + col;
            constr.variables.add(tiles.get(piece));
          }
        }
        constraints.add(constr);
      }
    }
  }
  return new LinkedList<Constraint>(constraints);
}

Fixed version (ground truth):
/** 
 * Returns a list of constraints associated with the problem.
 */
public List<Constraint> constraints(){
  if (constraints.size() == 0) {
    for (int row=0; row < 9; row++) {
      AllDiff constr=new AllDiff();
      for (int col=0; col < 9; col++) {
        constr.variables.add(tiles.get(row * 9 + col));
      }
      constraints.add(constr);
    }
    for (int col=0; col < 9; col++) {
      AllDiff constr=new AllDiff();
      for (int row=0; row < 9; row++) {
        constr.variables.add(tiles.get(row * 9 + col));
      }
      constraints.add(constr);
    }
    for (int gridRow=0; gridRow < 3; gridRow++) {
      for (int gridCol=0; gridCol < 3; gridCol++) {
        AllDiff constr=new AllDiff();
        for (int row=0; row < 3; row++) {
          for (int col=0; col < 3; col++) {
            int piece=(gridRow * 3 + row) * 9 + gridCol * 3 + col;
            constr.variables.add(tiles.get(piece));
          }
        }
        constraints.add(constr);
      }
    }
  }
  return new LinkedList<Constraint>(constraints);
}
Program: 178674
Project: 178674
Buggy source:
@Override public void onSelectedNavTree(final LHSHighlightEvent event){
  if (category.equals(event.getCategory()) || event.getCategory().equals("String_Node_Str")) {
    applyStateChange(new StateChange(){
      @Override public void applyTo(      LHSNavTreeItem treeItem){
        String token=treeItem.getElement().hasAttribute("String_Node_Str") ? treeItem.getElement().getAttribute("String_Node_Str") : "String_Node_Str";
        boolean isSelected=event.getItem().equals(treeItem.getText()) || token.equals(event.getToken());
        if (isSelected) {
          treeItem.setActive(true);
          if (prevNavItem != null)           prevNavItem.setActive(false);
          prevNavItem=treeItem;
          openParents(treeItem);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void onSelectedNavTree(final LHSHighlightEvent event){
  if (category.equals(event.getCategory()) || event.getCategory().equals("String_Node_Str")) {
    applyStateChange(new StateChange(){
      @Override public void applyTo(      LHSNavTreeItem treeItem){
        String token=treeItem.getElement().hasAttribute("String_Node_Str") ? treeItem.getElement().getAttribute("String_Node_Str") : "String_Node_Str";
        boolean isSelected=event.getItem().equals(treeItem.getText()) || token.equals(event.getToken());
        if (isSelected) {
          if (prevNavItem != null && !prevNavItem.equals(treeItem))           prevNavItem.setActive(false);
          treeItem.setActive(true);
          prevNavItem=treeItem;
          openParents(treeItem);
        }
      }
    }
);
  }
}
Program: 178675
Project: 178675
Buggy source:
public void setValueMap(Collection<String> values){
  comboBox.clear();
  for (  String s : values) {
    comboBox.addItem(s);
  }
  if (defaultToFirst)   selectItem(0);
}

Fixed version (ground truth):
public void setValueMap(Collection<String> values){
  comboBox.clear();
  if (values.isEmpty() || !values.iterator().next().isEmpty())   comboBox.addItem("String_Node_Str");
  for (  String s : values) {
    comboBox.addItem(s);
  }
  if (defaultToFirst)   selectItem(0);
}
Program: 178676
Project: 178676
Buggy source:
@Override public void clearValue(){
  if (defaultToFirst)   selectItem(0);
 else   comboBox.clearSelection();
}

Fixed version (ground truth):
@Override public void clearValue(){
  if (defaultToFirst && comboBox.getItemCount() > 0)   selectItem(0);
 else   comboBox.clearSelection();
}
Program: 178677
Project: 178677
Buggy source:
public void setItemSelected(int i,boolean isSelected){
  String selectedValue=values.get(i);
  if (isSelected && !values.isEmpty()) {
    currentValue.setText(selectedValue);
    onSelection(selectedValue);
  }
 else   if (!isSelected) {
    currentValue.setText("String_Node_Str");
    onSelection("String_Node_Str");
  }
  cellList.getSelectionModel().setSelected(selectedValue,isSelected);
}

Fixed version (ground truth):
public void setItemSelected(int i,boolean isSelected){
  String selection="String_Node_Str";
  if (isSelected && !values.isEmpty()) {
    selection=values.get(i);
    currentValue.setText(selection);
    onSelection(selection);
  }
 else   if (!isSelected) {
    currentValue.setText(selection);
    onSelection(selection);
  }
  cellList.getSelectionModel().setSelected(selection,isSelected);
}
Program: 178678
Project: 178678
Buggy source:
@Override public void clearValue(){
  if (defaultToFirst)   selectItem(0);
 else   comboBox.clearSelection();
}

Fixed version (ground truth):
@Override public void clearValue(){
  if (defaultToFirst && comboBox.getItemCount() > 0)   selectItem(0);
 else   comboBox.clearSelection();
}
Program: 178679
Project: 178679
Buggy source:
public SystemCommand withStderrConsumerUnless(LineConsumer consumer,boolean flag){
  return !flag ? withStderrConsumer(consumer) : setStderrCommandOutputHandler(nullOutputHandler);
}

Fixed version (ground truth):
public SystemCommand withStderrConsumerUnless(LineConsumer consumer,boolean flag){
  return !flag ? withStderrConsumer(consumer) : setStderrCommandOutputHandler(closingOutputHandler);
}
Program: 178680
Project: 178680
Buggy source:
public SystemCommand withStdoutConsumerUnless(LineConsumer consumer,boolean flag){
  return !flag ? withStdoutConsumer(consumer) : setStdoutCommandOutputHandler(nullOutputHandler);
}

Fixed version (ground truth):
public SystemCommand withStdoutConsumerUnless(LineConsumer consumer,boolean flag){
  return !flag ? withStdoutConsumer(consumer) : setStdoutCommandOutputHandler(closingOutputHandler);
}
Program: 178681
Project: 178681
Buggy source:
public void execute() throws IOException {
  if (packageRoot == null) {
    throw new IOException("String_Node_Str");
  }
  if (debFile == null) {
    throw new IOException("String_Node_Str");
  }
  new SystemCommand().setCommand(useFakeroot ? "String_Node_Str" : dpkgDebPath).dumpCommandIf(debug).withNoStderrConsumerUnless(debug).withNoStdoutConsumerUnless(debug).addArgumentIf(useFakeroot,dpkgDebPath).addArgument("String_Node_Str").addArgument(packageRoot.getAbsolutePath()).addArgument(debFile.getAbsolutePath()).execute().assertSuccess();
}

Fixed version (ground truth):
public void execute() throws IOException {
  if (packageRoot == null) {
    throw new IOException("String_Node_Str");
  }
  if (debFile == null) {
    throw new IOException("String_Node_Str");
  }
  new SystemCommand().setCommand(useFakeroot ? "String_Node_Str" : dpkgDebPath).dumpCommandIf(debug).withIgnoringStderrUnless(debug).withIgnoringStdoutUnless(debug).addArgumentIf(useFakeroot,dpkgDebPath).addArgument("String_Node_Str").addArgument(packageRoot.getAbsolutePath()).addArgument(debFile.getAbsolutePath()).execute().assertSuccess();
}
Program: 178682
Project: 178682
Buggy source:
public void execute() throws IOException {
  SystemCommand command=new SystemCommand().withNoStderrConsumerUnless(generalOptions.debug).withNoStdoutConsumerUnless(generalOptions.debug).setBasedir(generalOptions.basedir).setCommand("String_Node_Str").addArgument("String_Node_Str" + operation);
  setGeneralOptions(command,generalOptions);
  setSelectOptions(command,selectOptions);
  setQueryOptions(command,queryOptions);
  command.execute().assertSuccess();
}

Fixed version (ground truth):
public void execute() throws IOException {
  SystemCommand command=new SystemCommand().withClosedStderrUnless(generalOptions.debug).withClosedStdoutUnless(generalOptions.debug).setBasedir(generalOptions.basedir).setCommand("String_Node_Str").addArgument("String_Node_Str" + operation);
  setGeneralOptions(command,generalOptions);
  setSelectOptions(command,selectOptions);
  setQueryOptions(command,queryOptions);
  command.execute().assertSuccess();
}
Program: 178683
Project: 178683
Buggy source:
private int execute(String mode) throws IOException {
  SystemCommand command=new SystemCommand().setCommand("String_Node_Str").setBasedir(basedir).withNoStderrConsumerUnless(debug).withNoStdoutConsumerUnless(debug);
  if (StringUtils.isNotEmpty(arch)) {
    command.addArgument("String_Node_Str").addArgument(arch);
  }
  if (StringUtils.isNotEmpty(category)) {
    command.addArgument("String_Node_Str").addArgument(category);
  }
  if (device != null) {
    command.addArgument("String_Node_Str").addArgument(device.getAbsolutePath());
  }
  if (fullyInstalledOnly) {
    command.addArgument("String_Node_Str");
  }
  if (longFormat) {
    command.addArgument("String_Node_Str");
  }
  if (partiallyInstalledOnly) {
    command.addArgument("String_Node_Str");
  }
  if (listRelocationBaseForRelocatablePackages) {
    command.addArgument("String_Node_Str");
  }
  if (rootPath != null) {
    command.addArgument("String_Node_Str").addArgument(rootPath.getAbsolutePath());
  }
  if (StringUtils.isNotEmpty(version)) {
    command.addArgument("String_Node_Str").addArgument(version);
  }
  command.addArgument(mode);
  return command.execute().exitValue;
}

Fixed version (ground truth):
private int execute(String mode) throws IOException {
  SystemCommand command=new SystemCommand().setCommand("String_Node_Str").setBasedir(basedir).withClosedStderrUnless(debug).withClosedStdoutUnless(debug);
  if (StringUtils.isNotEmpty(arch)) {
    command.addArgument("String_Node_Str").addArgument(arch);
  }
  if (StringUtils.isNotEmpty(category)) {
    command.addArgument("String_Node_Str").addArgument(category);
  }
  if (device != null) {
    command.addArgument("String_Node_Str").addArgument(device.getAbsolutePath());
  }
  if (fullyInstalledOnly) {
    command.addArgument("String_Node_Str");
  }
  if (longFormat) {
    command.addArgument("String_Node_Str");
  }
  if (partiallyInstalledOnly) {
    command.addArgument("String_Node_Str");
  }
  if (listRelocationBaseForRelocatablePackages) {
    command.addArgument("String_Node_Str");
  }
  if (rootPath != null) {
    command.addArgument("String_Node_Str").addArgument(rootPath.getAbsolutePath());
  }
  if (StringUtils.isNotEmpty(version)) {
    command.addArgument("String_Node_Str").addArgument(version);
  }
  command.addArgument(mode);
  return command.execute().exitValue;
}
Program: 178684
Project: 178684
Buggy source:
protected ExportPage(String pageName){
  super(pageName);
  this.setTitle("String_Node_Str");
  this.setDescription("String_Node_Str");
}

Fixed version (ground truth):
protected ExportPage(String pageName){
  super(pageName);
  this.setTitle("String_Node_Str");
  this.setDescription("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
}
Program: 178686
Project: 178686
Buggy source:
private static Parameters createSimulationParameters(Solver solver,String[] args,SBAModel sbaModel) throws WrongArgumentsException {
  Parameters requiredParams=solver.getRequiredParameters();
  Parameters parameters=new Parameters();
  for (  Parameter param : requiredParams.arrayOfKeys()) {
    parameters.setValue(param,param.getDefault());
  }
  String[] componentsToView=sbaModel.getComponentNames();
  parameters.setValue(Parameter.Components,componentsToView);
  int runs=getIndepentRuns(args,1);
  parameters.setValue(Parameter.Independent_Replications,new Integer(runs));
  double startTime=getStartTime(args);
  parameters.setValue(Parameter.Start_Time,new Double(startTime));
  double stopTime=getStopTime(args);
  parameters.setValue(Parameter.Stop_Time,new Double(stopTime));
  double timeStep=getTimeStep(args);
  parameters.setValue(Parameter.Step_Size,new Double(timeStep));
  int dataPoints=getNumberDataPoints(args);
  parameters.setValue(Parameter.Data_Points,dataPoints);
  double relativeError=getRelativeError(args);
  parameters.setValue(Parameter.Relative_Error,relativeError);
  double absoluteError=getAbsoluteError(args);
  parameters.setValue(Parameter.Absolute_Error,absoluteError);
  return parameters;
}

Fixed version (ground truth):
private static Parameters createSimulationParameters(Solver solver,String[] args,SBAModel sbaModel) throws WrongArgumentsException {
  Parameters requiredParams=solver.getRequiredParameters();
  Parameters parameters=new Parameters();
  for (  Parameter param : requiredParams.arrayOfKeys()) {
    parameters.setValue(param,param.getDefault());
  }
  String[] componentsToView=sbaModel.getComponentNames();
  String[] variablesToView=sbaModel.getDynamicVariableNames();
  String[] allToView=new String[componentsToView.length + variablesToView.length];
  for (int i=0; i < componentsToView.length; i++) {
    allToView[i]=componentsToView[i];
  }
  for (int i=0; i < variablesToView.length; i++) {
    allToView[i + componentsToView.length]=variablesToView[i];
  }
  parameters.setValue(Parameter.Components,allToView);
  int runs=getIndepentRuns(args,1);
  parameters.setValue(Parameter.Independent_Replications,new Integer(runs));
  double startTime=getStartTime(args);
  parameters.setValue(Parameter.Start_Time,new Double(startTime));
  double stopTime=getStopTime(args);
  parameters.setValue(Parameter.Stop_Time,new Double(stopTime));
  double timeStep=getTimeStep(args);
  parameters.setValue(Parameter.Step_Size,new Double(timeStep));
  int dataPoints=getNumberDataPoints(args);
  parameters.setValue(Parameter.Data_Points,dataPoints);
  double relativeError=getRelativeError(args);
  parameters.setValue(Parameter.Relative_Error,relativeError);
  double absoluteError=getAbsoluteError(args);
  parameters.setValue(Parameter.Absolute_Error,absoluteError);
  return parameters;
}
Program: 178687
Project: 178687
Buggy source:
/** 
 * Get the CSV column names of a class.
 * @param clazz the class managed by CsvEngine.
 * @return list of column names of the class ordered if the class use {@link fr.ybonnel.csvengine.annotation.CsvColumn#order()}.
 */
public List<String> getColumnNames(Class clazz){
  final CsvClass csvClass=mapClasses.get(clazz);
  if (csvClass == null) {
    throw new CsvEngineException("String_Node_Str" + clazz.getSimpleName() + "String_Node_Str");
  }
  List<String> columnsNames=new ArrayList<String>();
  for (  String columnName : csvClass.getColumnNames()) {
    columnsNames.add(columnName);
  }
  Collections.sort(columnsNames,new Comparator<String>(){
    public int compare(    String o1,    String o2){
      int thisVal=csvClass.getOrder(o1);
      int anotherVal=csvClass.getOrder(o2);
      return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1));
    }
  }
);
  return columnsNames;
}

Fixed version (ground truth):
/** 
 * Get the CSV column names of a class.
 * @param clazz the class managed by CsvEngine.
 * @return list of column names of the class orderedif the class use  {@link fr.ybonnel.csvengine.annotation.CsvColumn#order()}.
 */
public List<String> getColumnNames(Class clazz){
  final CsvClass csvClass=mapClasses.get(clazz);
  if (csvClass == null) {
    throw new CsvEngineException("String_Node_Str" + clazz.getSimpleName() + "String_Node_Str");
  }
  List<String> columnsNames=new ArrayList<String>();
  for (  String columnName : csvClass.getColumnNames()) {
    columnsNames.add(columnName);
  }
  Collections.sort(columnsNames,new Comparator<String>(){
    public int compare(    String o1,    String o2){
      int thisVal=csvClass.getOrder(o1);
      int anotherVal=csvClass.getOrder(o2);
      return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1));
    }
  }
);
  return columnsNames;
}
Program: 178688
Project: 178688
Buggy source:
/** 
 * Create the Properties file for Felix to launch.
 * @param defaultDirectory
 * @param logger
 * @param activators
 * @return
 * @throws FileNotFoundException
 * @throws IOException
 */
private static Properties createFelixProperties(File defaultDirectory,KnapsackLogger logger,List<BundleActivator> activators) throws FileNotFoundException, IOException {
  Properties felixConfig=new Properties();
  felixConfig.load(getFelixConfigFileInputStream(defaultDirectory));
  felixConfig.put(FELIX_LOGGER_INSTANCE,logger);
  felixConfig.put(FELIX_BUNDLE_INSTANCES,activators);
  return felixConfig;
}

Fixed version (ground truth):
/** 
 * Create the Properties file for Felix to launch.
 * @param defaultDirectory
 * @param logger
 * @param activators
 * @return
 * @throws FileNotFoundException
 * @throws IOException
 */
private static Properties createFelixProperties(File defaultDirectory,KnapsackLogger logger,List<BundleActivator> activators) throws FileNotFoundException, IOException {
  Properties felixConfig=new Properties();
  felixConfig.load(getFelixConfigFileInputStream(defaultDirectory));
  for (  Entry e : felixConfig.entrySet())   felixConfig.put(e.getKey(),LoadPropertiesFunction.evalSubsitutions(e.getValue().toString()));
  felixConfig.put(FELIX_LOGGER_INSTANCE,logger);
  felixConfig.put(FELIX_BUNDLE_INSTANCES,activators);
  return felixConfig;
}
Program: 178689
Project: 178689
Buggy source:
/** 
 * A recursive function to replace variables with values from System.properties. Variable is defined in ${var} style with 'var' being a system property.
 * @param ins
 * @return
 * @throws IOException
 */
private String evalSubsitutions(final String ins) throws IOException {
  int si=ins.indexOf("String_Node_Str");
  if (si > -1) {
    int ti=ins.indexOf('}',si + 2);
    if (ti == -1)     throw new IOException("String_Node_Str" + ins);
    String varName=ins.substring(si + 2,ti);
    String varVal=System.getProperty(varName);
    String varLiteral="String_Node_Str" + varName + "String_Node_Str";
    String subLine=ins.replaceAll(varLiteral,varVal);
    return evalSubsitutions(subLine);
  }
  return ins;
}

Fixed version (ground truth):
/** 
 * A recursive function to replace variables with values from System.properties. Variable is defined in ${var} style with 'var' being a system property.
 * @param ins
 * @return
 * @throws IOException
 */
public static String evalSubsitutions(final String ins) throws IOException {
  int si=ins.indexOf("String_Node_Str");
  if (si > -1) {
    int ti=ins.indexOf('}',si + 2);
    if (ti == -1)     throw new IOException("String_Node_Str" + ins);
    String varName=ins.substring(si + 2,ti);
    String varVal=System.getProperty(varName);
    String varLiteral="String_Node_Str" + varName + "String_Node_Str";
    String subLine=ins.replaceAll(varLiteral,varVal);
    return evalSubsitutions(subLine);
  }
  return ins;
}
Program: 178690
Project: 178690
Buggy source:
/** 
 * Initialize state
 * @throws IOException
 * @throws InterruptedException 
 */
protected Config(File baseDirectory) throws IOException {
  this.baseDirectory=baseDirectory;
  load(new FileInputStream(getConfigFile()));
  if (!this.containsKey(CONFIG_KEY_ROOT_DIR))   this.put(CONFIG_KEY_ROOT_DIR,baseDirectory);
  if (!this.containsKey(CONFIG_KEY_BUNDLE_DIRS))   this.put(CONFIG_KEY_BUNDLE_DIRS,DEFAULT_BUNDLE_DIRECTORY);
}

Fixed version (ground truth):
/** 
 * Initialize state
 * @throws IOException
 * @throws InterruptedException 
 */
protected Config(File baseDirectory) throws IOException {
  for (  Object key : System.getProperties().keySet())   this.put(key,System.getProperty(key.toString()));
  this.baseDirectory=baseDirectory;
  load(new FileInputStream(getConfigFile()));
  if (!this.containsKey(CONFIG_KEY_ROOT_DIR))   this.put(CONFIG_KEY_ROOT_DIR,baseDirectory);
  if (!this.containsKey(CONFIG_KEY_BUNDLE_DIRS))   this.put(CONFIG_KEY_BUNDLE_DIRS,DEFAULT_BUNDLE_DIRECTORY);
}
Program: 178691
Project: 178691
Buggy source:
@Override public File apply(String element){
  File f=new File(baseDir,element);
  if (!f.exists() || !f.isDirectory())   return null;
  return f;
}

Fixed version (ground truth):
@Override public File apply(String element){
  return new File(baseDir,element.trim());
}
Program: 178692
Project: 178692
Buggy source:
@Override public Collection<File> getBundleDirectories(){
  if (bundleDirs == null)   bundleDirs=Fn.map(new Fn.Function<String,File>(){
    @Override public File apply(    String element){
      File f=new File(baseDir,element);
      if (!f.exists() || !f.isDirectory())       return null;
      return f;
    }
  }
,config.getString(Config.CONFIG_KEY_BUNDLE_DIRS).split("String_Node_Str"));
  return bundleDirs;
}

Fixed version (ground truth):
@Override public Collection<File> getBundleDirectories(){
  if (bundleDirs == null)   bundleDirs=Fn.map(new Fn.Function<String,File>(){
    @Override public File apply(    String element){
      return new File(baseDir,element.trim());
    }
  }
,config.getString(Config.CONFIG_KEY_BUNDLE_DIRS).split("String_Node_Str"));
  return bundleDirs;
}
Program: 178693
Project: 178693
Buggy source:
@Override public void frameworkEvent(FrameworkEvent event){
  if (event.getType() == FrameworkEvent.STARTED) {
    if (config.getBoolean(Config.CONFIG_KEY_LOG_STDOUT))     new LogPrinter(context);
    sizeMap=new HashMap<File,Long>();
    File baseDir=new File(config.getString(Config.CONFIG_KEY_ROOT_DIR));
    try {
      FSHelper.validateFile(baseDir,false,true,false,true);
      if (port != Bootstrap.DISABLE_SCRIPTS_PORT) {
        shell=new ConsoleSocketListener(port,context,this,new CommandParser(context,new File(baseDir,Config.SCRIPT_DIRECTORY_NAME)));
        shell.start();
      }
      (new InitThread(baseDir,Arrays.asList(config.getString(Config.CONFIG_KEY_BUNDLE_DIRS).split("String_Node_Str")))).start();
      log(LogService.LOG_INFO,"String_Node_Str" + KNAPSACK_VERSION + "String_Node_Str"+ config.get(Config.CONFIG_KEY_ROOT_DIR));
    }
 catch (    Exception e) {
      log(LogService.LOG_ERROR,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void frameworkEvent(FrameworkEvent event){
  if (event.getType() == FrameworkEvent.STARTED) {
    if (config.getBoolean(Config.CONFIG_KEY_LOG_STDOUT))     new LogPrinter(context);
    sizeMap=new HashMap<File,Long>();
    File baseDir=new File(config.getString(Config.CONFIG_KEY_ROOT_DIR));
    try {
      FSHelper.validateFile(baseDir,false,true,false,true);
      if (port != Bootstrap.DISABLE_SCRIPTS_PORT) {
        shell=new ConsoleSocketListener(port,context,this,new CommandParser(context,new File(baseDir,Config.SCRIPT_DIRECTORY_NAME)));
        shell.start();
      }
 else {
        log(LogService.LOG_INFO,"String_Node_Str");
      }
      (new InitThread(baseDir,Arrays.asList(config.getString(Config.CONFIG_KEY_BUNDLE_DIRS).split("String_Node_Str")))).start();
      log(LogService.LOG_INFO,"String_Node_Str" + KNAPSACK_VERSION + "String_Node_Str"+ config.get(Config.CONFIG_KEY_ROOT_DIR));
    }
 catch (    Exception e) {
      log(LogService.LOG_ERROR,"String_Node_Str",e);
    }
  }
}
Program: 178695
Project: 178695
Buggy source:
public void start(BundleContext bundleContext) throws Exception {
  Activator.context=bundleContext;
  if (config == null)   config=Config.getRef();
  managedServiceRef=bundleContext.registerService(ManagedService.class.getName(),this,getManagedServiceProperties());
  context.addFrameworkListener(this);
  if (embeddedMode && defaultDirExists()) {
    ServiceReference sr=bundleContext.getServiceReference(ConfigurationAdmin.class.getName());
    if (sr != null) {
      ConfigurationAdmin ca=(ConfigurationAdmin)bundleContext.getService(sr);
      loadDefaults(getDefaultDir(),ca);
    }
  }
}

Fixed version (ground truth):
public void start(BundleContext bundleContext) throws Exception {
  Activator.context=bundleContext;
  managedServiceRef=bundleContext.registerService(ManagedService.class.getName(),this,getManagedServiceProperties());
  context.addFrameworkListener(this);
  if (embeddedMode) {
    ServiceReference sr=bundleContext.getServiceReference(ConfigurationAdmin.class.getName());
    if (sr != null) {
      ConfigurationAdmin ca=(ConfigurationAdmin)bundleContext.getService(sr);
      loadDefaults(new File(config.get(Config.CONFIG_KEY_ROOT_DIR).toString(),Config.CONFIGADMIN_DIRECTORY_NAME),ca);
    }
  }
}
Program: 178696
Project: 178696
Buggy source:
/** 
 * Constructor for running as an embedded bundle in the Knapsack bootstrap.
 * @param logger instance of framework logger.
 * @throws IOException Upon configuration error.
 * @throws InterruptedException Upon interruption.
 */
public Activator(Logger logger,int port) throws IOException, InterruptedException {
  ref=this;
  this.port=port;
  Activator.frameworkLogger=logger;
  embeddedMode=true;
  config=Config.getRef();
}

Fixed version (ground truth):
/** 
 * Constructor for running as an embedded bundle in the Knapsack bootstrap.
 * @param logger instance of framework logger.
 * @throws IOException Upon configuration error.
 * @throws InterruptedException Upon interruption.
 */
public Activator(Config config,Logger logger,int port) throws IOException, InterruptedException {
  ref=this;
  this.port=port;
  Activator.frameworkLogger=logger;
  embeddedMode=true;
  this.config=config;
}
Program: 178697
Project: 178697
Buggy source:
private static void createKnapsackLayout(File baseDirectory,Logger logger,int port) throws IOException {
  File confFile=new File(baseDirectory,Config.CONFIGURATION_FILENAME);
  scriptDir=new File(baseDirectory,Config.SCRIPT_DIRECTORY_NAME);
  FSHelper.validateFile(scriptDir,true,true,false,true);
  if (!confFile.exists()) {
    logger.log(LogService.LOG_INFO,"String_Node_Str" + confFile);
    FSHelper.copyDefaultConfiguration(Config.CONFIGURATION_RESOURCE_FILENAME,confFile,baseDirectory);
  }
  if (FSHelper.directoryHasFiles(scriptDir))   FSHelper.deleteFilesInDir(scriptDir);
  FSHelper.copyScripts(confFile.getParentFile(),port);
}

Fixed version (ground truth):
private static void createKnapsackLayout(File baseDirectory,Logger logger,int port) throws IOException {
  File confFile=new File(baseDirectory,Config.CONFIGURATION_FILENAME);
  scriptDir=new File(baseDirectory,Config.SCRIPT_DIRECTORY_NAME);
  FSHelper.validateFile(scriptDir,true,true,false,true);
  if (!confFile.exists()) {
    logger.log(LogService.LOG_INFO,"String_Node_Str" + confFile);
    FSHelper.copyDefaultConfiguration(Config.CONFIGURATION_RESOURCE_FILENAME,confFile,baseDirectory);
  }
  if (FSHelper.directoryHasFiles(scriptDir))   FSHelper.deleteFilesInDir(scriptDir);
  FSHelper.copyScripts(confFile.getParentFile(),port);
  File defaultDir=new File(baseDirectory,Config.DEFAULT_DIRECTORY_NAME);
  FSHelper.validateFile(defaultDir,true,true,false,true);
  File configAdminDir=new File(baseDirectory,Config.CONFIGADMIN_DIRECTORY_NAME);
  FSHelper.validateFile(configAdminDir,true,true,false,true);
}
Program: 178699
Project: 178699
Buggy source:
/** 
 * Generate the default configuration.
 * @param targetConfFile
 * @return
 * @throws IOException
 */
public static void copyDefaultConfiguration(String sourceResourceFilename,File targetConfFile,File baseDirectory) throws IOException {
  InputStream istream=Config.class.getResourceAsStream(sourceResourceFilename);
  if (istream == null)   throw new IOException("String_Node_Str" + sourceResourceFilename);
  OutputStream fos=new FileOutputStream(targetConfFile);
  IOUtils.copy(istream,fos);
  if (baseDirectory != null) {
    File configAdminDir=new File(baseDirectory,Activator.CONFIGADMIN_FILENAME);
    validateFile(configAdminDir,true,true,false,true);
    IOUtils.write(LS + "String_Node_Str" + configAdminDir,fos);
  }
  istream.close();
  fos.close();
}

Fixed version (ground truth):
/** 
 * Generate the default configuration.
 * @param targetConfFile
 * @return
 * @throws IOException
 */
public static void copyDefaultConfiguration(String sourceResourceFilename,File targetConfFile,File baseDirectory) throws IOException {
  InputStream istream=Config.class.getResourceAsStream(sourceResourceFilename);
  if (istream == null)   throw new IOException("String_Node_Str" + sourceResourceFilename);
  OutputStream fos=new FileOutputStream(targetConfFile);
  IOUtils.copy(istream,fos);
  if (baseDirectory != null) {
    File configAdminDir=new File(baseDirectory,Config.CONFIGADMIN_DIRECTORY_NAME);
    validateFile(configAdminDir,true,true,false,true);
    IOUtils.write(LS + "String_Node_Str" + configAdminDir,fos);
  }
  istream.close();
  fos.close();
}
Program: 178700
Project: 178700
Buggy source:
/** 
 * Assume all files in default directory are property files.
 * @param f
 * @return
 */
private boolean isDefaultFile(File f){
  return f.getParentFile().getName().equals(Activator.DEFAULT_FILENAME);
}

Fixed version (ground truth):
/** 
 * Assume all files in default directory are property files.
 * @param f
 * @return
 */
private boolean isDefaultFile(File f){
  return f.getParentFile().getName().equals(Config.DEFAULT_DIRECTORY_NAME);
}
Program: 178705
Project: 178705
Buggy source:
public void onDisable(){
  EntityRemoveEvent ere;
  for (  World w : getServer().getWorlds())   for (  Entity e : w.getEntities()) {
    ere=new EntityRemoveEvent(e);
    eL.despawn(ere);
  }
  for (  Region region : regionManager.regions.values()) {
    for (    Portal p : region.portals)     p.delete();
  }
  funnelBridgeManager.deleteAll();
}

Fixed version (ground truth):
public void onDisable(){
  EntityRemoveEvent ere;
  for (  World w : getServer().getWorlds())   for (  Entity e : w.getEntities()) {
    ere=new EntityRemoveEvent(e);
    eL.despawn(ere);
  }
  for (  Region region : regionManager.regions.values()) {
    for (    Portal p : region.portals)     p.delete();
  }
  funnelBridgeManager.deleteAll();
  getServer().getScheduler().cancelTasks(this);
}
Program: 178708
Project: 178708
Buggy source:
public void redGel(Player player,Vector vector,Region region){
  if (player.isSneaking()) {
    vector=vector.setX(0);
    vector=vector.setZ(0);
  }
 else {
    vector=vector.setX(vector.getX() * region.getDouble(RegionSetting.RED_GEL_VELOCITY_MULTIPLIER));
    vector=vector.setZ(vector.getZ() * region.getDouble(RegionSetting.RED_GEL_VELOCITY_MULTIPLIER));
  }
  if (vector.getX() > 11)   vector=vector.setX(11);
  if (vector.getZ() > 11)   vector=vector.setZ(11);
  if (vector.getX() < -11)   vector=vector.setX(-11);
  if (vector.getZ() < -11)   vector=vector.setZ(-11);
  player.setVelocity(vector);
}

Fixed version (ground truth):
private boolean redGel(Player player,Block under,Region region){
  String pn=player.getName();
  String rg=region.getString(RegionSetting.RED_GEL_BLOCK);
  if (onRedGel.containsKey(pn)) {
    if (!plugin.blockUtil.compareBlockToString(under,rg)) {
      resetPlayer(player);
      return false;
    }
    return true;
  }
  if (!plugin.blockUtil.compareBlockToString(under,rg))   return false;
  float os=player.getWalkSpeed();
  player.setWalkSpeed(os * (float)region.getDouble(RegionSetting.RED_GEL_VELOCITY_MULTIPLIER));
  onRedGel.put(pn,os);
  return true;
}
Program: 178710
Project: 178710
Buggy source:
@Override public void run(){
  Block b;
  for (  Grill g : grills.toArray(new Grill[0])) {
    b=g.firstBlock.getHandle().getBlock();
    if (g.disabled || !b.getWorld().isChunkLoaded(b.getChunk()))     continue;
    if (!g.create()) {
      V10Location loc=g.firstBlock;
      g.delete();
      placeRecursiveEmancipationGrill(loc);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
}
Program: 178712
Project: 178712
Buggy source:
public void deleteInside(){
  for (  V10Location b : inside) {
    b.getHandle().getBlock().setType(Material.AIR);
    plugin.grillManager.insideBlocks.remove(b.getHandle());
  }
}

Fixed version (ground truth):
public void deleteInside(){
  for (  V10Location b : inside) {
    b.getHandle().getBlock().setType(Material.AIR);
    plugin.grillManager.insideBlocks.remove(b);
  }
}
Program: 178713
Project: 178713
Buggy source:
public void delete(){
  deleteInside();
  plugin.config.deleteGrill(getStringLocation());
  plugin.grillManager.grills.remove(this);
  plugin.config.saveAll();
  for (  V10Location b : border) {
    plugin.grillManager.borderBlocks.remove(b.getHandle());
  }
}

Fixed version (ground truth):
public void delete(){
  deleteInside();
  plugin.config.deleteGrill(getStringLocation());
  plugin.grillManager.grills.remove(this);
  plugin.config.saveAll();
  for (  V10Location b : border)   plugin.grillManager.borderBlocks.remove(b);
}
Program: 178714
Project: 178714
Buggy source:
public void setPortalInventory(Player player,Region region){
  PlayerInventory inv=player.getInventory();
  for (int i=0; i < 40; i++) {
    ItemStack item=inv.getItem(i);
    if (item == null || item.getTypeId() == 0)     continue;
    Boolean keep=false;
    for (    Object is : region.getList(RegionSetting.GRILL_INVENTORY_CLEAR_EXCEPTIONS)) {
      ItemStack itemcheck=plugin.util.getItemData((String)is);
      if (item.getTypeId() == itemcheck.getTypeId()) {
        keep=true;
        break;
      }
    }
    if (!keep)     inv.clear(i);
  }
  for (  Object is : region.getList(RegionSetting.UNIQUE_INVENTORY_ITEMS)) {
    ItemStack item=plugin.util.getItemData((String)is);
    if (item.getTypeId() == plugin.config.PortalTool && item.getDurability() == plugin.config.portalToolData)     inv.setItemInHand(item);
 else     inv.addItem(item);
  }
}

Fixed version (ground truth):
public void setPortalInventory(Player player,Region region){
  PlayerInventory inv=player.getInventory();
  for (int i=0; i < 40; i++) {
    ItemStack item=inv.getItem(i);
    if (item == null || item.getTypeId() == 0)     continue;
    boolean keep=false;
    for (    Object is : region.getList(RegionSetting.GRILL_INVENTORY_CLEAR_EXCEPTIONS)) {
      ItemStack itemcheck=plugin.util.getItemData((String)is);
      if (item.getTypeId() == itemcheck.getTypeId()) {
        keep=true;
        break;
      }
    }
    if (!keep)     inv.clear(i);
  }
  for (  Object is : region.getList(RegionSetting.UNIQUE_INVENTORY_ITEMS)) {
    ItemStack item=plugin.util.getItemData((String)is);
    if (item.getTypeId() == plugin.config.PortalTool && item.getDurability() == plugin.config.portalToolData)     inv.setItemInHand(item);
 else     inv.addItem(item);
  }
}
Program: 178717
Project: 178717
Buggy source:
@EventHandler(ignoreCancelled=true) public void onBlockPlace(BlockPlaceEvent event){
  Material block=event.getBlock().getType();
  Bridge bridge=plugin.funnelBridgeManager.bridgeBlocks.get(new V10Location(event.getBlock()));
  if (bridge != null) {
    event.setCancelled(true);
  }
  if (block == Material.RAILS || block == Material.POWERED_RAIL || block == Material.DETECTOR_RAIL)   return;
  Portal portal=plugin.portalManager.insideBlocks.get(event.getBlockPlaced().getLocation());
  if (portal != null) {
    event.setCancelled(true);
    return;
  }
}

Fixed version (ground truth):
@EventHandler(ignoreCancelled=true) public void onBlockPlace(BlockPlaceEvent event){
  Material block=event.getBlock().getType();
  Bridge bridge=plugin.funnelBridgeManager.bridgeBlocks.get(new V10Location(event.getBlock()));
  if (bridge != null)   event.setCancelled(true);
  if (block == Material.RAILS || block == Material.POWERED_RAIL || block == Material.DETECTOR_RAIL)   return;
  Portal portal=plugin.portalManager.insideBlocks.get(new V10Location(event.getBlockPlaced()));
  if (portal != null) {
    event.setCancelled(true);
    return;
  }
}
Program: 178718
Project: 178718
Buggy source:
@EventHandler(ignoreCancelled=true) public void onBlockPhysics(BlockPhysicsEvent event){
  if (event.getBlock().getType() != Material.SUGAR_CANE_BLOCK)   return;
  Grill grill=plugin.grillManager.insideBlocks.get(event.getBlock().getLocation());
  if (grill == null)   return;
  event.setCancelled(true);
}

Fixed version (ground truth):
@EventHandler(ignoreCancelled=true) public void onBlockPhysics(BlockPhysicsEvent event){
  if (event.getBlock().getType() != Material.SUGAR_CANE_BLOCK)   return;
  System.out.print("String_Node_Str");
  Grill grill=plugin.grillManager.insideBlocks.get(new V10Location(event.getBlock().getLocation()));
  if (grill != null) {
    event.setCancelled(true);
    System.out.print("String_Node_Str");
  }
}
Program: 178719
Project: 178719
Buggy source:
public void onBlockPistonRetract(BlockPistonRetractEvent event){
  if (event.isCancelled() || !event.isSticky())   return;
  if (blockedPistonBlocks.contains(event.getRetractLocation().getBlock())) {
    event.setCancelled(true);
    return;
  }
  Region region=plugin.regionManager.getRegion(new V10Location(event.getBlock()));
  Portal portal=plugin.portalManager.insideBlocks.get(event.getRetractLocation());
  if (portal != null && region.getBoolean(RegionSetting.ENABLE_PISTON_BLOCK_TELEPORT)) {
    Portal destP=portal.getDestination();
    final Block sourceB=destP.teleport.getHandle().getBlock();
    if (!sourceB.isLiquid() && sourceB.getType() != Material.AIR) {
      final Block endBlock=event.getRetractLocation().getBlock().getRelative(event.getDirection().getOppositeFace());
      blockedPistonBlocks.add(endBlock);
      plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
        public void run(){
          endBlock.setType(sourceB.getType());
          endBlock.setData(sourceB.getData());
          sourceB.setType(Material.AIR);
          blockedPistonBlocks.remove(endBlock);
        }
      }
,1L);
    }
  }
 else   if (plugin.portalManager.borderBlocks.containsKey(event.getRetractLocation()) || plugin.grillManager.borderBlocks.containsKey(event.getRetractLocation()) || plugin.grillManager.insideBlocks.containsKey(event.getRetractLocation())) {
    event.setCancelled(true);
  }
  plugin.funnelBridgeManager.updateBridge(new V10Location(event.getRetractLocation()));
}

Fixed version (ground truth):
public void onBlockPistonRetract(BlockPistonRetractEvent event){
  if (event.isCancelled() || !event.isSticky())   return;
  if (blockedPistonBlocks.contains(event.getRetractLocation().getBlock())) {
    event.setCancelled(true);
    return;
  }
  Region region=plugin.regionManager.getRegion(new V10Location(event.getBlock()));
  Portal portal=plugin.portalManager.insideBlocks.get(new V10Location(event.getRetractLocation()));
  if (portal != null && region.getBoolean(RegionSetting.ENABLE_PISTON_BLOCK_TELEPORT)) {
    Portal destP=portal.getDestination();
    final Block sourceB=destP.teleport.getHandle().getBlock();
    if (!sourceB.isLiquid() && sourceB.getType() != Material.AIR) {
      final Block endBlock=event.getRetractLocation().getBlock().getRelative(event.getDirection().getOppositeFace());
      blockedPistonBlocks.add(endBlock);
      plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin,new Runnable(){
        public void run(){
          endBlock.setType(sourceB.getType());
          endBlock.setData(sourceB.getData());
          sourceB.setType(Material.AIR);
          blockedPistonBlocks.remove(endBlock);
        }
      }
,1L);
    }
  }
 else {
    V10Location loc=new V10Location(event.getRetractLocation());
    if (plugin.portalManager.borderBlocks.containsKey(loc) || plugin.grillManager.borderBlocks.containsKey(loc) || plugin.grillManager.insideBlocks.containsKey(loc))     event.setCancelled(true);
  }
  plugin.funnelBridgeManager.updateBridge(new V10Location(event.getRetractLocation()));
}
Program: 178723
Project: 178723
Buggy source:
@Override public void run(){
  if (portal != null)   portal.disabled=false;
}

Fixed version (ground truth):
@Override public void run(){
  Location oloc;
  Vector vector;
  for (  World w : plugin.getServer().getWorlds()) {
    for (    Entity e : w.getEntities()) {
      if (e instanceof Player || e instanceof Vehicle || e.isDead())       continue;
      vector=e.getVelocity();
      oloc=e.getLocation();
      teleport(e,oloc,new V10Location(oloc),vector,true);
      plugin.funnelBridgeManager.EntityMoveCheck(e);
    }
  }
}
Program: 178725
Project: 178725
Buggy source:
@EventHandler() public void onEntityDamage(EntityDamageEvent event){
  if (event.isCancelled())   return;
  if (event.getEntity() instanceof Player) {
    Player player=(Player)event.getEntity();
    if (!plugin.hasPermission(player,plugin.PERM_DAMAGE_BOOTS))     return;
    Region region=plugin.regionManager.getRegion(new V10Location(player.getLocation()));
    if (event.getCause() == DamageCause.FALL && region.getBoolean(RegionSetting.ENABLE_FALL_DAMAGE_BOOTS) && region.getInt(RegionSetting.FALL_DAMAGE_BOOTS) == player.getInventory().getBoots().getTypeId())     event.setCancelled(true);
  }
}

Fixed version (ground truth):
@EventHandler() public void onEntityDamage(EntityDamageEvent event){
  if (event.isCancelled())   return;
  if (event.getEntity() instanceof Player) {
    Player player=(Player)event.getEntity();
    if (!plugin.hasPermission(player,plugin.PERM_DAMAGE_BOOTS))     return;
    Region region=plugin.regionManager.getRegion(new V10Location(player.getLocation()));
    ItemStack is=player.getInventory().getBoots();
    if (event.getCause() == DamageCause.FALL && region.getBoolean(RegionSetting.ENABLE_FALL_DAMAGE_BOOTS) && is == null ? false : region.getInt(RegionSetting.FALL_DAMAGE_BOOTS) == is.getTypeId())     event.setCancelled(true);
  }
}