nus-yam/ex-repair huggingface dataset:
Program: 98315
Project: 98315
Buggy source:
/** 
 * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given coordinates.  Args: blockAccess, x, y, z, side
 */
@SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess,int par2,int par3,int par4,int par5){
  return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess,par2,par3,par4,par5);
}

Fixed version (ground truth):
/** 
 * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given coordinates.  Args: blockAccess, x, y, z, side
 */
@SideOnly(Side.CLIENT) @Override public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess,int par2,int par3,int par4,int par5){
  return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess,par2,par3,par4,par5);
}
Program: 98316
Project: 98316
Buggy source:
public DebugFileWriter(){
  if (Side.CLIENT == FMLCommonHandler.instance().getEffectiveSide()) {
    file=new File(Minecraft.getMinecraftDir(),"String_Node_Str");
  }
 else   if (Side.SERVER == FMLCommonHandler.instance().getEffectiveSide()) {
    file=new File(MinecraftServer.getServer().getFolderName(),"String_Node_Str");
  }
  if (!file.exists()) {
    try {
      file.createNewFile();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public DebugFileWriter(){
  if (ModChocoCraft.isRemoteClient) {
    file=new File(MinecraftServer.getServer().getFolderName(),"String_Node_Str");
  }
 else {
    file=new File(Minecraft.getMinecraftDir(),"String_Node_Str");
  }
  if (!file.exists()) {
    try {
      file.createNewFile();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 98317
Project: 98317
Buggy source:
@Override public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer,int slot){
  ItemStack stack=null;
  Slot slotObject=(Slot)this.inventorySlots.get(slot);
  if (slotObject != null && slotObject.getHasStack()) {
    ItemStack stackInSlot=slotObject.getStack();
    stack=stackInSlot.copy();
    if (slot == 0) {
      if (!this.mergeItemStack(stackInSlot,1,this.inventorySlots.size(),true)) {
        return null;
      }
    }
 else     if (!this.mergeItemStack(stackInSlot,0,1,false)) {
      return null;
    }
    if (stackInSlot.stackSize == 0) {
      slotObject.putStack(null);
    }
 else {
      slotObject.onSlotChanged();
    }
  }
  return stack;
}

Fixed version (ground truth):
@Override public ItemStack transferStackInSlot(EntityPlayer player,int slot){
  ItemStack iStackTarget=null;
  Slot slotObj=(Slot)this.inventorySlots.get(slot);
  if (slotObj != null && slotObj.getHasStack()) {
    ItemStack iStackSource=slotObj.getStack();
    iStackTarget=iStackSource.copy();
    int nSlots=this.chocoBagInv.getSizeInventory();
    if (slot < nSlots) {
      if (!this.mergeItemStack(iStackSource,nSlots,this.inventorySlots.size(),true)) {
        return null;
      }
    }
 else     if (!this.mergeItemStack(iStackSource,0,nSlots,false)) {
      return null;
    }
    if (iStackSource.stackSize == 0) {
      slotObj.putStack((ItemStack)null);
    }
 else {
      slotObj.onSlotChanged();
    }
  }
  return iStackTarget;
}
Program: 98318
Project: 98318
Buggy source:
@ForgeSubscribe public void onUseBonemeal(BonemealEvent event){
  if (event.ID == ModChocoCraft.gysahlStemBlock.blockID) {
    ((BlockGysahlStem)ModChocoCraft.gysahlStemBlock).onBonemealUse(event.world,event.X,event.Y,event.Z);
    this.useItem(event.entityPlayer);
  }
}

Fixed version (ground truth):
@ForgeSubscribe public void onUseBonemeal(BonemealEvent event){
  if (event.ID == ModChocoCraft.gysahlStemBlock.blockID) {
    if (((BlockGysahlStem)ModChocoCraft.gysahlStemBlock).onBonemealUse(event.world,event.X,event.Y,event.Z)) {
      ChocoboPlayerHelper.useCurrentItem(event.entityPlayer);
    }
  }
}
Program: 98319
Project: 98319
Buggy source:
public void onBonemealUse(World theWorld,int xPos,int yPos,int zPos){
  theWorld.setBlockMetadataWithNotify(xPos,yPos,zPos,MAX_STAGE);
}

Fixed version (ground truth):
public boolean onBonemealUse(World theWorld,int xPos,int yPos,int zPos){
  if (theWorld.getBlockMetadata(xPos,yPos,zPos) < MAX_STAGE) {
    theWorld.setBlockMetadataWithNotify(xPos,yPos,zPos,MAX_STAGE);
    return true;
  }
 else {
    return false;
  }
}
Program: 98321
Project: 98321
Buggy source:
public boolean attackEntityFrom(DamageSource damageSource,int tmpNaturalArmorRating){
  this.fleeingTick=60;
  this.entityToAttack=null;
  this.setInLove(false);
  if (this.isTamed()) {
    if (damageSource.getEntity() instanceof EntityWolf) {
      EntityWolf attackingWolf=(EntityWolf)damageSource.getEntity();
      if (attackingWolf.isTamed()) {
        attackingWolf.getOwner().setLastAttackingEntity(attackingWolf);
        attackingWolf.setAttackTarget(null);
        return false;
      }
    }
    if (damageSource.getEntity() instanceof EntityPlayer) {
      EntityPlayer entityPlayer=(EntityPlayer)damageSource.getEntity();
      if (null != entityPlayer) {
        if (null != this.getOwner() && this.getOwner().equals(entityPlayer)) {
          if (entityPlayer.isSneaking()) {
            return false;
          }
        }
        if (null != this.riddenByEntity && this.riddenByEntity.equals(entityPlayer)) {
          return false;
        }
      }
    }
  }
  boolean check=super.attackEntityFrom(damageSource,tmpNaturalArmorRating);
  if (Side.SERVER == FMLCommonHandler.instance().getEffectiveSide()) {
    this.sendHealthUpdate();
  }
  return check;
}

Fixed version (ground truth):
public boolean attackEntityFrom(DamageSource damageSource,int tmpNaturalArmorRating){
  this.fleeingTick=60;
  this.entityToAttack=null;
  this.setInLove(false);
  if (this.isTamed()) {
    if (damageSource.getEntity() instanceof EntityPlayer) {
      EntityPlayer entityPlayer=(EntityPlayer)damageSource.getEntity();
      if (null != entityPlayer) {
        if (null != this.getOwner() && this.getOwner().equals(entityPlayer)) {
          if (entityPlayer.isSneaking()) {
            return false;
          }
        }
        if (null != this.riddenByEntity && this.riddenByEntity.equals(entityPlayer)) {
          return false;
        }
      }
    }
  }
  boolean check=super.attackEntityFrom(damageSource,tmpNaturalArmorRating);
  if (Side.SERVER == FMLCommonHandler.instance().getEffectiveSide()) {
    this.sendHealthUpdate();
  }
  return check;
}
Program: 98322
Project: 98322
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mUtils=new Utils(getApplicationContext());
  setContentView(R.layout.webactivity);
  RootTools.useRoot=false;
  try {
    RootTools.getShell(RootTools.useRoot);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (RootTools.isProcessRunning("String_Node_Str")) {
    RootTools.killProcess("String_Node_Str");
  }
  Bundle b=getIntent().getExtras();
  String file_to_open=b.getString("String_Node_Str");
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
  boolean http_public=prefs.getBoolean("String_Node_Str",false);
  String http_eval="String_Node_Str";
  if (http_public) {
    http_eval="String_Node_Str";
    String localip=getLocalIpAddress();
    if (localip != null) {
      mUtils.myToast("String_Node_Str" + localip + "String_Node_Str",Toast.LENGTH_LONG);
    }
  }
  String output=mUtils.exec("String_Node_Str" + http_eval + "String_Node_Str"+ file_to_open+ "String_Node_Str");
  try {
    Thread.sleep(1000);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (RootTools.isProcessRunning("String_Node_Str")) {
    webview=(WebView)findViewById(R.id.webview);
    webview.setWebViewClient(new RadareWebViewClient());
    webview.getSettings().setJavaScriptEnabled(true);
    webview.loadUrl("String_Node_Str");
  }
 else {
    mUtils.myToast("String_Node_Str" + file_to_open,Toast.LENGTH_SHORT);
    finish();
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mUtils=new Utils(getApplicationContext());
  setContentView(R.layout.webactivity);
  RootTools.useRoot=false;
  try {
    RootTools.getShell(RootTools.useRoot);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (RootTools.isProcessRunning("String_Node_Str")) {
    RootTools.killProcess("String_Node_Str");
  }
  Bundle b=getIntent().getExtras();
  String file_to_open=b.getString("String_Node_Str");
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
  boolean http_public=prefs.getBoolean("String_Node_Str",false);
  String http_eval="String_Node_Str";
  if (http_public) {
    http_eval="String_Node_Str";
    String localip=getLocalIpAddress();
    if (localip != null) {
      mUtils.myToast("String_Node_Str" + localip + "String_Node_Str",Toast.LENGTH_LONG);
    }
  }
  mUtils.exec("String_Node_Str" + http_eval + "String_Node_Str"+ file_to_open);
  if (RootTools.isProcessRunning("String_Node_Str")) {
    webview=(WebView)findViewById(R.id.webview);
    webview.setWebViewClient(new RadareWebViewClient());
    webview.getSettings().setJavaScriptEnabled(true);
    webview.loadUrl("String_Node_Str");
  }
 else {
    mUtils.myToast("String_Node_Str" + file_to_open,Toast.LENGTH_SHORT);
    finish();
  }
}
Program: 98327
Project: 98327
Buggy source:
private void checkMakeLayoutMessages(){
  if (mkExplicitMessages[1].length > 0 && LOGGING) {
    System.out.println(mkExplicitMessages[1][0]);
  }
  if (mkImplicitMessages[1].length > 0 && LOGGING) {
    System.out.println(mkExplicitMessages[1][0]);
  }
}

Fixed version (ground truth):
private void checkMakeLayoutMessages(){
  if (mkExplicitMessages[1].length > 0 && LOGGING) {
    System.out.println(mkExplicitMessages[1][0]);
  }
  if (mkImplicitMessages[1].length > 0 && LOGGING) {
    System.out.println(mkImplicitMessages[1][0]);
  }
}
Program: 98328
Project: 98328
Buggy source:
public void testPackage(String pkg) throws IOException {
  File dir;
  try {
    dir=cabalUnpack(pkg);
  }
 catch (  ExecutionError e) {
    System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str");
    return;
  }
  testFiles(dir,pkg);
  logResult(pkg);
  addAllFailures(fileTester.getFailures());
  addOks(fileTester.getOkCount());
  addOkFails(fileTester.getOkFailCount());
  addNoParses(fileTester.getNoParseCount());
  addAmbInfix(fileTester.getAmbInfixCount());
  addTimeout(fileTester.getTimeout());
  addComparisonFailures(fileTester.getComparisonFailures());
  fileTester.reset();
}

Fixed version (ground truth):
public void testPackage(String pkg) throws IOException {
  File dir;
  try {
    dir=cabalUnpack(pkg);
  }
 catch (  ExecutionError e) {
    String msg=e.getCause() == null ? "String_Node_Str" : e.getCause().getMessage();
    System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str"+ msg);
    return;
  }
  testFiles(dir,pkg);
  logResult(pkg);
  addAllFailures(fileTester.getFailures());
  addOks(fileTester.getOkCount());
  addOkFails(fileTester.getOkFailCount());
  addNoParses(fileTester.getNoParseCount());
  addAmbInfix(fileTester.getAmbInfixCount());
  addTimeout(fileTester.getTimeout());
  addComparisonFailures(fileTester.getComparisonFailures());
  fileTester.reset();
}
Program: 98329
Project: 98329
Buggy source:
private IStrategoTerm newParseSpeed(File f,String pkg){
  newResultSpeed=null;
  newExceptionSpeed=null;
  if (f == null)   return null;
  String input=FileTools.tryLoadFileAsString(f.getAbsolutePath());
  try {
    newResultSpeed=(IStrategoTerm)newParserSpeed.parse(input,f.getAbsolutePath());
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
catch (  ExecutionException e) {
    if (e.getCause() instanceof SGLRException)     newExceptionSpeed=(SGLRException)e.getCause();
 else     if (e.getCause() instanceof StackOverflowError) {
      newExceptionCorrectness=e.getCause();
      if (LOGGING)       System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str");
    }
 else     throw new RuntimeException(e);
  }
  if (LOGGING) {
    String time;
    if (newParserSpeed.timeParse >= 0)     time=newParserSpeed.timeParse + "String_Node_Str";
 else     time="String_Node_Str";
    System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str"+ time+ "String_Node_Str"+ (newResultSpeed != null ? "String_Node_Str" : "String_Node_Str"));
  }
  return newResultCorrectness;
}

Fixed version (ground truth):
private IStrategoTerm newParseSpeed(File f,String pkg){
  newResultSpeed=null;
  newExceptionSpeed=null;
  if (f == null)   return null;
  String input=FileTools.tryLoadFileAsString(f.getAbsolutePath());
  try {
    newResultSpeed=(IStrategoTerm)newParserSpeed.parse(input,f.getAbsolutePath());
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
catch (  ExecutionException e) {
    if (e.getCause() instanceof SGLRException)     newExceptionSpeed=(SGLRException)e.getCause();
 else     if (e.getCause() instanceof StackOverflowError) {
      newExceptionSpeed=e.getCause();
      if (LOGGING)       System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str");
    }
 else     throw new RuntimeException(e);
  }
  if (LOGGING) {
    String time;
    if (newParserSpeed.timeParse >= 0)     time=newParserSpeed.timeParse + "String_Node_Str";
 else     time="String_Node_Str";
    System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str"+ time+ "String_Node_Str"+ (newResultSpeed != null ? "String_Node_Str" : "String_Node_Str"));
  }
  return newResultCorrectness;
}
Program: 98330
Project: 98330
Buggy source:
private IStrategoTerm oldParse(File f,String pkg){
  oldResult=null;
  oldException=null;
  if (f == null)   return null;
  String input=FileTools.tryLoadFileAsString(f.getAbsolutePath());
  try {
    oldResult=(IStrategoTerm)oldParser.parse(input,f.getAbsolutePath());
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
catch (  ExecutionException e) {
    if (e.getCause() instanceof org.spoofax.jsglr_orig.shared.SGLRException)     oldException=(org.spoofax.jsglr_orig.shared.SGLRException)e.getCause();
 else     throw new RuntimeException(e);
  }
  if (LOGGING) {
    System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str"+ oldParser.timeParse+ "String_Node_Str"+ (oldResult != null ? "String_Node_Str" : "String_Node_Str"));
  }
  return oldResult;
}

Fixed version (ground truth):
private IStrategoTerm oldParse(File f,String pkg){
  oldResult=null;
  oldException=null;
  if (f == null)   return null;
  String input=FileTools.tryLoadFileAsString(f.getAbsolutePath());
  try {
    oldResult=(IStrategoTerm)oldParser.parse(input,f.getAbsolutePath());
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
catch (  ExecutionException e) {
    if (e.getCause() instanceof org.spoofax.jsglr_orig.shared.SGLRException)     oldException=(org.spoofax.jsglr_orig.shared.SGLRException)e.getCause();
 else     if (e.getCause() instanceof StackOverflowError) {
      oldException=e.getCause();
      if (LOGGING)       System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str");
    }
 else     throw new RuntimeException(e);
  }
  if (LOGGING) {
    System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str"+ oldParser.timeParse+ "String_Node_Str"+ (oldResult != null ? "String_Node_Str" : "String_Node_Str"));
  }
  return oldResult;
}
Program: 98331
Project: 98331
Buggy source:
public void testPackage(String pkg) throws IOException {
  File dir=cabalUnpack(pkg);
  testFiles(dir,pkg);
  logResult(pkg);
  addAllFailures(fileTester.getFailures());
  addOks(fileTester.getOkCount());
  addOkFails(fileTester.getOkFailCount());
  addNoParses(fileTester.getNoParseCount());
  addAmbInfix(fileTester.getAmbInfixCount());
  addTimeout(fileTester.getTimeout());
  addComparisonFailures(fileTester.getComparisonFailures());
  fileTester.reset();
}

Fixed version (ground truth):
public void testPackage(String pkg) throws IOException {
  File dir;
  try {
    dir=cabalUnpack(pkg);
  }
 catch (  ExecutionError e) {
    System.out.println("String_Node_Str" + pkg + "String_Node_Str"+ "String_Node_Str");
    return;
  }
  testFiles(dir,pkg);
  logResult(pkg);
  addAllFailures(fileTester.getFailures());
  addOks(fileTester.getOkCount());
  addOkFails(fileTester.getOkFailCount());
  addNoParses(fileTester.getNoParseCount());
  addAmbInfix(fileTester.getAmbInfixCount());
  addTimeout(fileTester.getTimeout());
  addComparisonFailures(fileTester.getComparisonFailures());
  fileTester.reset();
}
Program: 98332
Project: 98332
Buggy source:
protected ParseComparisonFailure logComparisonFailure(String file,IStrategoTerm expected,IStrategoTerm actual){
  ParseComparisonFailure f=new ParseComparisonFailure(file,expected,actual);
  failures.add(f);
  return f;
}

Fixed version (ground truth):
protected ParseComparisonFailure logComparisonFailure(String file,IStrategoTerm expected,IStrategoTerm actual){
  ParseComparisonFailure f=new ParseComparisonFailure(file,expected,actual);
  failures.add(f);
  comparisonFailures++;
  return f;
}
Program: 98333
Project: 98333
Buggy source:
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (Double.isNaN(maf[PREV - 1]) || Double.isNaN(mas[PREV - 1]))   return;
  if (maf[PREV - 1] < mas[PREV - 1] && maf[PREV] > mas[PREV] && tick.getBid() > mas[PREV]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(OrderCommand.BUY);
    }
  }
  if (maf[PREV - 1] > mas[PREV - 1] && maf[PREV] < mas[PREV] && tick.getBid() < mas[PREV]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(OrderCommand.SELL);
    }
  }
}

Fixed version (ground truth):
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (Double.isNaN(maf[PREV - 1]) || Double.isNaN(mas[PREV - 1]))   return;
  if (maf[PREV - 1] < mas[PREV - 1] && maf[PREV] > mas[PREV] && tick.getBid() > mas[PREV]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.BUY);
    }
  }
  if (maf[PREV - 1] > mas[PREV - 1] && maf[PREV] < mas[PREV] && tick.getBid() < mas[PREV]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.SELL);
    }
  }
}
Program: 98334
Project: 98334
Buggy source:
private IOrder submitOrder(OrderCommand orderCommand) throws JFException {
  double stopLossPrice=0.0, takeProfitPrice=0.0;
  double bidPrice=history.getLastTick(instrument).getBid();
  double askPrice=history.getLastTick(instrument).getAsk();
  String label=getLabel(instrument);
  String name=instrument.getPrimaryCurrency() + instrument.getPairsSeparator() + instrument.getSecondaryCurrency();
  if (orderCommand == OrderCommand.BUY) {
    if (stopLossPips > 0) {
      stopLossPrice=bidPrice - getPipPrice(stopLossPips);
    }
    if (takeProfitPips > 0) {
      takeProfitPrice=bidPrice + getPipPrice(takeProfitPips);
    }
    console.getOut().printf("String_Node_Str",label,name,bidPrice,stopLossPrice,takeProfitPrice);
  }
 else {
    if (stopLossPips > 0) {
      stopLossPrice=askPrice + getPipPrice(stopLossPips);
    }
    if (takeProfitPips > 0) {
      takeProfitPrice=askPrice - getPipPrice(takeProfitPips);
    }
    console.getOut().printf("String_Node_Str",label,name,bidPrice,stopLossPrice,takeProfitPrice);
  }
  return engine.submitOrder(label,instrument,orderCommand,volume,0,slippage,stopLossPrice,takeProfitPrice);
}

Fixed version (ground truth):
private IOrder submitOrder(Instrument instrument,OrderCommand orderCommand) throws JFException {
  double stopLossPrice=0.0, takeProfitPrice=0.0;
  double bidPrice=history.getLastTick(instrument).getBid();
  double askPrice=history.getLastTick(instrument).getAsk();
  String label=getLabel(instrument);
  String name=instrument.getPrimaryCurrency() + instrument.getPairsSeparator() + instrument.getSecondaryCurrency();
  if (orderCommand == OrderCommand.BUY) {
    if (stopLossPips > 0) {
      stopLossPrice=bidPrice - getPipPrice(instrument,stopLossPips);
    }
    if (takeProfitPips > 0) {
      takeProfitPrice=bidPrice + getPipPrice(instrument,takeProfitPips);
    }
    console.getOut().printf("String_Node_Str",label,name,bidPrice,stopLossPrice,takeProfitPrice);
  }
 else {
    if (stopLossPips > 0) {
      stopLossPrice=askPrice + getPipPrice(instrument,stopLossPips);
    }
    if (takeProfitPips > 0) {
      takeProfitPrice=askPrice - getPipPrice(instrument,takeProfitPips);
    }
    console.getOut().printf("String_Node_Str",label,name,bidPrice,stopLossPrice,takeProfitPrice);
  }
  return engine.submitOrder(label,instrument,orderCommand,volume,0,slippage,stopLossPrice,takeProfitPrice);
}
Program: 98335
Project: 98335
Buggy source:
@Override public void onBar(Instrument instrument,Period period,IBar askBar,IBar bidBar) throws JFException {
  if (instrument != this.instrument || period != this.period)   return;
  maf=indicators.ma(instrument,period,OfferSide.BID,appliedPriceFast,timePeriodFast,maTypeFast,indicatorFilter,PREV + 1,bidBar.getTime(),0);
  mas=indicators.ma(instrument,period,OfferSide.BID,appliedPriceSlow,timePeriodSlow,maTypeSlow,indicatorFilter,PREV + 1,bidBar.getTime(),0);
}

Fixed version (ground truth):
@Override public void onBar(Instrument instrument,Period period,IBar askBar,IBar bidBar) throws JFException {
  if (instrument != this.instrument || period != this.period)   return;
  IBar prevBar=history.getBar(instrument,period,OfferSide.BID,1);
  maf=indicators.ma(instrument,period,OfferSide.BID,appliedPriceFast,timePeriodFast,maTypeFast,indicatorFilter,numberOfCandlesBefore,prevBar.getTime(),numberOfCandlesAfter);
  mas=indicators.ma(instrument,period,OfferSide.BID,appliedPriceSlow,timePeriodSlow,maTypeSlow,indicatorFilter,numberOfCandlesBefore,prevBar.getTime(),numberOfCandlesAfter);
}
Program: 98336
Project: 98336
Buggy source:
protected double getPipPrice(double pips){
  return pips * instrument.getPipValue();
}

Fixed version (ground truth):
protected double getPipPrice(Instrument instrument,double pips){
  return instrument.getPipValue() * pips;
}
Program: 98337
Project: 98337
Buggy source:
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (bar[PREV - 1] == null || bar[PREV] == null)   return;
  if (priceToPips(dc[PREV - 1][HIGH] - dc[PREV - 1][LOW]) < thresholdPips) {
    return;
  }
  if (tick.getBid() > dc[PREV - 1][HIGH] && bar[PREV - 1].getClose() > dc[PREV - 1][HIGH] && bar[PREV].getClose() <= dc[PREV][HIGH]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(OrderCommand.BUY);
    }
  }
  if (tick.getBid() < dc[PREV - 1][LOW] && bar[PREV - 1].getClose() < dc[PREV - 1][LOW] && bar[PREV].getClose() >= dc[PREV][LOW]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(OrderCommand.SELL);
    }
  }
}

Fixed version (ground truth):
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (bar[PREV - 1] == null || bar[PREV] == null)   return;
  if (priceToPips(instrument,dc[PREV - 1][UPPER] - dc[PREV - 1][LOWER]) < thresholdPips) {
    return;
  }
  if (tick.getBid() > dc[PREV - 1][UPPER] && bar[PREV - 1].getClose() > dc[PREV - 1][UPPER] && bar[PREV].getClose() <= dc[PREV][UPPER]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.BUY);
    }
  }
  if (tick.getBid() < dc[PREV - 1][LOWER] && bar[PREV - 1].getClose() < dc[PREV - 1][LOWER] && bar[PREV].getClose() >= dc[PREV][LOWER]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.SELL);
    }
  }
}
Program: 98338
Project: 98338
Buggy source:
protected double getPipPrice(double pips){
  return pips * instrument.getPipValue();
}

