nus-yam/ex-repair huggingface dataset:
Program: 36232
Project: 36232
Buggy source:
@Test(groups={MUST},description="String_Node_Str" + "String_Node_Str" + "String_Node_Str") @SpecTest(specRefUri=LdpTestSuite.SPEC_URI + "String_Node_Str",testMethod=METHOD.AUTOMATED,approval=STATUS.WG_APPROVED) public void testContainerTypeIsBasicContainer(){
  Model containerModel=getAsModel(basicContainer);
  Resource container=containerModel.getResource(basicContainer);
  assertTrue(container.hasProperty(RDF.type,LDP.BasicContainer.stringValue()),"String_Node_Str" + basicContainer + "String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={MUST},description="String_Node_Str" + "String_Node_Str" + "String_Node_Str") @SpecTest(specRefUri=LdpTestSuite.SPEC_URI + "String_Node_Str",testMethod=METHOD.AUTOMATED,approval=STATUS.WG_APPROVED) public void testContainerTypeIsBasicContainer(){
  Model containerModel=getAsModel(basicContainer);
  Resource container=containerModel.getResource(basicContainer);
  assertTrue(container.hasProperty(RDF.type,containerModel.createResource(LDP.BasicContainer.stringValue())),"String_Node_Str" + basicContainer + "String_Node_Str");
}
Program: 36233
Project: 36233
Buggy source:
public static int getGestureData(int deviceId){
  return mGestureMap.get(deviceId);
}

Fixed version (ground truth):
public static int getGestureData(int deviceId){
  int result=mGestureMap.get(deviceId);
  mGestureMap.put(deviceId,-1);
  return result;
}
Program: 36234
Project: 36234
Buggy source:
@Override public void deviceConnected(BluetoothDevice device){
  Log.d(TAG,"String_Node_Str" + device.getAddress());
  int deviceId=mNextId++;
  mDeviceIdMap.put(deviceId,device);
  mRotationMap.put(deviceId,new float[3]);
  mGyroMap.put(deviceId,new float[3]);
  mAccelMap.put(deviceId,new float[3]);
  mPointerMap.put(deviceId,new int[2]);
  mButtonMap.put(deviceId,new Integer(0));
  mGestureMap.put(deviceId,new Integer(0));
}

Fixed version (ground truth):
@Override public void deviceConnected(BluetoothDevice device){
  Log.d(TAG,"String_Node_Str" + device.getAddress());
  int deviceId=mNextId++;
  mDeviceIdMap.put(deviceId,device);
  mRotationMap.put(deviceId,new float[3]);
  mGyroMap.put(deviceId,new float[3]);
  mAccelMap.put(deviceId,new float[3]);
  mPointerMap.put(deviceId,new int[2]);
  mButtonMap.put(deviceId,new Integer(0));
  mGestureMap.put(deviceId,new Integer(-1));
}
Program: 36235
Project: 36235
Buggy source:
public static boolean registerForButtonEvents(final int deviceId){
  final BluetoothDevice device=mDeviceIdMap.get(deviceId);
  if (device == null) {
    Log.e(TAG,"String_Node_Str" + deviceId);
    return false;
  }
  try {
    mOpenSpatialService.registerForButtonEvents(device,new OpenSpatialEvent.EventListener(){
      @Override public void onEventReceived(      OpenSpatialEvent event){
        ButtonEvent bEvent=(ButtonEvent)event;
        Log.d(TAG,device.getName() + "String_Node_Str" + bEvent.buttonEventType);
        int buttons=mButtonMap.get(deviceId);
switch (bEvent.buttonEventType) {
case TOUCH0_DOWN:
          buttons|=(1 << 0);
        break;
case TOUCH0_UP:
      buttons&=~(1 << 0);
    break;
case TOUCH1_DOWN:
  buttons|=(1 << 1);
break;
case TOUCH1_UP:
buttons&=~(1 << 1);
break;
case TOUCH2_DOWN:
buttons|=(1 << 2);
break;
case TOUCH2_UP:
buttons&=~(1 << 2);
break;
case TACTILE0_DOWN:
buttons|=(1 << 3);
break;
case TACTILE0_UP:
buttons&=~(1 << 4);
break;
case TACTILE1_DOWN:
buttons|=(1 << 5);
break;
case TACTILE1_UP:
buttons&=~(1 << 5);
break;
}
mButtonMap.put(deviceId,buttons);
Log.d(TAG,"String_Node_Str" + Integer.toHexString(buttons));
}
}
);
}
 catch (OpenSpatialException e) {
Log.e(TAG,"String_Node_Str" + e.getMessage());
return false;
}
return true;
}

Fixed version (ground truth):
public static boolean registerForButtonEvents(final int deviceId){
  final BluetoothDevice device=mDeviceIdMap.get(deviceId);
  if (device == null) {
    Log.e(TAG,"String_Node_Str" + deviceId);
    return false;
  }
  try {
    mOpenSpatialService.registerForButtonEvents(device,new OpenSpatialEvent.EventListener(){
      @Override public void onEventReceived(      OpenSpatialEvent event){
        ButtonEvent bEvent=(ButtonEvent)event;
        Log.d(TAG,device.getName() + "String_Node_Str" + bEvent.buttonEventType);
        int buttons=mButtonMap.get(deviceId);
switch (bEvent.buttonEventType) {
case TOUCH0_DOWN:
          buttons|=(1 << 0);
        break;
case TOUCH0_UP:
      buttons&=~(1 << 0);
    break;
case TOUCH1_DOWN:
  buttons|=(1 << 1);
break;
case TOUCH1_UP:
buttons&=~(1 << 1);
break;
case TOUCH2_DOWN:
buttons|=(1 << 2);
break;
case TOUCH2_UP:
buttons&=~(1 << 2);
break;
case TACTILE0_DOWN:
buttons|=(1 << 3);
break;
case TACTILE0_UP:
buttons&=~(1 << 3);
break;
case TACTILE1_DOWN:
buttons|=(1 << 4);
break;
case TACTILE1_UP:
buttons&=~(1 << 4);
break;
}
mButtonMap.put(deviceId,buttons);
Log.d(TAG,"String_Node_Str" + Integer.toHexString(buttons));
}
}
);
}
 catch (OpenSpatialException e) {
Log.e(TAG,"String_Node_Str" + e.getMessage());
return false;
}
return true;
}
Program: 36236
Project: 36236
Buggy source:
@Override public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException {
  List<InputSplit> inputSplits=new ArrayList<InputSplit>();
  ImportViewArgs importViewArgs;
  try {
    importViewArgs=new ImportViewArgs(jobContext.getConfiguration());
  }
 catch (  ArgsException e) {
    throw new RuntimeException("String_Node_Str");
  }
  String[] viewKeys=importViewArgs.getViewKeys();
  int viewKeysPerMapTask=(int)Math.ceil(viewKeys.length / importViewArgs.getNumMappers());
  CouchbaseViewInputSplit inputSplit=new CouchbaseViewInputSplit();
  int keysInCurrentSplit=0;
  for (  String viewKey : viewKeys) {
    if (keysInCurrentSplit == viewKeysPerMapTask) {
      inputSplits.add(inputSplit);
      inputSplit=new CouchbaseViewInputSplit();
      keysInCurrentSplit=0;
    }
    inputSplit.addKey(viewKey);
    keysInCurrentSplit++;
  }
  if (keysInCurrentSplit > 0) {
    inputSplits.add(inputSplit);
  }
  return inputSplits;
}

Fixed version (ground truth):
@Override public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException {
  List<InputSplit> inputSplits=new ArrayList<InputSplit>();
  ImportViewArgs importViewArgs;
  try {
    importViewArgs=new ImportViewArgs(jobContext.getConfiguration());
  }
 catch (  ArgsException e) {
    throw new RuntimeException("String_Node_Str");
  }
  String[] viewKeys=importViewArgs.getViewKeys();
  int viewKeysPerMapTask=(int)Math.ceil((double)viewKeys.length / importViewArgs.getNumMappers());
  LOGGER.info("String_Node_Str",viewKeysPerMapTask,viewKeys.length,importViewArgs.getNumMappers());
  CouchbaseViewInputSplit inputSplit=new CouchbaseViewInputSplit();
  int keysInCurrentSplit=0;
  for (  String viewKey : viewKeys) {
    if (keysInCurrentSplit == viewKeysPerMapTask) {
      inputSplits.add(inputSplit);
      inputSplit=new CouchbaseViewInputSplit();
      keysInCurrentSplit=0;
    }
    inputSplit.addKey(viewKey);
    keysInCurrentSplit++;
  }
  if (keysInCurrentSplit > 0) {
    inputSplits.add(inputSplit);
  }
  return inputSplits;
}
Program: 36237
Project: 36237
Buggy source:
public static void main(String[] args){
  if (args.length < 1) {
    printUsage();
    System.exit(1);
  }
  String tool=args[0];
  String[] tailArgs=Arrays.copyOfRange(args,1,args.length);
  try {
    if (tool.equals("String_Node_Str")) {
      CouchbaseViewImporter importer=new CouchbaseViewImporter();
      importer.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      CouchbaseViewSerialImporter importer=new CouchbaseViewSerialImporter();
      importer.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      CouchbaseExporter exporter=new CouchbaseExporter();
      exporter.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      BenchmarkUpdater updater=new BenchmarkUpdater();
      updater.start(tailArgs);
    }
 else {
      printUsage();
    }
  }
 catch (  ArgsException e) {
    printUsage();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  if (args.length < 1) {
    printUsage();
    System.exit(1);
  }
  String tool=args[0];
  String[] tailArgs=Arrays.copyOfRange(args,1,args.length);
  try {
    if (tool.equals("String_Node_Str")) {
      CouchbaseViewImporter importer=new CouchbaseViewImporter();
      importer.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      CouchbaseViewSerialImporter importer=new CouchbaseViewSerialImporter();
      importer.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      CouchbaseExporter exporter=new CouchbaseExporter();
      exporter.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      BenchmarkUpdater updater=new BenchmarkUpdater();
      updater.start(tailArgs);
    }
 else {
      printUsage();
    }
  }
 catch (  ArgsException e) {
    printUsage(e.getMessage());
  }
}
Program: 36238
Project: 36238
Buggy source:
public static void printUsage(){
  System.err.println("String_Node_Str" + APP_NAME + "String_Node_Str"+ APP_NAME+ "String_Node_Str"+ APP_NAME+ "String_Node_Str");
}

Fixed version (ground truth):
public static void printUsage(String msg){
  if (msg != null) {
    System.err.println(msg);
  }
  System.err.println("String_Node_Str" + APP_NAME + "String_Node_Str"+ APP_NAME+ "String_Node_Str"+ APP_NAME+ "String_Node_Str");
}
Program: 36239
Project: 36239
Buggy source:
public static void main(String[] args){
  if (args.length < 1) {
    printUsage();
    System.exit(1);
  }
  String tool=args[0];
  String[] tailArgs=Arrays.copyOfRange(args,1,args.length);
  try {
    if (tool.equals("String_Node_Str")) {
      CouchbaseViewImporter importer=new CouchbaseViewImporter();
      importer.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      CouchbaseViewSerialImporter importer=new CouchbaseViewSerialImporter();
      importer.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      CouchbaseExporter exporter=new CouchbaseExporter();
      exporter.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      BenchmarkUpdater updater=new BenchmarkUpdater();
      updater.start(tailArgs);
    }
 else {
      printUsage();
    }
  }
 catch (  ArgsException e) {
    printUsage(e.getMessage());
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  if (args.length < 1) {
    printUsage();
    System.exit(1);
  }
  String tool=args[0];
  String[] tailArgs=Arrays.copyOfRange(args,1,args.length);
  try {
    if (tool.equals("String_Node_Str")) {
      CouchbaseViewImporter importer=new CouchbaseViewImporter();
      importer.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      CouchbaseViewSerialImporter importer=new CouchbaseViewSerialImporter();
      importer.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      CouchbaseExporter exporter=new CouchbaseExporter();
      exporter.start(tailArgs);
    }
 else     if (tool.equals("String_Node_Str")) {
      BenchmarkUpdater updater=new BenchmarkUpdater();
      updater.start(tailArgs);
    }
 else {
      printUsage();
    }
  }
 catch (  ArgsException e) {
    printUsage();
  }
}
Program: 36240
Project: 36240
Buggy source:
public static void printUsage(String message){
  if (message != null) {
    System.err.println(message);
  }
  System.err.println("String_Node_Str" + APP_NAME + "String_Node_Str"+ APP_NAME+ "String_Node_Str"+ APP_NAME+ "String_Node_Str");
}

Fixed version (ground truth):
public static void printUsage(){
  System.err.println("String_Node_Str" + APP_NAME + "String_Node_Str"+ APP_NAME+ "String_Node_Str"+ APP_NAME+ "String_Node_Str");
}
Program: 36241
Project: 36241
Buggy source:
public Job configureJob(Configuration conf,String input) throws IOException {
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",20);
  Job job=new Job(conf);
  job.setJarByClass(CouchbaseExporter.class);
  FileInputFormat.setInputPaths(job,input);
  job.setMapperClass(TsvToCouchbaseMapper.class);
  job.setMapOutputKeyClass(String.class);
  job.setMapOutputValueClass(CouchbaseAction.class);
  job.setNumReduceTasks(0);
  job.setOutputFormatClass(CouchbaseOutputFormat.class);
  job.setMapOutputKeyClass(String.class);
  job.setMapOutputValueClass(CouchbaseAction.class);
  return job;
}

Fixed version (ground truth):
public Job configureJob(Configuration conf,String input) throws IOException {
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",20);
  Job job=new Job(conf);
  job.setJarByClass(CouchbaseExporter.class);
  job.setUserClassesTakesPrecedence(true);
  FileInputFormat.setInputPaths(job,input);
  job.setMapperClass(TsvToCouchbaseMapper.class);
  job.setMapOutputKeyClass(String.class);
  job.setMapOutputValueClass(CouchbaseAction.class);
  job.setNumReduceTasks(0);
  job.setOutputFormatClass(CouchbaseOutputFormat.class);
  job.setMapOutputKeyClass(String.class);
  job.setMapOutputValueClass(CouchbaseAction.class);
  return job;
}
Program: 36242
Project: 36242
Buggy source:
public Job configureJob(Configuration conf,String output) throws IOException {
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",20);
  Job job=new Job(conf);
  job.setJarByClass(CouchbaseViewImporter.class);
  job.setInputFormatClass(CouchbaseViewInputFormat.class);
  job.setMapperClass(CouchbaseViewToFileMapper.class);
  job.setMapOutputKeyClass(Text.class);
  job.setMapOutputValueClass(Text.class);
  job.setNumReduceTasks(0);
  job.setOutputKeyClass(Text.class);
  job.setOutputValueClass(Text.class);
  FileOutputFormat.setOutputPath(job,new Path(output));
  return job;
}

Fixed version (ground truth):
public Job configureJob(Configuration conf,String output) throws IOException {
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",20);
  Job job=new Job(conf);
  job.setJarByClass(CouchbaseViewImporter.class);
  job.setUserClassesTakesPrecedence(true);
  job.setInputFormatClass(CouchbaseViewInputFormat.class);
  job.setMapperClass(CouchbaseViewToFileMapper.class);
  job.setMapOutputKeyClass(Text.class);
  job.setMapOutputValueClass(Text.class);
  job.setNumReduceTasks(0);
  job.setOutputKeyClass(Text.class);
  job.setOutputValueClass(Text.class);
  FileOutputFormat.setOutputPath(job,new Path(output));
  return job;
}
Program: 36243
Project: 36243
Buggy source:
public Job configureJob(Configuration conf,String input) throws IOException {
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",20);
  Job job=new Job(conf);
  job.setJarByClass(BenchmarkUpdater.class);
  FileInputFormat.setInputPaths(job,input);
  job.setMapperClass(BenchmarkUpdateMapper.class);
  job.setMapOutputKeyClass(String.class);
  job.setMapOutputValueClass(CouchbaseAction.class);
  job.setNumReduceTasks(0);
  job.setOutputFormatClass(CouchbaseOutputFormat.class);
  job.setMapOutputKeyClass(String.class);
  job.setMapOutputValueClass(CouchbaseAction.class);
  return job;
}

Fixed version (ground truth):
public Job configureJob(Configuration conf,String input) throws IOException {
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",5);
  conf.setInt("String_Node_Str",20);
  Job job=new Job(conf);
  job.setJarByClass(BenchmarkUpdater.class);
  job.setUserClassesTakesPrecedence(true);
  FileInputFormat.setInputPaths(job,input);
  job.setMapperClass(BenchmarkUpdateMapper.class);
  job.setMapOutputKeyClass(String.class);
  job.setMapOutputValueClass(CouchbaseAction.class);
  job.setNumReduceTasks(0);
  job.setOutputFormatClass(CouchbaseOutputFormat.class);
  job.setMapOutputKeyClass(String.class);
  job.setMapOutputValueClass(CouchbaseAction.class);
  return job;
}
Program: 36244
Project: 36244
Buggy source:
@Override public void onClick(View v){
  loadPage();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  webView.reload();
}
Program: 36245
Project: 36245
Buggy source:
@Override public boolean shouldOverrideUrlLoading(WebView view,String url){
  Log.d("String_Node_Str","String_Node_Str" + url);
  boolean completed=false;
  if (url.contains(PaymentArguments.EXT_AUTH_SUCCESS_URI)) {
    completed=true;
    hideWebView();
    proceed();
  }
 else   if (url.contains(PaymentArguments.EXT_AUTH_FAIL_URI)) {
    completed=true;
    showError(Error.AUTHORIZATION_REJECT,null);
  }
  if (completed) {
    hideProgressBar();
  }
  return completed || super.shouldOverrideUrlLoading(view,url);
}

Fixed version (ground truth):
@Override public boolean shouldOverrideUrlLoading(WebView view,String url){
  Log.d("String_Node_Str","String_Node_Str" + url);
  boolean completed=false;
  if (url.contains(PaymentArguments.EXT_AUTH_SUCCESS_URI)) {
    completed=true;
    webView.setVisibility(View.GONE);
    proceed();
  }
 else   if (url.contains(PaymentArguments.EXT_AUTH_FAIL_URI)) {
    completed=true;
    showError(Error.AUTHORIZATION_REJECT,null);
  }
  if (completed) {
    hideProgressBar();
  }
  return completed || super.shouldOverrideUrlLoading(view,url);
}
Program: 36246
Project: 36246
Buggy source:
@Override public void onReceivedError(WebView view,int errorCode,String description,String failingUrl){
  super.onReceivedError(view,errorCode,description,failingUrl);
  hideProgressBar();
  showMessageView();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void onReceivedError(WebView view,int errorCode,String description,String failingUrl){
  super.onReceivedError(view,errorCode,description,failingUrl);
  hideProgressBar();
  setMessageVisible(true);
}
Program: 36247
Project: 36247
Buggy source:
private void setUpWebView(){
  webView=(WebView)fragmentLayout.findViewById(R.id.web_view);
  webView.setVisibility(View.VISIBLE);
  webView.setWebViewClient(new Client());
  webView.setWebChromeClient(new Chrome());
  webView.getSettings().setJavaScriptEnabled(true);
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") private void setUpWebView(View layout){
  webView=(WebView)layout.findViewById(R.id.web_view);
  webView.setVisibility(View.VISIBLE);
  webView.setWebViewClient(new Client());
  webView.setWebChromeClient(new Chrome());
  webView.getSettings().setJavaScriptEnabled(true);
}
Program: 36248
Project: 36248
Buggy source:
@SuppressLint("String_Node_Str") @Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  fragmentLayout=(LinearLayout)inflater.inflate(R.layout.ym_web_fragment,container,false);
  setUpWebView();
  setUpMessageView();
  return fragmentLayout;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View layout=inflater.inflate(R.layout.ym_web_fragment,container,false);
  setUpWebView(layout);
  setUpMessageView(layout);
  return layout;
}
Program: 36249
Project: 36249
Buggy source:
private void setUpMessageView(){
  messageView=(ScrollView)fragmentLayout.findViewById(R.id.error_message);
  final int titleResId=R.string.ym_error_something_wrong_title;
  final int messageResId=R.string.ym_error_unknown;
  final int actionResId=R.string.ym_error_action_try_again;
  final Button action=(Button)messageView.findViewById(R.id.ym_error_action);
  Views.setText(messageView,R.id.ym_error_title,getString(titleResId));
  Views.setText(messageView,R.id.ym_error_message,getString(messageResId));
  action.setText(getString(actionResId));
  action.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      loadPage();
    }
  }
);
}

