nus-yam/ex-repair huggingface dataset:
Program: 147181
Project: 147181
Buggy source:
/** 
 * setCoordinateValue allows the user to set the value of the passed in Coordinate to the specified newValue This call, also updates the Graphics window if needed.
 * @param coordinate
 * @param newValue 
 */
static public void setCoordinateValue(final Coordinate coordinate,final double newValue){
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      getModelState(coordinate.getModel()).setValue(coordinate,newValue);
      ViewDB.getInstance().updateModelDisplay(coordinate.getModel());
      MotionsDB.getInstance().reportTimeChange(0);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * setCoordinateValue allows the user to set the value of the passed in Coordinate to the specified newValue This call, also updates the Graphics window if needed.
 * @param coordinate
 * @param newValue 
 */
static public void setCoordinateValue(final Coordinate coordinate,final double newValue){
  getModelState(coordinate.getModel()).setValue(coordinate,newValue);
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      ViewDB.getInstance().updateModelDisplay(coordinate.getModel());
      MotionsDB.getInstance().reportTimeChange(0);
    }
  }
);
}
Program: 147182
Project: 147182
Buggy source:
private void RestoreAllButtonActionPerformed(java.awt.event.ActionEvent evt){
  restoreActuators();
}

Fixed version (ground truth):
private void RestoreAllButtonActionPerformed(java.awt.event.ActionEvent evt){
}
Program: 147183
Project: 147183
Buggy source:
private void AddMarkerButtonActionPerformed(java.awt.event.ActionEvent evt){
  addMarker();
}

Fixed version (ground truth):
private void AddMarkerButtonActionPerformed(java.awt.event.ActionEvent evt){
}
Program: 147184
Project: 147184
Buggy source:
public String getFullname(String modelFilePath,String bareFileName,boolean debug){
  String candidate=modelFilePath + File.separator + bareFileName;
  if (debug)   OpenSimLogger.logMessage("String_Node_Str" + candidate + "String_Node_Str",OpenSimLogger.INFO);
  if (new File(candidate).exists())   return candidate;
  candidate=modelFilePath + File.separator + "String_Node_Str"+ File.separator+ bareFileName;
  if (debug)   OpenSimLogger.logMessage("String_Node_Str" + candidate + "String_Node_Str",OpenSimLogger.INFO);
  if (new File(candidate).exists())   return candidate;
  String GeometryPath=Preferences.userNodeForPackage(TheApp.class).get("String_Node_Str","String_Node_Str");
  if (GeometryPath != null) {
    StringTokenizer tokenizer=new StringTokenizer(GeometryPath,File.pathSeparator);
    Vector<String> dirList=new Vector<String>(4);
    while (tokenizer.hasMoreElements()) {
      String nextDir=tokenizer.nextToken();
      candidate=nextDir + File.separator + bareFileName;
      if (debug)       OpenSimLogger.logMessage("String_Node_Str" + candidate + "String_Node_Str",OpenSimLogger.INFO);
      if (new File(candidate).exists())       return candidate;
    }
  }
  candidate="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ bareFileName;
  if (debug)   OpenSimLogger.logMessage("String_Node_Str" + candidate + "String_Node_Str",OpenSimLogger.INFO);
  if (new File(candidate).exists())   return candidate;
  if (debug)   System.out.println("String_Node_Str" + candidate);
  return null;
}

Fixed version (ground truth):
public String getFullname(String modelFilePath,String bareFileName,boolean debug){
  String candidate=modelFilePath + File.separator + bareFileName;
  if (debug)   OpenSimLogger.logMessage("String_Node_Str" + candidate + "String_Node_Str",OpenSimLogger.INFO);
  if (isValidFile(candidate))   return candidate;
  candidate=modelFilePath + File.separator + "String_Node_Str"+ File.separator+ bareFileName;
  if (debug)   OpenSimLogger.logMessage("String_Node_Str" + candidate + "String_Node_Str",OpenSimLogger.INFO);
  if (isValidFile(candidate))   return candidate;
  String GeometryPath=Preferences.userNodeForPackage(TheApp.class).get("String_Node_Str","String_Node_Str");
  if (GeometryPath != null) {
    StringTokenizer tokenizer=new StringTokenizer(GeometryPath,File.pathSeparator);
    Vector<String> dirList=new Vector<String>(4);
    while (tokenizer.hasMoreElements()) {
      String nextDir=tokenizer.nextToken();
      candidate=nextDir + File.separator + bareFileName;
      if (debug)       OpenSimLogger.logMessage("String_Node_Str" + candidate + "String_Node_Str",OpenSimLogger.INFO);
      if (isValidFile(candidate))       return candidate;
    }
  }
  candidate="String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ bareFileName;
  if (debug)   OpenSimLogger.logMessage("String_Node_Str" + candidate + "String_Node_Str",OpenSimLogger.INFO);
  if (isValidFile(candidate))   return candidate;
  if (debug)   System.out.println("String_Node_Str" + candidate);
  return null;
}
Program: 147185
Project: 147185
Buggy source:
ScaleToolWorker() throws Exception {
  updateScaleTool();
  progressHandle=ProgressHandleFactory.createHandle("String_Node_Str",new Cancellable(){
    public boolean cancel(){
      interrupt();
      return true;
    }
  }
);
  progressHandle.start();
  processedModel=new Model(unscaledModel);
  processedModel.setName(scaleTool.getName());
  processedModel.setInputFileName("String_Node_Str");
  processedModel.setOriginalModelPathFromModel(unscaledModel);
  setExecuting(true);
}

Fixed version (ground truth):
ScaleToolWorker() throws Exception {
  System.out.println("String_Node_Str" + scaleTool.getModelScaler().getMeasurementSet().dump());
  updateScaleTool();
  System.out.println("String_Node_Str" + scaleTool.getModelScaler().getMeasurementSet().dump());
  progressHandle=ProgressHandleFactory.createHandle("String_Node_Str",new Cancellable(){
    public boolean cancel(){
      interrupt();
      return true;
    }
  }
);
  progressHandle.start();
  processedModel=new Model(unscaledModel);
  processedModel.setName(scaleTool.getName());
  processedModel.setInputFileName("String_Node_Str");
  processedModel.setOriginalModelPathFromModel(unscaledModel);
  setExecuting(true);
}
Program: 147186
Project: 147186
Buggy source:
public Object construct(){
  result=true;
  if (getModelScalerEnabled()) {
    System.out.println("String_Node_Str");
    processedModelContext=OpenSimDB.getInstance().createContext(processedModel);
    String t=unscaledModel.getFilePath();
    scaleTool.getMarkerPlacer().setOutputModelFileName(t + scaleTool.getMarkerPlacer().getOutputModelFileName());
    if (!processedModelContext.processModelScale(scaleTool.getModelScaler(),processedModel,"String_Node_Str",scaleTool.getSubjectMass())) {
      result=false;
      return this;
    }
  }
  if (getMarkerPlacerEnabled()) {
    System.out.println("String_Node_Str");
    if (!processedModelContext.processModelMarkerPlacer(scaleTool.getMarkerPlacer(),processedModel,"String_Node_Str")) {
      result=false;
      return this;
    }
  }
  return this;
}