Fixed version (ground truth):
protected double getPipPrice(Instrument instrument,double pips){
  return instrument.getPipValue() * pips;
}
Program: 98339
Project: 98339
Buggy source:
protected double priceToPips(double price){
  return price * Math.pow(10,instrument.getPipScale());
}

Fixed version (ground truth):
protected double priceToPips(Instrument instrument,double price){
  return price * Math.pow(10,instrument.getPipScale());
}
Program: 98340
Project: 98340
Buggy source:
private IOrder submitOrder(OrderCommand orderCommand) throws JFException {
  double stopLossPrice=0.0, takeProfitPrice=0.0;
  double bidPrice=history.getLastTick(instrument).getBid();
  double askPrice=history.getLastTick(instrument).getAsk();
  String label=getLabel(instrument);
  String name=instrument.getPrimaryCurrency() + instrument.getPairsSeparator() + instrument.getSecondaryCurrency();
  if (orderCommand == OrderCommand.BUY) {
    if (stopLossPips > 0) {
      stopLossPrice=bidPrice - getPipPrice(stopLossPips);
    }
    if (takeProfitPips > 0) {
      takeProfitPrice=bidPrice + getPipPrice(takeProfitPips);
    }
    console.getOut().printf("String_Node_Str",label,name,bidPrice,stopLossPrice,takeProfitPrice);
  }
 else {
    if (stopLossPips > 0) {
      stopLossPrice=askPrice + getPipPrice(stopLossPips);
    }
    if (takeProfitPips > 0) {
      takeProfitPrice=askPrice - getPipPrice(takeProfitPips);
    }
    console.getOut().printf("String_Node_Str",label,name,bidPrice,stopLossPrice,takeProfitPrice);
  }
  return engine.submitOrder(label,instrument,orderCommand,volume,0,slippage,stopLossPrice,takeProfitPrice);
}