Fixed version (ground truth):
private void setUpMessageView(View layout){
  messageView=layout.findViewById(R.id.error_message);
  final int titleResId=R.string.ym_error_something_wrong_title;
  final int messageResId=R.string.ym_error_unknown;
  final int actionResId=R.string.ym_error_action_try_again;
  final Button action=(Button)messageView.findViewById(R.id.ym_error_action);
  Views.setText(messageView,R.id.ym_error_title,getString(titleResId));
  Views.setText(messageView,R.id.ym_error_message,getString(messageResId));
  action.setText(getString(actionResId));
  action.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      webView.reload();
    }
  }
);
}
Program: 36250
Project: 36250
Buggy source:
public void showCsc(ExternalCard moneySource){
  replaceFragmentAddingToBackStack(CscFragment.newInstance(moneySource));
}

Fixed version (ground truth):
public void showCsc(ExternalCard externalCard){
  selectedCard=externalCard;
  replaceFragment(CscFragment.newInstance(externalCard),false);
}
Program: 36251
Project: 36251
Buggy source:
private void performOperation(Callable<Call> operation){
  showProgressBar();
  try {
    operation.call();
  }
 catch (  Exception e) {
    onOperationFailed();
  }
}

Fixed version (ground truth):
private Call performOperation(Callable<Call> operation){
  showProgressBar();
  try {
    return operation.call();
  }
 catch (  Exception e) {
    onOperationFailed();
    return null;
  }
}
Program: 36252
Project: 36252
Buggy source:
public void showUnknownError(){
  replaceFragmentClearBackStack(ErrorFragment.newInstance());
}