Fixed version (ground truth):
public Object construct(){
  result=true;
  if (getModelScalerEnabled()) {
    System.out.println("String_Node_Str");
    processedModelContext=OpenSimDB.getInstance().createContext(processedModel);
    String t=unscaledModel.getFilePath();
    scaleTool.getMarkerPlacer().setOutputModelFileName(t + scaleTool.getMarkerPlacer().getOutputModelFileName());
    System.out.println("String_Node_Str" + scaleTool.getModelScaler().getMeasurementSet().dump());
    if (!processedModelContext.processModelScale(scaleTool.getModelScaler(),processedModel,"String_Node_Str",scaleTool.getSubjectMass())) {
      result=false;
      return this;
    }
  }
  if (getMarkerPlacerEnabled()) {
    System.out.println("String_Node_Str");
    if (!processedModelContext.processModelMarkerPlacer(scaleTool.getMarkerPlacer(),processedModel,"String_Node_Str")) {
      result=false;
      return this;
    }
  }
  return this;
}
Program: 147187
Project: 147187
Buggy source:
public void toModelScaler(){
  ModelScaler modelScaler=scaleToolModel.getScaleTool().getModelScaler();
  ArrayStr array=new ArrayStr();
  MeasurementSet measurementSet=modelScaler.getMeasurementSet();
  if (measurementSet.getSize() > 0)   array.append("String_Node_Str");
  for (int i=0; i < measurementSet.getSize(); i++) {
    measurementSet.get(i).getBodyScaleSet().setSize(0);
    measurementSet.get(i).setApply(false);
  }
  for (int i=0; i < size(); i++) {
    for (int j=0; j < 3; j++) {
      if (get(i).measurements[j] >= 0)       addToMeasurement(get(i).measurements[j],bodySet.get(i).getName(),j);
    }
  }
  modelScaler.getScaleSet().setSize(0);
  for (int i=0; i < size(); i++) {
    if (get(i).useManualScale() || !get(i).manualScalesAreIdentity()) {
      Scale scale=new Scale();
      scale.setSegmentName(bodySet.get(i).getName());
      scale.setApply(get(i).useManualScale());
      double[] scales=new double[3];
      for (int j=0; j < 3; j++) {
        scales[j]=get(i).manualScales[j];
      }
      scale.setScaleFactors(scales);
      modelScaler.getScaleSet().cloneAndAppend(scale);
    }
  }
  if (modelScaler.getScaleSet().getSize() > 0)   array.append("String_Node_Str");
  modelScaler.setScalingOrder(array);
}

Fixed version (ground truth):
public void toModelScaler(){
  ModelScaler modelScaler=scaleToolModel.getScaleTool().getModelScaler();
  ArrayStr array=new ArrayStr();
  MeasurementSet measurementSet=modelScaler.getMeasurementSet();
  if (measurementSet.getSize() > 0)   array.append("String_Node_Str");
  for (int i=0; i < measurementSet.getSize(); i++) {
    measurementSet.get(i).getBodyScaleSet().setSize(0);
    measurementSet.get(i).setApply(false);
  }
  for (int i=0; i < size(); i++) {
    for (int j=0; j < 3; j++) {
      if (get(i).measurements[j] >= 0)       addToMeasurement(get(i).measurements[j],bodySet.get(i).getName(),j);
    }
  }
  modelScaler.getScaleSet().setSize(0);
  for (int i=0; i < size(); i++) {
    if (get(i).useManualScale() || !get(i).manualScalesAreIdentity()) {
      Scale scale=new Scale();
      scale.setSegmentName(bodySet.get(i).getName());
      scale.setApply(get(i).useManualScale());
      double[] scales=new double[3];
      for (int j=0; j < 3; j++) {
        scales[j]=get(i).manualScales[j];
      }
      scale.setScaleFactors(scales);
      modelScaler.getScaleSet().adoptAndAppend(Scale.safeDownCast(scale.clone()));
    }
  }
  if (modelScaler.getScaleSet().getSize() > 0)   array.append("String_Node_Str");
  modelScaler.setScalingOrder(array);
}
Program: 147188
Project: 147188
Buggy source:
void addMeasurement(String name){
  MeasurementSet measurementSet=getMeasurementSet();
  Measurement measurement=new Measurement();
  measurement.setName(name);
  measurementSet.cloneAndAppend(measurement);
  measurementValues.add(null);
  setModified(Operation.MeasurementSetChanged);
}

Fixed version (ground truth):
void addMeasurement(String name){
  MeasurementSet measurementSet=getMeasurementSet();
  Measurement measurement=new Measurement();
  measurement.setName(name);
  measurementSet.adoptAndAppend(Measurement.safeDownCast(measurement.clone()));
  measurementValues.add(null);
  setModified(Operation.MeasurementSetChanged);
}
Program: 147189
Project: 147189
Buggy source:
private ScaleSet createIdentityScaleSet(){
  BodySet bodySet=getUnscaledModel().getBodySet();
  ScaleSet scaleSet=new ScaleSet();
  double[] identityScale=new double[]{1.,1.,1.};
  for (int i=0; i < bodySet.getSize(); i++) {
    Scale scale=new Scale();
    scale.setSegmentName(bodySet.get(i).getName());
    scale.setScaleFactors(identityScale);
    scale.setApply(true);
    scaleSet.cloneAndAppend(scale);
  }
  return scaleSet;
}

Fixed version (ground truth):
private ScaleSet createIdentityScaleSet(){
  BodySet bodySet=getUnscaledModel().getBodySet();
  ScaleSet scaleSet=new ScaleSet();
  double[] identityScale=new double[]{1.,1.,1.};
  for (int i=0; i < bodySet.getSize(); i++) {
    Scale scale=new Scale();
    scale.setSegmentName(bodySet.get(i).getName());
    scale.setScaleFactors(identityScale);
    scale.setApply(true);
    scaleSet.adoptAndAppend(Scale.safeDownCast(scale.clone()));
  }
  return scaleSet;
}
Program: 147190
Project: 147190
Buggy source:
private void updateScaleTool(){
  scaleTool.setPrintResultFiles((scaleTool.getMarkerPlacer().getOutputModelFileName() != "String_Node_Str"));
  scaleTool.getGenericModelMaker().setMarkerSetFileName(extraMarkerSetFile.toProperty());
  scaleTool.getModelScaler().setMarkerFileName(measurementTrialFile.toProperty());
  bodySetScaleFactors.toModelScaler();
  ikCommonModel.toMarkerPlacer(scaleTool.getMarkerPlacer());
}