Fixed version (ground truth):
private IOrder submitOrder(Instrument instrument,OrderCommand orderCommand) throws JFException {
  double stopLossPrice=0.0, takeProfitPrice=0.0;
  double bidPrice=history.getLastTick(instrument).getBid();
  double askPrice=history.getLastTick(instrument).getAsk();
  String label=getLabel(instrument);
  String name=instrument.getPrimaryCurrency() + instrument.getPairsSeparator() + instrument.getSecondaryCurrency();
  if (orderCommand == OrderCommand.BUY) {
    if (stopLossPips > 0) {
      stopLossPrice=bidPrice - getPipPrice(instrument,stopLossPips);
    }
    if (takeProfitPips > 0) {
      takeProfitPrice=bidPrice + getPipPrice(instrument,takeProfitPips);
    }
    console.getOut().printf("String_Node_Str",label,name,bidPrice,stopLossPrice,takeProfitPrice);
  }
 else {
    if (stopLossPips > 0) {
      stopLossPrice=askPrice + getPipPrice(instrument,stopLossPips);
    }
    if (takeProfitPips > 0) {
      takeProfitPrice=askPrice - getPipPrice(instrument,takeProfitPips);
    }
    console.getOut().printf("String_Node_Str",label,name,bidPrice,stopLossPrice,takeProfitPrice);
  }
  return engine.submitOrder(label,instrument,orderCommand,volume,0,slippage,stopLossPrice,takeProfitPrice);
}
Program: 98341
Project: 98341
Buggy source:
@Override public void onBar(Instrument instrument,Period period,IBar askBar,IBar bidBar) throws JFException {
  if (instrument != this.instrument || period != this.period)   return;
  dc=transpose(indicators.donchian(instrument,period,OfferSide.BID,dcTimePeriod,indicatorFilter,PREV + 1,bidBar.getTime(),0));
  bar[PREV]=history.getBar(instrument,period,OfferSide.BID,2);
  bar[PREV - 1]=history.getBar(instrument,period,OfferSide.BID,1);
  if (breakevenPips > 0 && isActive(order) && order.getProfitLossInPips() > breakevenPips) {
    if (order.isLong())     order.setStopLossPrice(dc[PREV - 1][LOW] + getPipPrice(breakevenPips),OfferSide.BID);
 else     order.setStopLossPrice(dc[PREV - 1][HIGH] - getPipPrice(breakevenPips),OfferSide.ASK);
  }
}