Fixed version (ground truth):
public void showUnknownError(){
  replaceFragment(ErrorFragment.newInstance(),true);
}
Program: 36253
Project: 36253
Buggy source:
@Override public MoneySource getMoneySource(){
  Fragment fragment=getCurrentFragment();
  return fragment instanceof CscFragment ? ((CscFragment)fragment).getMoneySource() : null;
}

Fixed version (ground truth):
@Override public MoneySource getMoneySource(){
  return selectedCard;
}
Program: 36254
Project: 36254
Buggy source:
public void showError(Error error,String status){
  replaceFragmentClearBackStack(ErrorFragment.newInstance(error,status));
}

Fixed version (ground truth):
public void showError(Error error,String status){
  replaceFragment(ErrorFragment.newInstance(error,status),true);
}
Program: 36255
Project: 36255
Buggy source:
public void repeat(){
  performOperation(new Callable<Call>(){
    @Override public Call call() throws Exception {
      return process.repeatAsync();
    }
  }
);
}

Fixed version (ground truth):
public void repeat(){
  call=performOperation(new Callable<Call>(){
    @Override public Call call() throws Exception {
      return process.repeatAsync();
    }
  }
);
}
Program: 36256
Project: 36256
Buggy source:
public void showCards(){
  RequestExternalPayment rep=(RequestExternalPayment)process.getRequestPayment();
  replaceFragmentClearBackStack(CardsFragment.newInstance(rep.title,rep.contractAmount));
}