Fixed version (ground truth):
private void updateScaleTool(){
  scaleTool.setPrintResultFiles((scaleTool.getMarkerPlacer().getOutputModelFileName() != "String_Node_Str"));
  scaleTool.getGenericModelMaker().setMarkerSetFileName(extraMarkerSetFile.toProperty());
  scaleTool.getModelScaler().setMarkerFileName(measurementTrialFile.toProperty());
  System.out.println("String_Node_Str" + scaleTool.getModelScaler().getMeasurementSet().dump());
  bodySetScaleFactors.toModelScaler();
  System.out.println("String_Node_Str" + scaleTool.getModelScaler().getMeasurementSet().dump());
  ikCommonModel.toMarkerPlacer(scaleTool.getMarkerPlacer());
}
Program: 147192
Project: 147192
Buggy source:
private void addToMeasurement(int index,String bodyName,int axis){
  ModelScaler modelScaler=scaleToolModel.getScaleTool().getModelScaler();
  Measurement meas=modelScaler.getMeasurementSet().get(index);
  meas.setApply(true);
  BodyScaleSet bodyScaleSet=meas.getBodyScaleSet();
  int bodyScaleIndex=bodyScaleSet.getIndex(bodyName);
  BodyScale bodyScale=null;
  if (bodyScaleIndex < 0) {
    bodyScale=new BodyScale();
    bodyScale.setName(bodyName);
    modelScaler.getMeasurementSet().get(index).getBodyScaleSet().cloneAndAppend(bodyScale);
  }
 else   bodyScale=bodyScaleSet.get(bodyScaleIndex);
  if (axis == 0 || axis == -1)   bodyScale.getAxisNames().append("String_Node_Str");
  if (axis == 1 || axis == -1)   bodyScale.getAxisNames().append("String_Node_Str");
  if (axis == 2 || axis == -1)   bodyScale.getAxisNames().append("String_Node_Str");
}

Fixed version (ground truth):
private void addToMeasurement(int index,String bodyName,int axis){
  ModelScaler modelScaler=scaleToolModel.getScaleTool().getModelScaler();
  Measurement meas=modelScaler.getMeasurementSet().get(index);
  meas.setApply(true);
  BodyScaleSet bodyScaleSet=meas.getBodyScaleSet();
  int bodyScaleIndex=bodyScaleSet.getIndex(bodyName);
  BodyScale bodyScale=null;
  if (bodyScaleIndex < 0) {
    bodyScale=BodyScale.safeDownCast((new BodyScale()).clone());
    bodyScale.setName(bodyName);
    modelScaler.getMeasurementSet().get(index).getBodyScaleSet().adoptAndAppend(bodyScale);
  }
 else   bodyScale=bodyScaleSet.get(bodyScaleIndex);
  if (axis == 0 || axis == -1)   bodyScale.getAxisNames().append("String_Node_Str");
  if (axis == 1 || axis == -1)   bodyScale.getAxisNames().append("String_Node_Str");
  if (axis == 2 || axis == -1)   bodyScale.getAxisNames().append("String_Node_Str");
}
Program: 147193
Project: 147193
Buggy source:
public void setInitialStatesFileName(String fileName){
  if (!getInitialStatesFileName().equals(fileName)) {
    forwardTool().setStatesFileName(fileName);
    setModified(AbstractToolModel.Operation.InputDataChanged);
  }
}

Fixed version (ground truth):
public void setInitialStatesFileName(String fileName){
  if (!getInitialStatesFileName().equals(fileName)) {
    forwardTool().setStatesFileName(fileName);
    setModified(AbstractToolModel.Operation.InputDataChanged);
    try {
      Storage s=new Storage(fileName);
      updateStatesTimeRange(s.getFirstTime(),s.getLastTime());
    }
 catch (    IOException ex) {
      ex.printStackTrace();
    }
  }
}
Program: 147194
Project: 147194
Buggy source:
public void setControlsFileName(String fileName){
  if (!getControlsFileName().equals(fileName)) {
    forwardTool().setControlsFileName(fileName);
    setModified(AbstractToolModel.Operation.InputDataChanged);
  }
}

Fixed version (ground truth):
public void setControlsFileName(String fileName){
  if (!getControlsFileName().equals(fileName)) {
    forwardTool().setControlsFileName(fileName);
    setModified(AbstractToolModel.Operation.InputDataChanged);
    double startTime=0, endTime=1;
    if (fileName.endsWith("String_Node_Str")) {
      ControlSet set=new ControlSet(fileName);
      if (set.getSize() > 0) {
        Control c=set.get(0);
        if (c != null) {
          ControlLinear cl=ControlLinear.safeDownCast(c);
          startTime=cl.getFirstTime();
          endTime=cl.getLastTime();
        }
      }
    }
 else     if (fileName.endsWith("String_Node_Str")) {
      try {
        Storage s=new Storage(fileName);
        startTime=s.getFirstTime();
        endTime=s.getLastTime();
      }
 catch (      IOException ex) {
        ex.printStackTrace();
      }
    }
    updateControlTimeRange(startTime,endTime);
  }
}
Program: 147195
Project: 147195
Buggy source:
/** 
 * Load a motion file, and associate it with a model. We try to associate the motion with current model first if something doesn't look right (e.g. no coordinates or markers match, warn and ask user either to select another model or abort loading. A side effect of changing the model associated with a loaded motion is that the new model becomes current.
 */
public void loadMotionFile(String fileName,boolean primary){
  Storage storage=null;
  try {
    storage=new Storage(fileName);
  }
 catch (  IOException ex) {
    ex.printStackTrace();
    DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message("String_Node_Str" + fileName));
    return;
  }
  saveStorageFileName(storage,fileName);
  final Storage newMotion=storage;
  Model currentModel=OpenSimDB.getInstance().getCurrentModel();
  AnalyzeTool.fixMuscleStatesToValidRange(newMotion,currentModel);
  loadMotionStorage(newMotion,primary);
}