Fixed version (ground truth):
@Override public void onBar(Instrument instrument,Period period,IBar askBar,IBar bidBar) throws JFException {
  if (instrument != this.instrument || period != this.period)   return;
  bar[PREV]=history.getBar(instrument,period,OfferSide.BID,2);
  bar[PREV - 1]=history.getBar(instrument,period,OfferSide.BID,1);
  dc=transpose(indicators.donchian(instrument,period,OfferSide.BID,dcTimePeriod,indicatorFilter,numberOfCandlesBefore,bar[PREV - 1].getTime(),numberOfCandlesAfter));
  if (breakevenPips > 0 && isActive(order) && order.getProfitLossInPips() > breakevenPips) {
    if (order.isLong())     order.setStopLossPrice(dc[PREV - 1][LOWER] + getPipPrice(instrument,breakevenPips),OfferSide.BID);
 else     order.setStopLossPrice(dc[PREV - 1][UPPER] - getPipPrice(instrument,breakevenPips),OfferSide.ASK);
  }
}
Program: 98342
Project: 98342
Buggy source:
protected double priceToPips(double price){
  return price * Math.pow(10,instrument.getPipScale());
}

Fixed version (ground truth):
protected double priceToPips(Instrument instrument,double price){
  return price * Math.pow(10,instrument.getPipScale());
}
Program: 98344
Project: 98344
Buggy source:
protected double getPipPrice(double pips) throws JFException {
  double pipPrice=pips * instrument.getPipValue();
  return pipPrice - pipPrice % Math.pow(10,instrument.getPipScale() * -1);
}