Fixed version (ground truth):
public void showCards(){
  RequestExternalPayment rep=(RequestExternalPayment)process.getRequestPayment();
  replaceFragment(CardsFragment.newInstance(rep.title,rep.contractAmount),true);
}
Program: 36257
Project: 36257
Buggy source:
public void showSuccess(ExternalCard moneySource){
  BaseRequestPayment rp=process.getRequestPayment();
  replaceFragmentClearBackStack(SuccessFragment.newInstance(rp.contractAmount,moneySource));
}

Fixed version (ground truth):
public void showSuccess(ExternalCard moneySource){
  replaceFragment(SuccessFragment.newInstance(process.getRequestPayment().contractAmount,moneySource),true);
}
Program: 36258
Project: 36258
Buggy source:
@Override public void onBackPressed(){
  applyResult();
  hideProgressBar();
  super.onBackPressed();
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  super.onBackPressed();
  if (call != null) {
    call.cancel();
  }
  Fragment fragment=getCurrentFragment();
  if (fragment instanceof CscFragment) {
    super.onBackPressed();
    fragment=getCurrentFragment();
  }
  if (fragment instanceof CardsFragment) {
    process.reset();
    proceed();
  }
}
Program: 36259
Project: 36259
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.ym_payment_activity);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  arguments=new PaymentArguments(getIntent().getBundleExtra(EXTRA_ARGUMENTS));
  cards=new DatabaseStorage(this).selectMoneySources();
  boolean ready=initPaymentProcess();
  if (!ready) {
    return;
  }
  if (savedInstanceState == null) {
    proceed();
  }
 else {
    process.restoreSavedState(savedInstanceState.<ExternalPaymentProcessSavedStateParcelable>getParcelable(KEY_PROCESS_SAVED_STATE).getSavedState());
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.ym_payment_activity);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  arguments=new PaymentArguments(getIntent().getBundleExtra(EXTRA_ARGUMENTS));
  cards=new DatabaseStorage(this).selectMoneySources();
  boolean ready=initPaymentProcess();
  if (!ready) {
    return;
  }
  if (savedInstanceState == null) {
    proceed();
  }
 else {
    process.restoreSavedState(savedInstanceState.<ExternalPaymentProcessSavedStateParcelable>getParcelable(KEY_PROCESS_SAVED_STATE).getSavedState());
    if (savedInstanceState.containsKey(KEY_SELECTED_CARD)) {
      selectedCard=savedInstanceState.<ExternalCardParcelable>getParcelable(KEY_SELECTED_CARD).getExternalCard();
    }
  }
}
Program: 36260
Project: 36260
Buggy source:
public void proceed(){
  performOperation(new Callable<Call>(){
    @Override public Call call() throws Exception {
      return process.proceedAsync();
    }
  }
);
}