Fixed version (ground truth):
/** 
 * Load a motion file, and associate it with a model. We try to associate the motion with current model first if something doesn't look right (e.g. no coordinates or markers match, warn and ask user either to select another model or abort loading. A side effect of changing the model associated with a loaded motion is that the new model becomes current.
 */
public void loadMotionFile(String fileName,boolean primary){
  Storage storage=null;
  try {
    storage=new Storage(fileName);
  }
 catch (  IOException ex) {
    ex.printStackTrace();
    DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message("String_Node_Str" + fileName));
    return;
  }
  saveStorageFileName(storage,fileName);
  loadMotionStorage(storage,primary);
}
Program: 147196
Project: 147196
Buggy source:
public String toString(){
  return ((Plot)getUserObject()).getTitle();
}

Fixed version (ground truth):
public String toString(){
  Object userObj=getUserObject();
  if (userObj instanceof Plot)   return ((Plot)userObj).getTitle();
 else   return "String_Node_Str";
}
Program: 147197
Project: 147197
Buggy source:
public Component getTreeCellEditorComponent(JTree tree,Object value,boolean isSelected,boolean expanded,boolean leaf,int row){
  if (value instanceof DefaultMutableTreeNode) {
    DefaultMutableTreeNode node=(DefaultMutableTreeNode)value;
    Object userObject=node.getUserObject();
    if (userObject instanceof PlotCurve) {
      item=(PlotCurve)node.getUserObject();
    }
 else     if (userObject instanceof Plot) {
      topItem=(Plot)node.getUserObject();
    }
  }
  return super.getTreeCellEditorComponent(tree,value,isSelected,expanded,leaf,row);
}

Fixed version (ground truth):
public Component getTreeCellEditorComponent(JTree tree,Object value,boolean isSelected,boolean expanded,boolean leaf,int row){
  if (value instanceof DefaultMutableTreeNode) {
    DefaultMutableTreeNode node=(DefaultMutableTreeNode)value;
    Object userObject=node.getUserObject();
    if (userObject instanceof PlotCurve) {
      item=(PlotCurve)node.getUserObject();
      topItem=null;
    }
 else     if (userObject instanceof Plot) {
      topItem=(Plot)node.getUserObject();
      item=null;
    }
  }
  return super.getTreeCellEditorComponent(tree,value,isSelected,expanded,leaf,row);
}
Program: 147198
Project: 147198
Buggy source:
void applyColorsFromModel(){
  VisibleObject bodyVisibleObject=body.getDisplayer();
  GeometrySet gSet=bodyVisibleObject.getGeometrySet();
  for (int k=0; k < gSet.getSize(); ++k) {
    DisplayGeometry gPiece=gSet.get(k);
    double[] colorOnFile=new double[3];
    gPiece.getColor(colorOnFile);
    gPiece.setColor(colorOnFile);
  }
}

Fixed version (ground truth):
void applyColorsFromModel(){
  VisibleObject bodyVisibleObject=body.getDisplayer();
  GeometrySet gSet=bodyVisibleObject.getGeometrySet();
  for (int k=0; k < gSet.getSize(); ++k) {
    DisplayGeometry gPiece=gSet.get(k);
    double[] colorOnFile=new double[3];
    gPiece.getColor(colorOnFile);
    gPiece.setColor(colorOnFile);
    DisplayGeometryDisplayer gd=(DisplayGeometryDisplayer)mapGeometryToVtkObjects.get(gPiece);
    gd.GetProperty().SetColor(colorOnFile);
    gd.Modified();
  }
}
Program: 147199
Project: 147199
Buggy source:
public void update(Observable observable,Object obj){
  if (observable instanceof OpenSimDB) {
    if (obj instanceof ModelEvent) {
      if (OpenSimDB.getInstance().hasModel(scaleToolModel.getUnscaledModel()))       return;
 else {
        scaleToolModel.deleteObserver(this);
        NotifyDescriptor.Message dlg=new NotifyDescriptor.Message("String_Node_Str");
        DialogDisplayer.getDefault().notify(dlg);
        this.close();
        return;
      }
    }
    return;
  }
  if (observable == scaleToolModel && obj == ScaleToolModel.Operation.ExecutionStateChanged) {
    updateDialogButtons();
  }
 else {
    updateFromModel();
  }
}

Fixed version (ground truth):
public void update(Observable observable,Object obj){
  if (observable instanceof OpenSimDB) {
    if (obj instanceof ModelEvent) {
      if (OpenSimDB.getInstance().hasModel(scaleToolModel.getOriginalModel()))       return;
 else {
        scaleToolModel.deleteObserver(this);
        NotifyDescriptor.Message dlg=new NotifyDescriptor.Message("String_Node_Str");
        DialogDisplayer.getDefault().notify(dlg);
        this.close();
        return;
      }
    }
    return;
  }
  if (observable == scaleToolModel && obj == ScaleToolModel.Operation.ExecutionStateChanged) {
    updateDialogButtons();
  }
 else {
    updateFromModel();
  }
}
Program: 147200
Project: 147200
Buggy source:
private void setTransformFromArray6(final double[] rotationsAndTranslations,final vtkTransform xform){
  xform.RotateX(Math.toDegrees(rotationsAndTranslations[0]));
  xform.RotateY(Math.toDegrees(rotationsAndTranslations[1]));
  xform.RotateZ(Math.toDegrees(rotationsAndTranslations[2]));
  xform.Translate(rotationsAndTranslations[3],rotationsAndTranslations[4],rotationsAndTranslations[5]);
}

Fixed version (ground truth):
static public void setTransformFromArray6(final double[] rotationsAndTranslations,final vtkTransform xform){
  xform.RotateX(Math.toDegrees(rotationsAndTranslations[0]));
  xform.RotateY(Math.toDegrees(rotationsAndTranslations[1]));
  xform.RotateZ(Math.toDegrees(rotationsAndTranslations[2]));
  xform.PostMultiply();
  xform.Translate(rotationsAndTranslations[3],rotationsAndTranslations[4],rotationsAndTranslations[5]);
}
Program: 147202
Project: 147202
Buggy source:
public void setOrientation(Vec3 loc){
  double[] rotationsAndTranslations=new double[6];
  displayGeometry.getRotationsAndTranslationsAsArray6(rotationsAndTranslations);
  for (int i=0; i < 3; i++)   rotationsAndTranslations[i]=Math.toRadians(loc.get(i));
  displayGeometry.setRotationsAndTRanslations(rotationsAndTranslations);
  vtkTransform xform=new vtkTransform();
  setTransformFromArray6(rotationsAndTranslations,xform);
  SetUserTransform(xform);
  Modified();
  ViewDB.getInstance().renderAll();
}