Fixed version (ground truth):
protected double getPipPrice(Instrument instrument,double pips) throws JFException {
  double pipPrice=pips * instrument.getPipValue();
  return pipPrice - pipPrice % Math.pow(10,instrument.getPipScale() * -1);
}
Program: 98345
Project: 98345
Buggy source:
protected String getLabel(Instrument instrument){
  return id + String.format("String_Node_Str",++counter).replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
protected String getLabel(Instrument instrument){
  return id + instrument.name().substring(0,2) + instrument.name().substring(3,5)+ String.format("String_Node_Str",++counter).replace("String_Node_Str","String_Node_Str");
}
Program: 98346
Project: 98346
Buggy source:
protected double roundPrice(double price){
  return price - price % Math.pow(10,(instrument.getPipScale() + 1) * -1);
}

Fixed version (ground truth):
protected double roundPrice(double price){
  return price - price % Math.pow(10,(this.instrument.getPipScale() + 1) * -1);
}
Program: 98347
Project: 98347
Buggy source:
protected String getLabel(Instrument instrument){
  return id + String.format("String_Node_Str",++counter).replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
protected String getLabel(Instrument instrument){
  return id + instrument.name().substring(0,2) + instrument.name().substring(3,5)+ String.format("String_Node_Str",++counter).replace("String_Node_Str","String_Node_Str");
}
Program: 98348
Project: 98348
Buggy source:
protected double roundPrice(double price){
  return price - price % Math.pow(10,(instrument.getPipScale() + 1) * -1);
}

Fixed version (ground truth):
protected double roundPrice(double price){
  return price - price % Math.pow(10,(this.instrument.getPipScale() + 1) * -1);
}
Program: 98349
Project: 98349
Buggy source:
protected String getLabel(Instrument instrument){
  return id + String.format("String_Node_Str",++counter).replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
protected String getLabel(Instrument instrument){
  return id + instrument.name().substring(0,2) + instrument.name().substring(3,5)+ String.format("String_Node_Str",++counter).replace("String_Node_Str","String_Node_Str");
}
Program: 98350
Project: 98350
Buggy source:
protected double roundPrice(double price){
  return price - price % Math.pow(10,(instrument.getPipScale() + 1) * -1);
}

Fixed version (ground truth):
protected double roundPrice(double price){
  return price - price % Math.pow(10,(this.instrument.getPipScale() + 1) * -1);
}
Program: 98351
Project: 98351
Buggy source:
protected String getLabel(Instrument instrument){
  return id + String.format("String_Node_Str",++counter).replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
protected String getLabel(Instrument instrument){
  return id + instrument.name().substring(0,2) + instrument.name().substring(3,5)+ String.format("String_Node_Str",++counter).replace("String_Node_Str","String_Node_Str");
}
Program: 98352
Project: 98352
Buggy source:
protected double roundPrice(double price){
  return price - price % Math.pow(10,(instrument.getPipScale() + 1) * -1);
}

Fixed version (ground truth):
protected double roundPrice(double price){
  return price - price % Math.pow(10,(this.instrument.getPipScale() + 1) * -1);
}
Program: 98353
Project: 98353
Buggy source:
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (Double.isNaN(maf[PREV - 1]) || Double.isNaN(mas[PREV - 1]))   return;
  if (maf[PREV - 1] < mas[PREV - 1] && maf[PREV] > mas[PREV] && tick.getBid() > mas[PREV]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.BUY);
    }
  }
  if (maf[PREV - 1] > mas[PREV - 1] && maf[PREV] < mas[PREV] && tick.getBid() < mas[PREV]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.SELL);
    }
  }
}