Fixed version (ground truth):
public void proceed(){
  call=performOperation(new Callable<Call>(){
    @Override public Call call() throws Exception {
      return process.proceedAsync();
    }
  }
);
}
Program: 36261
Project: 36261
Buggy source:
private void onExternalPaymentProcessed(ProcessExternalPayment pep){
switch (pep.status) {
case SUCCESS:
    Fragment fragment=getCurrentFragment();
  if (!(fragment instanceof SuccessFragment)) {
    showSuccess(pep.moneySource);
  }
 else   if (pep.moneySource != null) {
    ((SuccessFragment)fragment).saveCard(pep.moneySource);
  }
break;
case EXT_AUTH_REQUIRED:
showWeb(pep.acsUri,pep.acsParams);
break;
default :
showError(pep.error,pep.status.code);
}
}

Fixed version (ground truth):
private void onExternalPaymentProcessed(ProcessExternalPayment pep){
switch (pep.status) {
case SUCCESS:
    Fragment fragment=getCurrentFragment();
  if (!(fragment instanceof SuccessFragment)) {
    showSuccess((ExternalCard)parameterProvider.getMoneySource());
  }
 else   if (pep.moneySource != null) {
    ((SuccessFragment)fragment).saveCard(pep.moneySource);
  }
break;
case EXT_AUTH_REQUIRED:
showWeb(pep.acsUri,pep.acsParams);
break;
default :
showError(pep.error,pep.status.code);
}
}
Program: 36262
Project: 36262
Buggy source:
public void showWeb(String url,Map<String,String> postData){
  replaceFragmentClearBackStack(WebFragment.newInstance(url,postData));
}

Fixed version (ground truth):
public void showWeb(String url,Map<String,String> postData){
  Fragment fragment=getCurrentFragment();
  boolean clearBackStack=!(fragment instanceof CardsFragment || fragment instanceof CscFragment);
  replaceFragment(WebFragment.newInstance(url,postData),clearBackStack);
}
Program: 36264
Project: 36264
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putParcelable(KEY_PROCESS_SAVED_STATE,new ExternalPaymentProcessSavedStateParcelable(process.getSavedState()));
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putParcelable(KEY_PROCESS_SAVED_STATE,new ExternalPaymentProcessSavedStateParcelable(process.getSavedState()));
  if (selectedCard != null) {
    outState.putParcelable(KEY_SELECTED_CARD,new ExternalCardParcelable(selectedCard));
  }
}
Program: 36265
Project: 36265
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.ym_success_fragment,container,false);
  Views.setText(view,R.id.ym_comment,getString(R.string.ym_success_comment,new BigDecimal(getArguments().getString(KEY_CONTRACT_AMOUNT))));
  card=view.findViewById(R.id.ym_card);
  description=(TextView)view.findViewById(R.id.ym_description);
  successMarker=view.findViewById(R.id.ym_success_marker);
  saveCard=(Button)view.findViewById(R.id.ym_save_card);
  saveCard.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      onSaveCardClicked();
    }
  }
);
  return view;
}
Program: 36266
Project: 36266
Buggy source:
@Override public MoneySource getMoneySource(){
  return getCscFragment().getMoneySource();
}