Fixed version (ground truth):
public void setOrientation(Vec3 loc){
  double[] rotationsAndTranslations=new double[6];
  displayGeometry.getRotationsAndTranslationsAsArray6(rotationsAndTranslations);
  for (int i=0; i < 3; i++)   rotationsAndTranslations[i]=Math.toRadians(loc.get(i));
  displayGeometry.setRotationsAndTRanslations(rotationsAndTranslations);
  vtkTransform xform=new vtkTransform();
  BodyDisplayer.setTransformFromArray6(rotationsAndTranslations,xform);
  SetUserTransform(xform);
  Modified();
  ViewDB.getInstance().renderAll();
}
Program: 147203
Project: 147203
Buggy source:
public void setLocationGUI(final Vec3 loc,boolean allowUndo){
  double[] rotationsAndTranslations=new double[6];
  displayGeometry.getRotationsAndTranslationsAsArray6(rotationsAndTranslations);
  final Vec3 oldLoc=new Vec3(rotationsAndTranslations[3],rotationsAndTranslations[4],rotationsAndTranslations[5]);
  for (int i=0; i < 3; i++)   rotationsAndTranslations[i + 3]=loc.get(i);
  displayGeometry.setRotationsAndTRanslations(rotationsAndTranslations);
  vtkTransform xform=new vtkTransform();
  setTransformFromArray6(rotationsAndTranslations,xform);
  SetUserTransform(xform);
  Modified();
  if (allowUndo) {
    AbstractUndoableEdit auEdit=new AbstractUndoableEdit(){
      public boolean canUndo(){
        return true;
      }
      public boolean canRedo(){
        return true;
      }
      public void undo() throws CannotUndoException {
        super.undo();
        setLocationGUI(oldLoc,false);
      }
      public void redo() throws CannotRedoException {
        super.redo();
        setLocationGUI(loc,false);
      }
      public String getPresentationName(){
        return "String_Node_Str";
      }
    }
;
    ExplorerTopComponent.addUndoableEdit(auEdit);
  }
  ViewDB.getInstance().renderAll();
}

Fixed version (ground truth):
public void setLocationGUI(final Vec3 loc,boolean allowUndo){
  double[] rotationsAndTranslations=new double[6];
  displayGeometry.getRotationsAndTranslationsAsArray6(rotationsAndTranslations);
  final Vec3 oldLoc=new Vec3(rotationsAndTranslations[3],rotationsAndTranslations[4],rotationsAndTranslations[5]);
  for (int i=0; i < 3; i++)   rotationsAndTranslations[i + 3]=loc.get(i);
  displayGeometry.setRotationsAndTRanslations(rotationsAndTranslations);
  vtkTransform xform=new vtkTransform();
  BodyDisplayer.setTransformFromArray6(rotationsAndTranslations,xform);
  SetUserTransform(xform);
  Modified();
  if (allowUndo) {
    AbstractUndoableEdit auEdit=new AbstractUndoableEdit(){
      public boolean canUndo(){
        return true;
      }
      public boolean canRedo(){
        return true;
      }
      public void undo() throws CannotUndoException {
        super.undo();
        setLocationGUI(oldLoc,false);
      }
      public void redo() throws CannotRedoException {
        super.redo();
        setLocationGUI(loc,false);
      }
      public String getPresentationName(){
        return "String_Node_Str";
      }
    }
;
    ExplorerTopComponent.addUndoableEdit(auEdit);
  }
  ViewDB.getInstance().renderAll();
}
Program: 147204
Project: 147204
Buggy source:
public int getData(int aTimeIndex,int aN,SWIGTYPE_p_p_double rData){
  return opensimModelJNI.Storage_getData__SWIG_3(swigCPtr,this,aTimeIndex,aN,SWIGTYPE_p_p_double.getCPtr(rData));
}

Fixed version (ground truth):
public int getData(int aTimeIndex,int aStateIndex,int aN,SWIGTYPE_p_p_double rData){
  return opensimModelJNI.Storage_getData__SWIG_1(swigCPtr,this,aTimeIndex,aStateIndex,aN,SWIGTYPE_p_p_double.getCPtr(rData));
}
Program: 147205
Project: 147205
Buggy source:
private void onGoingFinished(){
  mOnGoingRequest.mResultListener.onRequestFinished();
  startNextRequestIfNecessary();
}

Fixed version (ground truth):
private void onGoingFinished(){
  mOnGoingRequest.mResultListener.onRequestFinished();
  startNextRequestIfAny();
}
Program: 147206
Project: 147206
Buggy source:
/** 
 * method for clients 
 */
public void makeRequest(TestRequest request){
  request.timestamp=stamp++;
  mQueue.add(request);
  if (!cancelOnGoingIfNecessary()) {
    startNextRequestIfNecessary();
  }
}

Fixed version (ground truth):
/** 
 * method for clients 
 */
public void makeRequest(TestRequest request){
  request.timestamp=stamp++;
  mQueue.add(request);
  if (!cancelOnGoingIfNecessary()) {
    startNextRequestIfNoneOnGoing();
  }
}
Program: 147207
Project: 147207
Buggy source:
private void onGoingCancelled(){
  mQueue.add(mOnGoingRequest);
  startNextRequestIfNecessary();
}