Fixed version (ground truth):
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (Double.isNaN(maf[PREV - 1]) || Double.isNaN(mas[PREV - 1]))   return;
  if (maf[PREV - 1] < mas[PREV - 1] && maf[PREV] > mas[PREV] && tick.getBid() > mas[PREV]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.BUY);
    }
  }
  if (maf[PREV - 1] > mas[PREV - 1] && maf[PREV] < mas[PREV] && tick.getBid() < mas[PREV]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.SELL);
    }
  }
  if (prevOrder != null) {
switch (prevOrder.getState()) {
case CREATED:
case CLOSED:
      this.prevOrder=null;
    break;
default :
  console.getOut().println(prevOrder.getLabel() + "String_Node_Str");
}
}
}
Program: 98354
Project: 98354
Buggy source:
protected void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200);
switch (order.getState()) {
case CREATED:
case CLOSED:
      this.order=null;
    break;
default :
  console.getOut().println(order.getLabel() + "String_Node_Str");
}
}
}

Fixed version (ground truth):
protected void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200);
    prevOrder=order;
  }
}
Program: 98355
Project: 98355
Buggy source:
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (bar[PREV - 1] == null || bar[PREV] == null)   return;
  if (priceToPips(instrument,dc[UPPER][PREV - 1] - dc[LOWER][PREV - 1]) < thresholdPips) {
    return;
  }
  if (tick.getBid() > dc[UPPER][PREV - 1] && bar[PREV - 1].getClose() > dc[UPPER][PREV - 1] && bar[PREV].getClose() <= dc[UPPER][PREV]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.BUY);
    }
  }
  if (tick.getBid() < dc[LOWER][PREV - 1] && bar[PREV - 1].getClose() < dc[LOWER][PREV - 1] && bar[PREV].getClose() >= dc[LOWER][PREV]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.SELL);
    }
  }
}