Fixed version (ground truth):
@Override public MoneySource getMoneySource(){
  Fragment fragment=getCurrentFragment();
  return fragment instanceof CscFragment ? ((CscFragment)fragment).getMoneySource() : null;
}
Program: 36267
Project: 36267
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.ym_payment_activity);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  arguments=new PaymentArguments(getIntent().getBundleExtra(EXTRA_ARGUMENTS));
  cards=new DatabaseStorage(this).selectMoneySources();
  boolean ready=initPaymentProcess();
  if (!ready) {
    return;
  }
  if (savedInstanceState == null) {
    proceed();
  }
 else {
    process.restoreSavedState(savedInstanceState.<ExternalPaymentProcessSavedStateParcelable>getParcelable(KEY_PROCESS_SAVED_STATE).getSavedState());
    repeat();
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  setContentView(R.layout.ym_payment_activity);
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
  arguments=new PaymentArguments(getIntent().getBundleExtra(EXTRA_ARGUMENTS));
  cards=new DatabaseStorage(this).selectMoneySources();
  boolean ready=initPaymentProcess();
  if (!ready) {
    return;
  }
  if (savedInstanceState == null) {
    proceed();
  }
 else {
    process.restoreSavedState(savedInstanceState.<ExternalPaymentProcessSavedStateParcelable>getParcelable(KEY_PROCESS_SAVED_STATE).getSavedState());
  }
}
Program: 36268
Project: 36268
Buggy source:
private void onExternalPaymentProcessed(ProcessExternalPayment pep){
switch (pep.status) {
case SUCCESS:
    Fragment fragment=getCurrentFragment();
  if (fragment instanceof SuccessFragment) {
    ((SuccessFragment)fragment).saveCard(pep.moneySource);
  }
 else {
    showSuccess(pep.moneySource);
  }
break;
case EXT_AUTH_REQUIRED:
showWeb(pep.acsUri,pep.acsParams);
break;
default :
showError(pep.error,pep.status.code);
}
}

Fixed version (ground truth):
private void onExternalPaymentProcessed(ProcessExternalPayment pep){
switch (pep.status) {
case SUCCESS:
    Fragment fragment=getCurrentFragment();
  if (!(fragment instanceof SuccessFragment)) {
    showSuccess(pep.moneySource);
  }
 else   if (pep.moneySource != null) {
    ((SuccessFragment)fragment).saveCard(pep.moneySource);
  }
break;
case EXT_AUTH_REQUIRED:
showWeb(pep.acsUri,pep.acsParams);
break;
default :
showError(pep.error,pep.status.code);
}
}
Program: 36269
Project: 36269
Buggy source:
public void showWeb(String url,Map<String,String> postData){
  replaceFragmentAddingToBackStack(WebFragment.newInstance(url,postData));
}

Fixed version (ground truth):
public void showWeb(String url,Map<String,String> postData){
  replaceFragmentClearBackStack(WebFragment.newInstance(url,postData));
}
Program: 36270
Project: 36270
Buggy source:
@Override public String getCsc(){
  return getCscFragment().getCsc();
}

Fixed version (ground truth):
@Override public String getCsc(){
  Fragment fragment=getCurrentFragment();
  return fragment instanceof CscFragment ? ((CscFragment)fragment).getCsc() : null;
}
Program: 36272
Project: 36272
Buggy source:
public void saveCard(ExternalCard moneySource){
  this.moneySource=moneySource;
  new DatabaseStorage(getPaymentActivity()).insertMoneySource(moneySource);
  onCardSaved();
}

Fixed version (ground truth):
public void saveCard(ExternalCard moneySource){
  if (moneySource == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.moneySource=moneySource;
  new DatabaseStorage(getPaymentActivity()).insertMoneySource(moneySource);
  onCardSaved();
}
Program: 36273
Project: 36273
Buggy source:
private void onSaveCardClicked(){
  card.setBackgroundResource(R.drawable.ym_card_process);
  saveCard.setEnabled(false);
  saveCard.setText(R.string.ym_success_saving_card);
  saveCard.setOnClickListener(null);
  description.setText(R.string.ym_success_saving_card_description);
  proceed();
}

Fixed version (ground truth):
private void onSaveCardClicked(){
  card.setBackgroundResource(R.drawable.ym_card_process);
  saveCard.setEnabled(false);
  saveCard.setText(R.string.ym_success_saving_card);
  saveCard.setOnClickListener(null);
  description.setText(R.string.ym_success_saving_card_description);
  repeat();
}
Program: 36274
Project: 36274
Buggy source:
@Override public void onProgressChanged(WebView view,int newProgress){
  Log.d("String_Node_Str","String_Node_Str" + newProgress);
  showProgressBar();
  if (newProgress == 100) {
    hideProgressBar();
  }
}

Fixed version (ground truth):
@Override public void onProgressChanged(WebView view,int newProgress){
  Log.d("String_Node_Str","String_Node_Str" + newProgress);
  if (newProgress == 100) {
    hideProgressBar();
  }
 else {
    showProgressBar();
  }
}
Program: 36275
Project: 36275
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) {
switch (payment) {
case P2P:
      helper.saveAccountNumber(getPaymentTo());
    break;
case PHONE:
  helper.savePhoneNumber(getPaymentTo());
break;
}
updatePrevious();
}
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (requestCode == REQUEST_CODE && resultCode == RESULT_OK && !loadValues().contains(getPaymentTo())) {
switch (payment) {
case P2P:
      helper.saveAccountNumber(getPaymentTo());
    break;
case PHONE:
  helper.savePhoneNumber(getPaymentTo());
break;
}
updatePrevious();
}
}
Program: 36276
Project: 36276
Buggy source:
private void replaceFragmentClearBackStack(Fragment fragment){
  if (fragment == null) {
    return;
  }
  hideProgressBar();
  getFragmentManager().popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE);
  getFragmentManager().beginTransaction().replace(R.id.ym_container,fragment).commit();
}

Fixed version (ground truth):
private void replaceFragmentClearBackStack(Fragment fragment){
  if (fragment == null) {
    return;
  }
  hideProgressBar();
  getFragmentManager().popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE);
  getFragmentManager().beginTransaction().replace(R.id.ym_container,fragment).commit();
  hideKeyboard();
}
Program: 36277
Project: 36277
Buggy source:
private void replaceFragmentAddingToBackStack(Fragment fragment){
  if (fragment == null) {
    return;
  }
  hideProgressBar();
  getFragmentManager().beginTransaction().replace(R.id.ym_container,fragment).addToBackStack(fragment.getTag()).commit();
}