Fixed version (ground truth):
private void onGoingCancelled(){
  mQueue.add(mOnGoingRequest);
  startNextRequestIfAny();
}
Program: 147208
Project: 147208
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == SCAN_QR) {
    if (resultCode == RESULT_OK) {
      Bundle res=data.getExtras();
      String qrtype=res.getString("String_Node_Str");
      String qrdata=res.getString("String_Node_Str");
      Log.w(TAG,qrtype);
      Log.w(TAG,qrdata);
      if (qrtype.equals("String_Node_Str")) {
        Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(qrdata));
        startActivity(browserIntent);
        finish();
      }
 else {
        createCards(qrdata);
        mCardScrollView=new CardScrollView(this);
        mAdapter=new MyCardScrollAdapter();
        mCardScrollView.setAdapter(mAdapter);
        mCardScrollView.activate();
        mCardScrollView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
          @Override public void onItemClick(          AdapterView<?> adapterView,          View view,          int i,          long l){
            if (mNeedsReadMore) {
              openOptionsMenu();
            }
 else {
              AudioManager audio=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
              audio.playSoundEffect(Sounds.DISALLOWED);
            }
          }
        }
);
        setContentView(mCardScrollView);
      }
    }
 else {
      finish();
    }
  }
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (requestCode == SCAN_QR) {
    if (resultCode == RESULT_OK) {
      Bundle res=data.getExtras();
      String qrtype=res.getString("String_Node_Str");
      String qrdata=res.getString("String_Node_Str");
      Log.w(TAG,qrtype);
      Log.w(TAG,qrdata);
      if (qrtype.equals("String_Node_Str")) {
        Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(qrdata));
        startActivity(browserIntent);
        finish();
      }
 else {
        createCards(qrdata);
        mCardScrollView=new CardScrollView(this);
        mAdapter=new MyCardScrollAdapter();
        mCardScrollView.setAdapter(mAdapter);
        mCardScrollView.activate();
        mCardScrollView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
          @Override public void onItemClick(          AdapterView<?> adapterView,          View view,          int i,          long l){
            if (mNeedsReadMore) {
              openOptionsMenu();
            }
 else {
              AudioManager audio=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
              audio.playSoundEffect(Sounds.DISALLOWED);
            }
          }
        }
);
        setContentView(mCardScrollView);
        allowDestroy=true;
      }
    }
 else {
      finish();
    }
  }
}
Program: 147210
Project: 147210
Buggy source:
@Override public void addInformation(ItemStack stack,EntityPlayer player,List list,boolean debug){
  LoreKey key=ItemLorePage.getLore(stack);
  if (key != null) {
    Lore data=LoreLoader.INSTANCE.getLore(key);
    if (data == null) {
      LoreExpansion.logger.warn("String_Node_Str");
      stack.setTagCompound(new NBTTagCompound());
    }
    if (data != null) {
      list.add(String.format("String_Node_Str",key.page,data.title));
      if (key.dimension == Integer.MAX_VALUE) {
        list.add("String_Node_Str");
      }
 else {
        list.add("String_Node_Str" + DimensionManager.getProvider(data.dimension).getDimensionName());
      }
    }
  }
}