Fixed version (ground truth):
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (bar[PREV - 1] == null || bar[PREV] == null)   return;
  if (priceToPips(instrument,dc[UPPER][PREV - 1] - dc[LOWER][PREV - 1]) < thresholdPips) {
    return;
  }
  if (tick.getBid() > dc[UPPER][PREV - 1] && bar[PREV - 1].getClose() > dc[UPPER][PREV - 1] && bar[PREV].getClose() <= dc[UPPER][PREV]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.BUY);
    }
  }
  if (tick.getBid() < dc[LOWER][PREV - 1] && bar[PREV - 1].getClose() < dc[LOWER][PREV - 1] && bar[PREV].getClose() >= dc[LOWER][PREV]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.SELL);
    }
  }
  if (prevOrder != null) {
switch (prevOrder.getState()) {
case CREATED:
case CLOSED:
      this.prevOrder=null;
    break;
default :
  console.getOut().println(prevOrder.getLabel() + "String_Node_Str");
}
}
}
Program: 98356
Project: 98356
Buggy source:
protected void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200);
switch (order.getState()) {
case CREATED:
case CLOSED:
      this.order=null;
    break;
default :
  console.getOut().println(order.getLabel() + "String_Node_Str");
}
}
}

Fixed version (ground truth):
protected void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200);
    prevOrder=order;
  }
}
Program: 98357
Project: 98357
Buggy source:
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
}

Fixed version (ground truth):
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (prevOrder != null) {
switch (prevOrder.getState()) {
case CREATED:
case CLOSED:
      this.prevOrder=null;
    break;
default :
  console.getOut().println(prevOrder.getLabel() + "String_Node_Str");
}
}
}
Program: 98358
Project: 98358
Buggy source:
protected void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200);
switch (order.getState()) {
case CREATED:
case CLOSED:
      this.order=null;
    break;
default :
  console.getOut().println(order.getLabel() + "String_Node_Str");
}
}
}

Fixed version (ground truth):
protected void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200);
    prevOrder=order;
  }
}
Program: 98359
Project: 98359
Buggy source:
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (bidBar1 == null || askBar1 == null)   return;
  if (priceToPips(instrument,askFL[0] - bidFL[0]) < thresholdPips) {
    return;
  }
  if (askBar1.getHigh() <= askFL[1] && tick.getAsk() > askFL[0]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.BUY);
    }
  }
  if (bidBar1.getLow() >= bidFL[1] && tick.getBid() < bidFL[0]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.SELL);
    }
  }
}

Fixed version (ground truth):
@Override public void onTick(Instrument instrument,ITick tick) throws JFException {
  if (instrument != this.instrument)   return;
  if (bidBar1 == null || askBar1 == null)   return;
  if (priceToPips(instrument,askFL[0] - bidFL[0]) < thresholdPips) {
    return;
  }
  if (askBar1.getHigh() <= askFL[1] && tick.getAsk() > askFL[0]) {
    if (order == null || !order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.BUY);
    }
  }
  if (bidBar1.getLow() >= bidFL[1] && tick.getBid() < bidFL[0]) {
    if (order == null || order.isLong()) {
      closeOrder(order);
      order=submitOrder(instrument,OrderCommand.SELL);
    }
  }
  if (prevOrder != null) {
switch (prevOrder.getState()) {
case CREATED:
case CLOSED:
      this.prevOrder=null;
    break;
default :
  console.getOut().println(prevOrder.getLabel() + "String_Node_Str");
}
}
}
Program: 98360
Project: 98360
Buggy source:
protected void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200);
switch (order.getState()) {
case CREATED:
case CLOSED:
      this.order=null;
    break;
default :
  console.getOut().println(order.getLabel() + "String_Node_Str");
}
}
}

Fixed version (ground truth):
protected void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200);
    prevOrder=order;
  }
}
Program: 98361
Project: 98361
Buggy source:
private IOrder submitOrder(Instrument instrument,OrderCommand orderCommand,double stopLossPrice,double takeProfitPrice) throws JFException {
  double amount=getAmount(account,instrument,riskPercent,stopLossPrice);
  return engine.submitOrder(getLabel(instrument),instrument,orderCommand,amount,0,slippage,stopLossPrice,takeProfitPrice);
}