Fixed version (ground truth):
private void replaceFragmentAddingToBackStack(Fragment fragment){
  if (fragment == null) {
    return;
  }
  hideProgressBar();
  getFragmentManager().beginTransaction().replace(R.id.ym_container,fragment).addToBackStack(fragment.getTag()).commit();
  hideKeyboard();
}
Program: 36278
Project: 36278
Buggy source:
public AppResourceProvider(String appPath,String projectName) throws Exception {
  final Properties appProps=new Properties();
  final File baseDir=new File(appPath,projectName);
  appProps.load(new BufferedInputStream(new FileInputStream(new File(baseDir,APP_PROPERTIES))));
  appDescriptor=new AppDescriptorDto();
  appDescriptor.setRoot(APPS_BASE_PATH + '/' + projectName);
  appDescriptor.setMain(appProps.getProperty("String_Node_Str"));
  appDescriptor.setSplash(appProps.getProperty("String_Node_Str"));
  appDescriptor.setSplashCloseOn(appProps.getProperty("String_Node_Str"));
  appDescriptor.setFxml(appProps.getProperty("String_Node_Str"));
  appDescriptor.setIncludePackages(appProps.getProperty("String_Node_Str"));
  final String[] classPath=PATH_SEP.split(appProps.getProperty("String_Node_Str"));
  final List<URL> urls=new ArrayList<>(classPath.length);
  for (  final String path : classPath) {
    final String classPathElement=path.trim();
    if (!classPathElement.isEmpty()) {
      urls.add(new File(baseDir,classPathElement).toURI().toURL());
    }
  }
  loader=new URLClassLoader(urls.toArray(new URL[urls.size()]));
}

Fixed version (ground truth):
public AppResourceProvider(String appPath,String projectName) throws Exception {
  final Properties appProps=new Properties();
  final File baseDir=new File(appPath,projectName);
  appProps.load(new BufferedInputStream(new FileInputStream(new File(baseDir,APP_PROPERTIES))));
  appDescriptor=new AppDescriptorDto();
  appDescriptor.setRoot(contextPath + APPS_BASE_PATH + '/'+ projectName);
  appDescriptor.setMain(appProps.getProperty("String_Node_Str"));
  appDescriptor.setSplash(appProps.getProperty("String_Node_Str"));
  appDescriptor.setSplashCloseOn(appProps.getProperty("String_Node_Str"));
  appDescriptor.setFxml(appProps.getProperty("String_Node_Str"));
  appDescriptor.setIncludePackages(appProps.getProperty("String_Node_Str"));
  final String[] classPath=PATH_SEP.split(appProps.getProperty("String_Node_Str"));
  final List<URL> urls=new ArrayList<>(classPath.length);
  for (  final String path : classPath) {
    final String classPathElement=path.trim();
    if (!classPathElement.isEmpty()) {
      urls.add(new File(baseDir,classPathElement).toURI().toURL());
    }
  }
  loader=new URLClassLoader(urls.toArray(new URL[urls.size()]));
}
Program: 36279
Project: 36279
Buggy source:
private AppResourceProvider getOrRegisterApp(String applicationName){
  AppResourceProvider resourceProvider=apps.get(applicationName);
  if (resourceProvider == null) {
    try {
      initRootDir();
      resourceProvider=new AppResourceProvider(rootDir,applicationName);
      apps.put(applicationName,resourceProvider);
    }
 catch (    Exception e) {
      logger.warning(e.toString());
    }
  }
  return resourceProvider;
}

Fixed version (ground truth):
private AppResourceProvider getOrRegisterApp(String applicationName){
  AppResourceProvider resourceProvider=apps.get(applicationName);
  if (resourceProvider == null) {
    try {
      initRootDirAndContext();
      resourceProvider=new AppResourceProvider(rootDir,applicationName);
      apps.put(applicationName,resourceProvider);
    }
 catch (    Exception e) {
      logger.warning(e.toString());
    }
  }
  return resourceProvider;
}
Program: 36280
Project: 36280
Buggy source:
@Override public void doFilter(final ServletRequest request,final ServletResponse response,final FilterChain chain) throws IOException, ServletException {
  final String pathTranslated=((HttpServletRequest)request).getPathInfo();
  assert(pathTranslated.charAt(0) == '/');
  int resourceIdx=pathTranslated.indexOf('/',1) + 1;
  if ((resourceIdx > 0) && (pathTranslated.length() != resourceIdx)) {
    String rewritten=APPS_BASE_PATH + pathTranslated.substring(0,resourceIdx);
    if (!"String_Node_Str".equals(((HttpServletRequest)request).getQueryString())) {
      rewritten+="String_Node_Str" + pathTranslated.substring(resourceIdx);
    }
    ((HttpServletResponse)response).sendRedirect(rewritten);
    return;
  }
  chain.doFilter(request,response);
}