Fixed version (ground truth):
@Override public void addInformation(ItemStack stack,EntityPlayer player,List list,boolean debug){
  LoreKey key=ItemLorePage.getLore(stack);
  if (key != null) {
    Lore data=LoreLoader.INSTANCE.getLore(key);
    if (data == null) {
      LoreExpansion.logger.warn("String_Node_Str");
      stack.setTagCompound(new NBTTagCompound());
    }
    if (data != null) {
      list.add(String.format("String_Node_Str",key.page,data.title));
      if (key.dimension == Integer.MAX_VALUE) {
        list.add("String_Node_Str");
      }
 else {
        list.add("String_Node_Str" + LoreLoader.INSTANCE.getDimensionName(key.dimension));
      }
    }
  }
}
Program: 147211
Project: 147211
Buggy source:
private String getDimensionName(int dimension){
  try {
    if (dimensionNameCache.containsKey(dimension)) {
      return dimensionNameCache.get(dimension);
    }
 else {
      WorldProvider worldProvider=DimensionManager.createProviderFor(dimension);
      String name="String_Node_Str";
      if (worldProvider != null) {
        name=worldProvider.getDimensionName();
      }
      dimensionNameCache.put(dimension,name);
      return name;
    }
  }
 catch (  RuntimeException ex) {
    dimensionNameCache.put(dimension,"String_Node_Str");
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
public String getDimensionName(int dimension){
  try {
    if (dimensionNameCache.containsKey(dimension)) {
      return dimensionNameCache.get(dimension);
    }
 else {
      WorldProvider worldProvider=DimensionManager.createProviderFor(dimension);
      String name="String_Node_Str";
      if (worldProvider != null) {
        name=worldProvider.getDimensionName();
      }
      dimensionNameCache.put(dimension,name);
      return name;
    }
  }
 catch (  RuntimeException ex) {
    dimensionNameCache.put(dimension,"String_Node_Str");
    return "String_Node_Str";
  }
}
Program: 147212
Project: 147212
Buggy source:
@Override public void saveNBTData(NBTTagCompound compound){
  NBTTagList list=new NBTTagList();
  for (  LoreKey key : collectedLore) {
    NBTTagCompound tag=new NBTTagCompound();
    key.writeToNBT(tag);
    if (autoplayed.contains(tag)) {
      tag.setBoolean("String_Node_Str",true);
    }
    list.appendTag(tag);
  }
  compound.setTag("String_Node_Str",list);
}

Fixed version (ground truth):
@Override public void saveNBTData(NBTTagCompound compound){
  NBTTagList list=new NBTTagList();
  for (  LoreKey key : collectedLore) {
    NBTTagCompound tag=new NBTTagCompound();
    key.writeToNBT(tag);
    if (autoplayed.contains(key)) {
      tag.setBoolean("String_Node_Str",true);
    }
    list.appendTag(tag);
  }
  compound.setTag("String_Node_Str",list);
}
Program: 147213
Project: 147213
Buggy source:
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event){
  loreScrap=new ItemLoreScrap().setUnlocalizedName("String_Node_Str");
  GameRegistry.registerItem(loreScrap,"String_Node_Str");
  journal=new ItemJournal().setUnlocalizedName("String_Node_Str");
  GameRegistry.registerItem(journal,"String_Node_Str");
  loreFolder=new File(event.getModConfigurationDirectory(),CONFIG_FOLDER + "String_Node_Str" + LORE_FOLDER);
  audioFolder=new File(loreFolder,AUDIO_FOLDER);
  if (!loreFolder.exists()) {
    loreFolder.mkdirs();
  }
  if (!audioFolder.exists()) {
    audioFolder.mkdir();
  }
  for (  File file : loreFolder.listFiles()) {
    if (FileHelper.isJSONFile(file)) {
      try {
        LoreLoader.INSTANCE.loadLore(file);
      }
 catch (      Exception ex) {
        logger.warn(String.format("String_Node_Str",file.getName()));
        ex.printStackTrace();
      }
    }
  }
  File tagFile=new File(event.getModConfigurationDirectory(),CONFIG_FOLDER + "String_Node_Str");
  if (tagFile.exists()) {
    LoreLoader.INSTANCE.loadLoreTags(tagFile);
  }
 else {
    try {
      LoreLoader.INSTANCE.saveDefaultLoreTags(tagFile);
    }
 catch (    IOException ex) {
      LoreExpansion.logger.warn(String.format("String_Node_Str"));
    }
  }
  PacketHandler.init();
  FMLCommonHandler.instance().bus().register(new NetworkEventHandler());
  FMLCommonHandler.instance().bus().register(new PlayerTickHandler());
  proxy.preInit(event);
}

Fixed version (ground truth):
@Mod.EventHandler public void preInit(FMLPreInitializationEvent event){
  loreScrap=new ItemLoreScrap().setUnlocalizedName("String_Node_Str");
  GameRegistry.registerItem(loreScrap,"String_Node_Str");
  journal=new ItemJournal().setUnlocalizedName("String_Node_Str");
  GameRegistry.registerItem(journal,"String_Node_Str");
  configFolder=new File(event.getModConfigurationDirectory(),CONFIG_FOLDER);
  loreFolder=new File(configFolder,LORE_FOLDER);
  audioFolder=new File(loreFolder,AUDIO_FOLDER);
  if (!configFolder.exists()) {
    configFolder.mkdir();
  }
  if (!loreFolder.exists()) {
    loreFolder.mkdir();
  }
  if (!audioFolder.exists()) {
    audioFolder.mkdir();
  }
  LoreLoader.initialize();
  PacketHandler.init();
  FMLCommonHandler.instance().bus().register(new NetworkEventHandler());
  FMLCommonHandler.instance().bus().register(new PlayerTickHandler());
  proxy.preInit(event);
}
Program: 147215
Project: 147215
Buggy source:
@SubscribeEvent public void onClientTick(TickEvent.ClientTickEvent event){
  boolean shouldPreload=false;
  for (  LoreData data : LoreLoader.INSTANCE.getLore()) {
    if (data != null && data.shouldPreload()) {
      shouldPreload=true;
    }
  }
  if (shouldPreload) {
    LoreExpansion.logger.info("String_Node_Str");
    long startTime=System.nanoTime();
    for (    LoreData data : LoreLoader.INSTANCE.getLore()) {
      if (data != null) {
        data.preloadSounds();
      }
    }
    long endTime=System.nanoTime() - startTime;
    LoreExpansion.logger.info("String_Node_Str" + TimeUnit.SECONDS.convert(endTime,TimeUnit.NANOSECONDS) + "String_Node_Str");
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onClientTick(TickEvent.ClientTickEvent event){
  if (preload) {
    LoreExpansion.logger.info("String_Node_Str");
    long startTime=System.nanoTime();
    for (    LoreData data : LoreLoader.INSTANCE.getLore()) {
      if (data != null) {
        data.preloadSounds();
      }
    }
    long endTime=System.nanoTime() - startTime;
    LoreExpansion.logger.info("String_Node_Str" + TimeUnit.SECONDS.convert(endTime,TimeUnit.NANOSECONDS) + "String_Node_Str");
    preload=false;
  }
}
Program: 147216
Project: 147216
Buggy source:
@Override public void processCommand(ICommandSender sender,String[] args){
  if (args.length != 1) {
    throw new WrongUsageException(getCommandUsage(sender));
  }
  if (args[0].equalsIgnoreCase("String_Node_Str")) {
    LoreLoader.INSTANCE.clear();
    LoreLoader.initialize();
    sender.addChatMessage(new ChatComponentText("String_Node_Str"));
    sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void processCommand(ICommandSender sender,String[] args){
  if (args.length != 1) {
    throw new WrongUsageException(getCommandUsage(sender));
  }
  if (args[0].equalsIgnoreCase("String_Node_Str")) {
    sender.addChatMessage(new ChatComponentText("String_Node_Str"));
    LoreLoader.INSTANCE.clear();
    LoreLoader.initialize();
    sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "String_Node_Str"));
  }
}
Program: 147217
Project: 147217
Buggy source:
@Override protected InputStream getInputStreamByName(String name) throws IOException {
  return new BufferedInputStream(new FileInputStream(new File(this.resourcePackFile,this.name + "String_Node_Str")));
}

Fixed version (ground truth):
@Override protected InputStream getInputStreamByName(String name){
  try {
    return new BufferedInputStream(new FileInputStream(new File(this.resourcePackFile,this.name + "String_Node_Str")));
  }
 catch (  IOException ex) {
    ex.printStackTrace();
    return null;
  }
}
Program: 147218
Project: 147218
Buggy source:
@Override public InputStream getInputStream(ResourceLocation location) throws IOException {
  return getInputStreamByName(location.getResourcePath().replace("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Override public InputStream getInputStream(ResourceLocation location){
  return getInputStreamByName(location.getResourcePath().replace("String_Node_Str","String_Node_Str"));
}
Program: 147219
Project: 147219
Buggy source:
@Override public Command getCurrentCommand(){
  return program.getCommands().get(location);
}

Fixed version (ground truth):
@Override public Command getCurrentCommand(){
  if (location >= program.getCommands().size()) {
    return null;
  }
  return program.getCommands().get(location);
}
Program: 147220
Project: 147220
Buggy source:
@Override public void setOutput(Writer output){
  this.output=output;
}

Fixed version (ground truth):
@Override public void setOutput(Writer output){
  if (output instanceof PrintWriter) {
    this.output=(PrintWriter)output;
  }
 else {
    this.output=new PrintWriter(output,true);
  }
}
Program: 147221
Project: 147221
Buggy source:
@Override public Writer getOutput(){
  return output;
}

Fixed version (ground truth):
@Override public PrintWriter getOutput(){
  return output;
}
Program: 147222
Project: 147222
Buggy source:
Writer getOutput();

Fixed version (ground truth):
PrintWriter getOutput();
Program: 147223
Project: 147223
Buggy source:
public static void generateModel(KieBuilder kieBuilder){
  Collection<KnowledgePackage> pkgs=((MemoryKieModule)kieBuilder.getKieModule()).getKnowledgePackagesForKieBase("String_Node_Str");
  for (  KnowledgePackage pkg : pkgs) {
    for (    org.kie.api.definition.rule.Rule rule : pkg.getRules()) {
      RuleContext context=new RuleContext();
      GroupElement lhs=((RuleImpl)rule).getLhs();
      visit(context,lhs);
    }
  }
}

Fixed version (ground truth):
public static void generateModel(KieBuilder kieBuilder){
  Collection<KiePackage> pkgs=((MemoryKieModule)kieBuilder.getKieModule()).getKnowledgePackagesForKieBase("String_Node_Str");
  for (  KiePackage pkg : pkgs) {
    for (    org.kie.api.definition.rule.Rule rule : pkg.getRules()) {
      RuleContext context=new RuleContext();
      GroupElement lhs=((RuleImpl)rule).getLhs();
      visit(context,lhs);
    }
  }
}
Program: 147224
Project: 147224
Buggy source:
@EventHandler public void onGameJoin(GameJoinEvent event){
  Game<HostedFFAState> game=game(event);
  if (game == null) {
    return;
  }
  HostedFFAState state=game.getState();
  Player p=event.getPlayer();
  if (state.isStarted()) {
    game.getGameplay().sendGameMessage(p,"String_Node_Str" + getGameplay().getId() + "String_Node_Str");
    return;
  }
  if (state.hasPlayer(p)) {
    game.getGameplay().sendGameMessage(p,"String_Node_Str" + getGameplay().getId() + "String_Node_Str");
    return;
  }
  if (game.getGameMaster() instanceof Host && p.getUniqueId().equals(((Host)game.getGameMaster()).getHost())) {
    game.getGameplay().sendGameMessage(p,"String_Node_Str");
    return;
  }
  state.addPlayer(p);
  getGameplay().sendBanner(p,"String_Node_Str" + getGameplay().getId() + "String_Node_Str","String_Node_Str" + getGameplay().getId() + "String_Node_Str");
}

Fixed version (ground truth):
@EventHandler public void onGameJoin(GameJoinEvent event){
  Game<HostedFFAState> game=game(event);
  if (game == null) {
    return;
  }
  HostedFFAState state=game.getState();
  Player p=event.getPlayer();
  if (state.isStarted()) {
    game.getGameplay().sendGameMessage(p,"String_Node_Str" + getGameplay().getId() + "String_Node_Str");
    return;
  }
  if (state.hasPlayer(p)) {
    game.getGameplay().sendGameMessage(p,"String_Node_Str" + getGameplay().getId() + "String_Node_Str");
    return;
  }
  if (game.getGameMaster() instanceof Host && p.getUniqueId().equals(((Host)game.getGameMaster()).getUniqueId())) {
    game.getGameplay().sendGameMessage(p,"String_Node_Str");
    return;
  }
  state.addPlayer(p);
  getGameplay().sendBanner(p,"String_Node_Str" + getGameplay().getId() + "String_Node_Str","String_Node_Str" + getGameplay().getId() + "String_Node_Str");
}
Program: 147225
Project: 147225
Buggy source:
/** 
 * Returns the model if the add was successful
 * @param id
 * @param model
 * @return
 */
protected T add(T model){
  if (has(model.getId())) {
    return null;
  }
  map.put(model.getId(),model);
  return model;
}

Fixed version (ground truth):
/** 
 * Returns the model if the add was successful
 * @param id
 * @param model
 * @return
 */
protected void add(T model){
  map.put(model.getId(),model);
}
Program: 147226
Project: 147226
Buggy source:
public Arena create(Region r){
  Arena a=new Arena(r.getId(),r);
  return add(a);
}

Fixed version (ground truth):
public Arena create(Region r){
  Arena a=new Arena(r.getId(),r);
  if (has(r.getId())) {
    return null;
  }
  add(a);
  return a;
}
Program: 147227
Project: 147227
Buggy source:
@Override public Region findById(String id){
  Region r=super.findById(id);
  if (r == null) {
    String[] split=id.split("String_Node_Str");
    World world=Bukkit.getWorld(split[0]);
    if (world == null) {
      return null;
    }
    ProtectedRegion region=WorldGuardPlugin.inst().getRegionManager(world).getRegion(split[1]);
    if (region == null) {
      return null;
    }
    r=new Region(id,world,region);
    add(r);
  }
  return r;
}

Fixed version (ground truth):
@Override public Region findById(String id){
  Region r=super.findById(id);
  if (r == null) {
    String[] split=id.split("String_Node_Str");
    World world=Bukkit.getWorld(split[0]);
    if (world == null) {
      return null;
    }
    ProtectedRegion region=WorldGuardPlugin.inst().getRegionManager(world).getRegion(split[1]);
    if (region == null) {
      return null;
    }
    r=create(world,region);
  }
  return r;
}
Program: 147228
Project: 147228
Buggy source:
public Region create(World world,ProtectedRegion pr){
  return add(new Region(id(world,pr),world,pr));
}

Fixed version (ground truth):
public Region create(World world,ProtectedRegion pr){
  Region r=new Region(id(world,pr),world,pr);
  add(r);
  return r;
}
Program: 147229
Project: 147229
Buggy source:
public String toString(){
  int pos=parser.getPos();
  String src=parser.getSource();
  int show=Math.min(src.length() - pos,10);
  return this.getMessage() + "String_Node_Str" + src.substring(pos,pos + show)+ "String_Node_Str";
}

Fixed version (ground truth):
public String toString(){
  int line=parser.getLine();
  String src=parser.getSource();
  String[] lines=src.split("String_Node_Str");
  StringBuilder buf=new StringBuilder();
  buf.append(this.getMessage() + "String_Node_Str" + parser.getFileName()+ "String_Node_Str"+ line);
  buf.append("String_Node_Str");
  for (int i=Math.max(0,line - 3); i < Math.min(lines.length - 1,line + 3); ++i) {
    buf.append(lines[i] + "String_Node_Str");
  }
  buf.append("String_Node_Str");
  return buf.toString();
}
Program: 147230
Project: 147230
Buggy source:
public int getPos(){
  return this.pos;
}

Fixed version (ground truth):
int getPos(){
  return this.pos;
}
Program: 147232
Project: 147232
Buggy source:
public Node parseEqualityExpr() throws ParserError {
  Node n=parseComparationExpr();
  if (n != null) {
    while (true) {
      if (EAT(TokenType.EQAULS)) {
        Node rhs=parseComparationExpr();
        if (rhs == null) {
          throw new ParserError("String_Node_Str",this);
        }
        List<Node> children=new ArrayList<>();
        children.add(n);
        children.add(rhs);
        n=new Node(NodeType.EQAULS,children);
      }
 else       if (EAT(TokenType.NE)) {
        Node rhs=parseComparationExpr();
        if (rhs == null) {
          throw new ParserError("String_Node_Str",this);
        }
        n=new Node(NodeType.NE,n,rhs);
      }
      break;
    }
  }
  return n;
}

Fixed version (ground truth):
public Node parseEqualityExpr() throws ParserError {
  Node n=parseComparationExpr();
  if (n != null) {
    while (true) {
      if (EAT(TokenType.EQUALS)) {
        Node rhs=parseComparationExpr();
        if (rhs == null) {
          throw new ParserError("String_Node_Str",this);
        }
        List<Node> children=new ArrayList<>();
        children.add(n);
        children.add(rhs);
        n=new Node(NodeType.EQUALS,children);
      }
 else       if (EAT(TokenType.NE)) {
        Node rhs=parseComparationExpr();
        if (rhs == null) {
          throw new ParserError("String_Node_Str",this);
        }
        n=new Node(NodeType.NE,n,rhs);
      }
      break;
    }
  }
  return n;
}