Fixed version (ground truth):
private IOrder submitOrder(Instrument instrument,OrderCommand orderCommand,double stopLossPrice,double takeProfitPrice) throws JFException {
  double amount=getAmount(account,instrument,riskPercent,getPipPrice(stopLossPips));
  return engine.submitOrder(getLabel(instrument),instrument,orderCommand,amount,0,slippage,stopLossPrice,takeProfitPrice);
}
Program: 98362
Project: 98362
Buggy source:
@Override public void onStart(IContext context) throws JFException {
  console=context.getConsole();
  engine=context.getEngine();
  history=context.getHistory();
  indicators=context.getIndicators();
  this.context=context;
  Set subscribedInstruments=new HashSet();
  subscribedInstruments.add(instrument);
  context.setSubscribedInstruments(subscribedInstruments);
  IChart chart=context.getChart(instrument);
  if (chart != null && engine.getType() == IEngine.Type.TEST) {
    chart.addIndicator(indicators.getIndicator("String_Node_Str"),new Object[]{timePeriodFast,maTypeFast.ordinal(),timePeriodSlow,maTypeSlow.ordinal()});
  }
  for (  IOrder order : engine.getOrders(instrument)) {
    if (order.getLabel().substring(0,id.length()).equals(id)) {
      if (this.order != null) {
        console.getWarn().println(this.order.getLabel() + "String_Node_Str");
      }
      this.order=order;
      counter=Integer.valueOf(order.getLabel().substring(5,14));
      console.getNotif().println(order.getLabel() + "String_Node_Str");
    }
  }
  if (isActive(order))   console.getInfo().println(order.getLabel() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onStart(IContext context) throws JFException {
  console=context.getConsole();
  engine=context.getEngine();
  history=context.getHistory();
  indicators=context.getIndicators();
  this.context=context;
  Set subscribedInstruments=new HashSet();
  subscribedInstruments.add(instrument);
  context.setSubscribedInstruments(subscribedInstruments);
  IChart chart=context.getChart(instrument);
  if (chart != null && engine.getType() == IEngine.Type.TEST) {
    chart.addIndicator(indicators.getIndicator("String_Node_Str"),new Object[]{timePeriodFast,maTypeFast.ordinal(),timePeriodSlow,maTypeSlow.ordinal()});
  }
  for (  IOrder order : engine.getOrders(instrument)) {
    if (order.getLabel().substring(0,id.length()).equals(id)) {
      if (this.order != null) {
        console.getOut().println(this.order.getLabel() + "String_Node_Str");
      }
      this.order=order;
      counter=Integer.valueOf(order.getLabel().substring(5,14));
      console.getOut().println(order.getLabel() + "String_Node_Str");
    }
  }
  if (isActive(order))   console.getOut().println(order.getLabel() + "String_Node_Str");
}
Program: 98363
Project: 98363
Buggy source:
public void onMessage(IMessage message) throws JFException {
  if (message.getOrder() != null && message.getOrder().getLabel().substring(0,id.length()).equals(id)) {
    String orderLabel=message.getOrder().getLabel();
    IMessage.Type messageType=message.getType();
switch (messageType) {
case ORDER_FILL_OK:
case ORDER_CHANGED_OK:
      break;
case ORDER_SUBMIT_OK:
case ORDER_CLOSE_OK:
case ORDERS_MERGE_OK:
    console.getInfo().println(orderLabel + "String_Node_Str" + messageType);
  break;
case NOTIFICATION:
console.getNotif().println(orderLabel + "String_Node_Str" + message.getContent().replaceAll("String_Node_Str","String_Node_Str"));
break;
case ORDER_CHANGED_REJECTED:
case ORDER_CLOSE_REJECTED:
case ORDER_FILL_REJECTED:
case ORDER_SUBMIT_REJECTED:
case ORDERS_MERGE_REJECTED:
console.getWarn().println(orderLabel + "String_Node_Str" + message.getContent());
break;
default :
console.getErr().println(orderLabel + "String_Node_Str" + messageType+ "String_Node_Str"+ message.getContent());
break;
}
}
}

Fixed version (ground truth):
public void onMessage(IMessage message) throws JFException {
  if (message.getOrder() != null && message.getOrder().getLabel().substring(0,id.length()).equals(id)) {
    String orderLabel=message.getOrder().getLabel();
    IMessage.Type messageType=message.getType();
switch (messageType) {
case ORDER_FILL_OK:
case ORDER_CHANGED_OK:
      break;
case ORDER_SUBMIT_OK:
case ORDER_CLOSE_OK:
case ORDERS_MERGE_OK:
    console.getOut().println(orderLabel + "String_Node_Str" + messageType);
  break;
case NOTIFICATION:
console.getOut().println(orderLabel + "String_Node_Str" + message.getContent().replaceAll("String_Node_Str","String_Node_Str"));
break;
case ORDER_CHANGED_REJECTED:
case ORDER_CLOSE_REJECTED:
case ORDER_FILL_REJECTED:
case ORDER_SUBMIT_REJECTED:
case ORDERS_MERGE_REJECTED:
console.getOut().println(orderLabel + "String_Node_Str" + message.getContent());
break;
default :
console.getOut().println(orderLabel + "String_Node_Str" + messageType+ "String_Node_Str"+ message.getContent());
break;
}
}
}
Program: 98364
Project: 98364
Buggy source:
private void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200,IOrder.State.CLOSED);
    if (order.getState() == IOrder.State.CLOSED) {
      this.order=null;
    }
 else {
      console.getWarn().println(order.getLabel() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void closeOrder(IOrder order) throws JFException {
  if (isActive(order)) {
    order.close();
    order.waitForUpdate(200);
    if (order.getState() == IOrder.State.CLOSED) {
      this.order=null;
    }
 else {
      console.getOut().println(order.getLabel() + "String_Node_Str");
    }
  }
}
Program: 98365
Project: 98365
Buggy source:
@Override public void onStart(IContext context) throws JFException {
  console=context.getConsole();
  engine=context.getEngine();
  history=context.getHistory();
  indicators=context.getIndicators();
  this.context=context;
  Set subscribedInstruments=new HashSet();
  subscribedInstruments.add(instrument);
  context.setSubscribedInstruments(subscribedInstruments);
  IChart chart=context.getChart(instrument);
  if (chart != null && engine.getType() == IEngine.Type.TEST) {
    chart.addIndicator(indicators.getIndicator("String_Node_Str"),new Object[]{dcTimePeriod});
  }
  for (  IOrder order : engine.getOrders(instrument)) {
    if (order.getLabel().substring(0,id.length()).equals(id)) {
      if (this.order != null) {
        console.getWarn().println(this.order.getLabel() + "String_Node_Str");
      }
      this.order=order;
      counter=Integer.valueOf(order.getLabel().substring(5,14));
      console.getNotif().println(order.getLabel() + "String_Node_Str");
    }
  }
  if (isActive(order))   console.getInfo().println(order.getLabel() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onStart(IContext context) throws JFException {
  console=context.getConsole();
  engine=context.getEngine();
  history=context.getHistory();
  indicators=context.getIndicators();
  this.context=context;
  Set subscribedInstruments=new HashSet();
  subscribedInstruments.add(instrument);
  context.setSubscribedInstruments(subscribedInstruments);
  IChart chart=context.getChart(instrument);
  if (chart != null && engine.getType() == IEngine.Type.TEST) {
    chart.addIndicator(indicators.getIndicator("String_Node_Str"),new Object[]{dcTimePeriod});
  }
  for (  IOrder order : engine.getOrders(instrument)) {
    if (order.getLabel().substring(0,id.length()).equals(id)) {
      if (this.order != null) {
        console.getOut().println(this.order.getLabel() + "String_Node_Str");
      }
      this.order=order;
      counter=Integer.valueOf(order.getLabel().substring(5,14));
      console.getOut().println(order.getLabel() + "String_Node_Str");
    }
  }
  if (isActive(order))   console.getOut().println(order.getLabel() + "String_Node_Str");
}