Fixed version (ground truth):
@Override public void doFilter(final ServletRequest request,final ServletResponse response,final FilterChain chain) throws IOException, ServletException {
  final String pathTranslated=((HttpServletRequest)request).getPathInfo();
  assert(pathTranslated.charAt(0) == '/');
  int resourceIdx=pathTranslated.indexOf('/',1) + 1;
  if ((resourceIdx > 0) && (pathTranslated.length() != resourceIdx)) {
    String rewritten=((HttpServletRequest)request).getContextPath() + APPS_BASE_PATH + pathTranslated.substring(0,resourceIdx);
    if (!"String_Node_Str".equals(((HttpServletRequest)request).getQueryString())) {
      rewritten+="String_Node_Str" + pathTranslated.substring(resourceIdx);
    }
    ((HttpServletResponse)response).sendRedirect(rewritten);
    return;
  }
  chain.doFilter(request,response);
}
Program: 36281
Project: 36281
Buggy source:
@Override public InputStream getInputStream() throws IOException {
  if (inMem) {
    return classLoader.getPreLoadedResourceAsStream(getURL());
  }
 else {
    redirectConnection.setConnectTimeout(CONNECTION_TIMEOUT);
    for (int i=0; i < CONNECT_ATTEMPTS; i++) {
      try {
        return redirectConnection.getInputStream();
      }
 catch (      SocketTimeoutException e) {
      }
      redirectConnection=convertToHTTP(url).openConnection();
      redirectConnection.setConnectTimeout(CONNECTION_TIMEOUT);
      redirectConnection.connect();
    }
    throw new SocketTimeoutException("String_Node_Str" + url + "String_Node_Str"+ CONNECT_ATTEMPTS+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public InputStream getInputStream() throws IOException {
  if (inMem) {
    return classLoader.getPreLoadedResourceAsStream(getURL());
  }
 else {
    redirectConnection.setConnectTimeout(CONNECTION_TIMEOUT);
    for (int i=0; i < CONNECT_ATTEMPTS; i++) {
      try {
        return redirectConnection.getInputStream();
      }
 catch (      SocketTimeoutException|ConnectException e) {
      }
      redirectConnection=convertToHTTP(url).openConnection();
      redirectConnection.setConnectTimeout(CONNECTION_TIMEOUT);
      redirectConnection.connect();
    }
    throw new SocketTimeoutException("String_Node_Str" + url + "String_Node_Str"+ CONNECT_ATTEMPTS+ "String_Node_Str");
  }
}
Program: 36282
Project: 36282
Buggy source:
/** 
 * Return a response after real processing of the CSS.
 * @param css The CSS stylesheet to check
 * @return The response
 * @throws IOException if fails
 */
private ValidationResponse processed(final String css) throws IOException {
  final Request req=this.request(this.uri,this.entity("String_Node_Str",DefaultCssValidator.filter(css),"String_Node_Str"));
  final Response response=req.fetch();
  this.assertThatDoesNotHasBadHttpStatusAt(response);
  return this.build(response.as(XmlResponse.class).registerNs("String_Node_Str","String_Node_Str").registerNs("String_Node_Str","String_Node_Str").assertXPath("String_Node_Str").assertXPath("String_Node_Str").xml());
}

Fixed version (ground truth):
/** 
 * Return a response after real processing of the CSS.
 * @param css The CSS stylesheet to check
 * @return The response
 * @throws IOException if fails
 */
private ValidationResponse processed(final String css) throws IOException {
  final Request req=this.request(this.uri,this.entity("String_Node_Str",DefaultCssValidator.filter(css),"String_Node_Str"));
  final Response response=this.withoutBadResponseStatus(req.fetch());
  return this.build(response.as(XmlResponse.class).registerNs("String_Node_Str","String_Node_Str").registerNs("String_Node_Str","String_Node_Str").assertXPath("String_Node_Str").assertXPath("String_Node_Str").xml());
}
Program: 36284
Project: 36284
Buggy source:
private String getSizeStatement(){
  StringBuilder s=new StringBuilder();
  s.append("String_Node_Str");
  s.append(w);
  s.append("String_Node_Str");
  s.append(h);
  if (renderer != null && !renderer.isEmpty()) {
    s.append("String_Node_Str");
    s.append(renderer);
    s.append("String_Node_Str");
  }
  s.append("String_Node_Str");
  return s.toString();
}

Fixed version (ground truth):
private String getSizeStatement(){
  StringBuilder s=new StringBuilder();
  s.append("String_Node_Str");
  s.append(w);
  s.append("String_Node_Str");
  s.append(h);
  if (renderer != null && !renderer.isEmpty()) {
    s.append("String_Node_Str");
    s.append(renderer);
  }
  s.append("String_Node_Str");
  return s.toString();
}
Program: 36285
Project: 36285
Buggy source:
public String getPreviousCommand(String currCommand){
  currentCycleCommand--;
  if (currentCycleCommand < 0) {
    if (commandList.size() == 0) {
      currentCycleCommand=UNDEFINED_COMMAND_STEP;
      return "String_Node_Str";
    }
 else     if (currentCycleCommand == UNDEFINED_COMMAND_STEP - 1) {
      currentCycleCommand=commandList.size() - 1;
      this.currentCommand=currCommand;
      return commandList.get(currentCycleCommand);
    }
 else {
      currentCycleCommand=0;
      return commandList.get(0);
    }
  }
 else {
    return commandList.get(currentCycleCommand);
  }
}

Fixed version (ground truth):
public String getPreviousCommand(String currCommand){
  currentCycleCommand--;
  if (currentCycleCommand < 0) {
    if (commandList.size() == 0) {
      currentCycleCommand=UNDEFINED_COMMAND_STEP;
      return "String_Node_Str";
    }
 else     if (currentCycleCommand == UNDEFINED_COMMAND_STEP - 1) {
      currentCycleCommand=commandList.size() - 1;
      this.currentCommand=currCommand;
      return commandList.get(currentCycleCommand);
    }
 else {
      currentCycleCommand=0;
      return commandList.get(0);
    }
  }
 else {
    if (currentCycleCommand == commandList.size() - 1) {
      this.currentCommand=currCommand;
    }
    return commandList.get(currentCycleCommand);
  }
}
Program: 36286
Project: 36286
Buggy source:
public void insertCommand(String cmd){
  resetCommandCycle();
  commandList.add(cmd);
  if (cmd.equals(CLEAR_COMMAND)) {
    previousClearLine=commandList.size();
  }
}

Fixed version (ground truth):
public void insertCommand(String cmd){
  resetCommandCycle();
  if (cmd != null && !cmd.isEmpty()) {
    commandList.add(cmd);
  }
  if (cmd.equals(CLEAR_COMMAND)) {
    previousClearLine=commandList.size();
  }
}
Program: 36287
Project: 36287
Buggy source:
public String getNextCommand(String currCommand){
  currentCycleCommand++;
  if (currentCycleCommand >= commandList.size()) {
    if (commandList.size() == 0) {
      currentCycleCommand=UNDEFINED_COMMAND_STEP;
      return "String_Node_Str";
    }
 else {
      currentCycleCommand=commandList.size();
      return currentCommand;
    }
  }
 else   if (currentCycleCommand == 0) {
    this.currentCommand=currCommand;
    currentCycleCommand=commandList.size();
    return currCommand;
  }
 else {
    return commandList.get(currentCycleCommand);
  }
}

Fixed version (ground truth):
public String getNextCommand(String currCommand){
  currentCycleCommand++;
  if (currentCycleCommand >= commandList.size()) {
    if (commandList.size() == 0) {
      currentCycleCommand=UNDEFINED_COMMAND_STEP;
      return "String_Node_Str";
    }
 else {
      if (currentCycleCommand > commandList.size()) {
        this.currentCommand=currCommand;
      }
      currentCycleCommand=commandList.size();
      return currentCommand;
    }
  }
 else   if (currentCycleCommand == 0) {
    this.currentCommand=currCommand;
    currentCycleCommand=commandList.size();
    return currCommand;
  }
 else {
    return commandList.get(currentCycleCommand);
  }
}