nus-yam/ex-repair huggingface dataset:
Program: 57757
Project: 57757
Buggy source:
/** 
 * 设置监听器
 */
private void setListener(){
  mHandler=new Handler(){
    public void handleMessage(    Message msg){
      String text=String.valueOf(msg.obj);
      mStatusText.setText(text);
      super.handleMessage(msg);
    }
  }
;
  mBrowerApkFileBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      IRootService rtService=getRTService();
      if (rtService != null) {
        showFileChooser();
      }
 else {
        Toast.makeText(MainActivity.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * 设置监听器
 */
private void setListener(){
  mHandler=new Handler(){
    public void handleMessage(    Message msg){
      String text=String.valueOf(msg.obj);
      mStatusText.append(text);
      super.handleMessage(msg);
    }
  }
;
  mBrowerApkFileBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      IRootService rtService=getRTService();
      if (rtService != null) {
        showFileChooser();
      }
 else {
        Toast.makeText(MainActivity.this,"String_Node_Str",Toast.LENGTH_SHORT).show();
      }
    }
  }
);
}
Program: 57758
Project: 57758
Buggy source:
private List<List<String>> splitList(List<String> input,int maxSize){
  List<List<String>> result=new ArrayList<List<String>>();
  List<String> currentList=new ArrayList<String>();
  for (  String item : input) {
    currentList.add(item);
    if (currentList.size() >= maxSize) {
      result.add(currentList);
      currentList=new ArrayList<String>();
    }
  }
  return result;
}

Fixed version (ground truth):
private List<List<String>> splitList(List<String> input,int maxSize){
  List<List<String>> result=new ArrayList<List<String>>();
  List<String> currentList=new ArrayList<String>();
  for (  String item : input) {
    currentList.add(item);
    if (currentList.size() >= maxSize) {
      result.add(currentList);
      currentList=new ArrayList<String>();
    }
  }
  if (currentList.size() > 0) {
    result.add(currentList);
  }
  return result;
}
Program: 57760
Project: 57760
Buggy source:
@Override public void didFail(SKRequest request,NSError error){
  log(LOGTYPEERROR,"String_Node_Str" + error.toString());
  log(LOGTYPELOG,"String_Node_Str" + transaction.getTransactionIdentifier());
  observer.handlePurchase(t);
  SKPaymentQueue.getDefaultQueue().finishTransaction(transaction);
}

Fixed version (ground truth):
@Override public void didFail(SKRequest request,NSError error){
  log(LOGTYPEERROR,"String_Node_Str" + error.toString());
  log(LOGTYPELOG,"String_Node_Str" + getOriginalTxID(transaction));
  observer.handlePurchase(t);
  SKPaymentQueue.getDefaultQueue().finishTransaction(transaction);
}
Program: 57761
Project: 57761
Buggy source:
@Override public void didFinish(SKRequest r){
  if (r.equals(request)) {
    NSURL receiptURL=NSBundle.getMainBundle().getAppStoreReceiptURL();
    NSData receipt=NSData.read(receiptURL);
    String encodedReceipt=receipt.toBase64EncodedString(NSDataBase64EncodingOptions.None);
    log(LOGTYPELOG,"String_Node_Str");
  }
 else {
    log(LOGTYPEERROR,"String_Node_Str");
  }
  log(LOGTYPELOG,"String_Node_Str" + transaction.getTransactionIdentifier());
  observer.handlePurchase(t);
  SKPaymentQueue.getDefaultQueue().finishTransaction(transaction);
}

Fixed version (ground truth):
@Override public void didFinish(SKRequest r){
  if (r.equals(request)) {
    NSURL receiptURL=NSBundle.getMainBundle().getAppStoreReceiptURL();
    NSData receipt=NSData.read(receiptURL);
    String encodedReceipt=receipt.toBase64EncodedString(NSDataBase64EncodingOptions.None);
    log(LOGTYPELOG,"String_Node_Str");
  }
 else {
    log(LOGTYPEERROR,"String_Node_Str");
  }
  log(LOGTYPELOG,"String_Node_Str" + getOriginalTxID(transaction));
  observer.handlePurchase(t);
  SKPaymentQueue.getDefaultQueue().finishTransaction(transaction);
}
Program: 57763
Project: 57763
Buggy source:
protected void setInformationFields(Transaction transaction,String productId){
  Information information=purchaseManager.getInformation(productId);
  Integer priceInCents=information.getPriceInCents();
  transaction.setPurchaseCost(priceInCents == null ? null : priceInCents);
  transaction.setPurchaseCostCurrency(information.getPriceCurrencyCode());
}

Fixed version (ground truth):
protected void setInformationFields(Transaction transaction,String productId){
  Information information=purchaseManager.getInformation(productId);
  Integer priceInCents=information.getPriceInCents();
  transaction.setPurchaseCost(priceInCents == null ? 0 : priceInCents);
  transaction.setPurchaseCostCurrency(information.getPriceCurrencyCode());
}
Program: 57764
Project: 57764
Buggy source:
public static Offer offerFullEditionEntitlement(){
  Offer offer=new Offer();
  offer.setIdentifier("String_Node_Str");
  offer.setType(OfferType.ENTITLEMENT);
  return offer;
}

Fixed version (ground truth):
public static Offer offerFullEditionEntitlement(){
  Offer offer=new Offer();
  offer.setIdentifier(PRODUCT_IDENTIFIER_FULL_EDITION);
  offer.setType(OfferType.ENTITLEMENT);
  return offer;
}
Program: 57765
Project: 57765
Buggy source:
public static Transaction transactionFullEditionEuroGooglePlay(){
  Transaction transaction=new Transaction();
  transaction.setPurchaseCostCurrency("String_Node_Str");
  transaction.setPurchaseCost(100);
  transaction.setStoreName(PurchaseManagerConfig.STORE_NAME_ANDROID_GOOGLE);
  transaction.setPurchaseTime(new Date());
  transaction.setIdentifier("String_Node_Str");
  transaction.setOrderId("String_Node_Str");
  return transaction;
}

Fixed version (ground truth):
public static Transaction transactionFullEditionEuroGooglePlay(){
  Transaction transaction=new Transaction();
  transaction.setPurchaseCostCurrency("String_Node_Str");
  transaction.setPurchaseCost(100);
  transaction.setStoreName(PurchaseManagerConfig.STORE_NAME_ANDROID_GOOGLE);
  transaction.setPurchaseTime(new Date());
  transaction.setIdentifier(PRODUCT_IDENTIFIER_FULL_EDITION);
  transaction.setOrderId("String_Node_Str");
  return transaction;
}
Program: 57766
Project: 57766
Buggy source:
/** 
 * @param activity The AndroidApplication activity.
 * @param requestCode The request code to use in case they are needed (not all stores need them). 
 */
public IAP(Activity activity,int requestCode){
  try {
    Class<?> ouyaClazz=Class.forName("String_Node_Str");
    Method method=ouyaClazz.getMethod("String_Node_Str");
    if ((Boolean)method.invoke(ouyaClazz)) {
      PurchaseSystem.setManager((PurchaseManager)ouyaClazz.getConstructor(Activity.class,int.class).newInstance(activity,requestCode));
      return;
    }
  }
 catch (  Exception e) {
    Log.d(TAG,"String_Node_Str",e);
  }
  try {
    Class<?> googlePlayClazz=Class.forName("String_Node_Str");
    Method method=googlePlayClazz.getMethod("String_Node_Str");
    if ((Boolean)method.invoke(googlePlayClazz,activity)) {
      PurchaseSystem.setManager((PurchaseManager)googlePlayClazz.getConstructor(Activity.class,int.class).newInstance(activity,requestCode));
      return;
    }
  }
 catch (  Exception e) {
    Log.d(TAG,"String_Node_Str",e);
  }
  try {
    Class<?> iabClazz=Class.forName("String_Node_Str");
    PurchaseSystem.setManager((PurchaseManager)iabClazz.getConstructor(Activity.class,int.class).newInstance(activity,requestCode));
  }
 catch (  Exception e) {
    Log.d(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * @param activity The AndroidApplication activity.
 * @param requestCode The request code to use in case they are needed (not all stores need them). 
 */
public IAP(Activity activity,int requestCode){
  try {
    Class<?> ouyaClazz=Class.forName("String_Node_Str");
    Method method=ouyaClazz.getMethod("String_Node_Str");
    if ((Boolean)method.invoke(ouyaClazz)) {
      PurchaseSystem.setManager((PurchaseManager)ouyaClazz.getConstructor(Activity.class,int.class).newInstance(activity,requestCode));
      return;
    }
  }
 catch (  Exception e) {
    Log.d(TAG,"String_Node_Str",e);
  }
  try {
    Class<?> googlePlayClazz=Class.forName("String_Node_Str");
    Method method=googlePlayClazz.getMethod("String_Node_Str",Activity.class);
    if ((Boolean)method.invoke(googlePlayClazz,activity)) {
      PurchaseSystem.setManager((PurchaseManager)googlePlayClazz.getConstructor(Activity.class,int.class).newInstance(activity,requestCode));
      return;
    }
  }
 catch (  Exception e) {
    Log.d(TAG,"String_Node_Str",e);
  }
  try {
    Class<?> iabClazz=Class.forName("String_Node_Str");
    PurchaseSystem.setManager((PurchaseManager)iabClazz.getConstructor(Activity.class,int.class).newInstance(activity,requestCode));
  }
 catch (  Exception e) {
    Log.d(TAG,"String_Node_Str",e);
  }
}
Program: 57768
Project: 57768
Buggy source:
void log(final int type,final String message){
  if (LOGDEBUG) {
    if (type == LOGTYPELOG)     System.out.println('[' + TAG + "String_Node_Str"+ message);
    if (type == LOGTYPEERROR)     System.err.println('[' + TAG + "String_Node_Str"+ message);
  }
}

Fixed version (ground truth):
void log(final int type,final String message,Throwable e){
  if (LOGDEBUG) {
    if (type == LOGTYPELOG)     System.out.println('[' + TAG + "String_Node_Str"+ message);
    if (type == LOGTYPEERROR)     System.err.println('[' + TAG + "String_Node_Str"+ message);
    if (e != null)     System.err.println('[' + TAG + "String_Node_Str"+ e);
  }
}
Program: 57769
Project: 57769
Buggy source:
@Override public void didFinish(SKRequest r){
  if (r.equals(request)) {
    NSURL receiptURL=NSBundle.getMainBundle().getAppStoreReceiptURL();
    NSData receipt=NSData.read(receiptURL);
    String encodedReceipt=receipt.toBase64EncodedString(NSDataBase64EncodingOptions.None);
    t.setTransactionDataSignature(encodedReceipt);
    log(LOGTYPELOG,"String_Node_Str");
  }
 else {
    log(LOGTYPEERROR,"String_Node_Str");
  }
  log(LOGTYPELOG,"String_Node_Str" + transaction.getTransactionIdentifier());
  observer.handlePurchase(t);
  SKPaymentQueue.getDefaultQueue().finishTransaction(transaction);
}

Fixed version (ground truth):
@Override public void didFinish(SKRequest r){
  if (r.equals(request)) {
    NSURL receiptURL=NSBundle.getMainBundle().getAppStoreReceiptURL();
    NSData receipt=NSData.read(receiptURL);
    String encodedReceipt=receipt.toBase64EncodedString(NSDataBase64EncodingOptions.None);
    log(LOGTYPELOG,"String_Node_Str");
  }
 else {
    log(LOGTYPEERROR,"String_Node_Str");
  }
  log(LOGTYPELOG,"String_Node_Str" + transaction.getTransactionIdentifier());
  observer.handlePurchase(t);
  SKPaymentQueue.getDefaultQueue().finishTransaction(transaction);
}
Program: 57770
Project: 57770
Buggy source:
@Override public String toString(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return PurchaseManagerConfig.STORE_NAME_IOS_APPLE;
}
Program: 57772
Project: 57772
Buggy source:
/** 
 * Converts a purchase to our transaction object. 
 */
Transaction transaction(Purchase purchase){
  SkuDetails skuDetails=inventory.getSkuDetails(purchase.getSku());
  Transaction transaction=new Transaction();
  transaction.setIdentifier(purchase.getSku());
  transaction.setStoreName(storeNameFromOpenIAB(purchase.getAppstoreName()));
  transaction.setOrderId(purchase.getOrderId());
  transaction.setPurchaseTime(new Date(purchase.getPurchaseTime()));
  transaction.setPurchaseText(skuDetails != null ? "String_Node_Str" + skuDetails.getTitle() : "String_Node_Str");
  transaction.setPurchaseCost(-1);
  transaction.setPurchaseCostCurrency(null);
  if (purchase.getPurchaseState() != 0) {
    transaction.setReversalTime(new Date());
    transaction.setReversalText(purchase.getPurchaseState() == 1 ? "String_Node_Str" : "String_Node_Str");
  }
 else {
    transaction.setReversalTime(null);
    transaction.setReversalText(null);
  }
  transaction.setTransactionData(purchase.getOriginalJson());
  transaction.setTransactionDataSignature(purchase.getSignature());
  return transaction;
}

Fixed version (ground truth):
/** 
 * Converts a purchase to our transaction object. 
 */
Transaction transaction(Purchase purchase){
  SkuDetails skuDetails=inventory.getSkuDetails(purchase.getSku());
  Transaction transaction=new Transaction();
  transaction.setIdentifier(purchase.getSku());
  transaction.setStoreName(storeNameFromOpenIAB(purchase.getAppstoreName()));
  transaction.setOrderId(purchase.getOrderId());
  transaction.setPurchaseTime(new Date(purchase.getPurchaseTime()));
  transaction.setPurchaseText((skuDetails != null ? "String_Node_Str" + skuDetails.getTitle() + "String_Node_Str"+ skuDetails.getPrice()+ "String_Node_Str"+ skuDetails.getDescription() : "String_Node_Str"));
  transaction.setPurchaseCost(-1);
  transaction.setPurchaseCostCurrency(null);
  if (purchase.getPurchaseState() != 0) {
    transaction.setReversalTime(new Date());
    transaction.setReversalText(purchase.getPurchaseState() == 1 ? "String_Node_Str" : "String_Node_Str");
  }
 else {
    transaction.setReversalTime(null);
    transaction.setReversalText(null);
  }
  transaction.setTransactionData(purchase.getOriginalJson());
  transaction.setTransactionDataSignature(purchase.getSignature());
  return transaction;
}
Program: 57773
Project: 57773
Buggy source:
/** 
 * Converts a product to our transaction object. 
 */
Transaction convertPurchasedProductToTransaction(Product product){
  Transaction transaction=new Transaction();
  transaction.setIdentifier(product.getIdentifier());
  transaction.setStoreName(storeName());
  transaction.setPurchaseTime(new Date());
  showMessage(LOGTYPELOG,"String_Node_Str");
  return transaction;
}

Fixed version (ground truth):
/** 
 * Converts a product to our transaction object. 
 */
Transaction convertPurchasedProductToTransaction(Product product){
  Transaction transaction=new Transaction();
  transaction.setIdentifier(config.getOfferForStore(PurchaseManagerConfig.STORE_NAME_ANDROID_OUYA,product.getIdentifier()).getIdentifier());
  transaction.setStoreName(storeName());
  transaction.setPurchaseTime(new Date());
  transaction.setPurchaseText("String_Node_Str" + product.getFormattedPrice() + "String_Node_Str");
  transaction.setPurchaseCost(product.getPriceInCents());
  transaction.setPurchaseCostCurrency(product.getCurrencyCode());
  transaction.setReversalTime(null);
  transaction.setReversalText(null);
  transaction.setTransactionData(null);
  transaction.setTransactionDataSignature(null);
  showMessage(LOGTYPELOG,"String_Node_Str");
  return transaction;
}
Program: 57774
Project: 57774
Buggy source:
/** 
 * make a purchase 
 */
@Override public void purchase(String identifier){
  OUYApurchaseProduct=getProduct(identifier);
  if (OUYApurchaseProduct != null) {
    try {
      requestPurchase(OUYApurchaseProduct);
      handler.sendEmptyMessage(requestOUYApurchase);
    }
 catch (    UnsupportedEncodingException e) {
      observer.handlePurchaseError(e);
      e.printStackTrace();
    }
catch (    GeneralSecurityException e) {
      observer.handlePurchaseError(e);
      e.printStackTrace();
    }
catch (    JSONException e) {
      observer.handlePurchaseError(e);
      e.printStackTrace();
    }
  }
 else {
    showMessage(LOGTYPEERROR,"String_Node_Str");
    observer.handlePurchaseError(new RuntimeException("String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * make a purchase 
 */
@Override public void purchase(String identifier){
  OUYApurchaseProduct=getProduct(config.getOffer(identifier).getIdentifierForStore(PurchaseManagerConfig.STORE_NAME_ANDROID_OUYA));
  if (OUYApurchaseProduct != null) {
    try {
      requestPurchase(OUYApurchaseProduct);
      handler.sendEmptyMessage(requestOUYApurchase);
    }
 catch (    UnsupportedEncodingException e) {
      observer.handlePurchaseError(e);
      e.printStackTrace();
    }
catch (    GeneralSecurityException e) {
      observer.handlePurchaseError(e);
      e.printStackTrace();
    }
catch (    JSONException e) {
      observer.handlePurchaseError(e);
      e.printStackTrace();
    }
  }
 else {
    showMessage(LOGTYPEERROR,"String_Node_Str");
    observer.handlePurchaseError(new RuntimeException("String_Node_Str"));
  }
}
Program: 57775
Project: 57775
Buggy source:
/** 
 * Converts a purchase to our transaction object. 
 */
Transaction convertToTransaction(Receipt receipt){
  Transaction transaction=new Transaction();
  transaction.setIdentifier(receipt.getIdentifier());
  transaction.setStoreName(storeName());
  transaction.setPurchaseTime(receipt.getPurchaseDate());
  showMessage(LOGTYPELOG,"String_Node_Str");
  return transaction;
}

Fixed version (ground truth):
/** 
 * Converts a purchase to our transaction object. 
 */
Transaction convertToTransaction(Receipt receipt){
  Transaction transaction=new Transaction();
  transaction.setIdentifier(config.getOfferForStore(PurchaseManagerConfig.STORE_NAME_ANDROID_OUYA,receipt.getIdentifier()).getIdentifier());
  transaction.setStoreName(storeName());
  transaction.setPurchaseTime(receipt.getPurchaseDate());
  transaction.setPurchaseText("String_Node_Str" + receipt.getGamer() + "String_Node_Str"+ receipt.getFormattedPrice()+ "String_Node_Str");
  transaction.setPurchaseCost(receipt.getPriceInCents());
  transaction.setPurchaseCostCurrency(receipt.getCurrency());
  transaction.setReversalTime(null);
  transaction.setReversalText(null);
  transaction.setTransactionData(null);
  transaction.setTransactionDataSignature(null);
  showMessage(LOGTYPELOG,"String_Node_Str");
  return transaction;
}
Program: 57776
Project: 57776
Buggy source:
@Override public void install(final PurchaseObserver observer,PurchaseManagerConfig config){
  this.observer=observer;
  this.config=config;
  Object[] configuration=(Object[])config.getStoreParam(PurchaseManagerConfig.STORE_NAME_ANDROID_OUYA);
  String developerID=(String)configuration[0];
  applicationKeyPath=(String)configuration[1];
  ouyaFacade=OuyaFacade.getInstance();
  ouyaFacade.init((Context)activity,developerID);
  productIDList=new ArrayList<Purchasable>(config.getOfferCount());
  for (int i=0; i < config.getOfferCount(); i++) {
    productIDList.add(new Purchasable(config.getOffer(i).getIdentifier()));
  }
  try {
    FileHandle fHandle=Gdx.files.internal(applicationKeyPath);
    byte[] applicationKey=fHandle.readBytes();
    X509EncodedKeySpec keySpec=new X509EncodedKeySpec(applicationKey);
    KeyFactory keyFactory=KeyFactory.getInstance("String_Node_Str");
    ouyaPublicKey=keyFactory.generatePublic(keySpec);
    showMessage(LOGTYPELOG,"String_Node_Str");
    requestProductList();
    observer.handleInstall();
  }
 catch (  Exception e) {
    showMessage(LOGTYPEERROR,"String_Node_Str");
    observer.handleInstallError(new RuntimeException("String_Node_Str" + e));
  }
}

Fixed version (ground truth):
@Override public void install(final PurchaseObserver observer,PurchaseManagerConfig config){
  this.observer=observer;
  this.config=config;
  Object[] configuration=(Object[])config.getStoreParam(PurchaseManagerConfig.STORE_NAME_ANDROID_OUYA);
  String developerID=(String)configuration[0];
  applicationKeyPath=(String)configuration[1];
  ouyaFacade=OuyaFacade.getInstance();
  ouyaFacade.init((Context)activity,developerID);
  productIDList=new ArrayList<Purchasable>(config.getOfferCount());
  for (int i=0; i < config.getOfferCount(); i++) {
    productIDList.add(new Purchasable(config.getOffer(i).getIdentifierForStore(PurchaseManagerConfig.STORE_NAME_ANDROID_OUYA)));
  }
  try {
    FileHandle fHandle=Gdx.files.internal(applicationKeyPath);
    byte[] applicationKey=fHandle.readBytes();
    X509EncodedKeySpec keySpec=new X509EncodedKeySpec(applicationKey);
    KeyFactory keyFactory=KeyFactory.getInstance("String_Node_Str");
    ouyaPublicKey=keyFactory.generatePublic(keySpec);
    showMessage(LOGTYPELOG,"String_Node_Str");
    requestProductList();
    observer.handleInstall();
  }
 catch (  Exception e) {
    showMessage(LOGTYPEERROR,"String_Node_Str");
    observer.handleInstallError(new RuntimeException("String_Node_Str" + e));
  }
}
Program: 57777
Project: 57777
Buggy source:
@Override public void purchase(String identifier){
  log(LOGTYPELOG,"String_Node_Str" + identifier + "String_Node_Str");
  SKProduct product=getProductById(identifier);
  if (product == null) {
    log(LOGTYPEERROR,"String_Node_Str" + identifier + "String_Node_Str");
    observer.handlePurchaseError(new RuntimeException("String_Node_Str" + identifier + "String_Node_Str"));
  }
  SKPayment payment=SKPayment.createFromProduct(product);
  SKPaymentQueue.getDefaultQueue().addPayment(payment);
}

Fixed version (ground truth):
@Override public void purchase(String identifier){
  log(LOGTYPELOG,"String_Node_Str" + identifier + "String_Node_Str");
  SKProduct product=getProductById(config.getOffer(identifier).getIdentifierForStore(PurchaseManagerConfig.STORE_NAME_IOS_APPLE));
  if (product == null) {
    log(LOGTYPEERROR,"String_Node_Str" + identifier + "String_Node_Str");
    observer.handlePurchaseError(new RuntimeException("String_Node_Str" + identifier + "String_Node_Str"));
  }
  SKPayment payment=SKPayment.createFromProduct(product);
  SKPaymentQueue.getDefaultQueue().addPayment(payment);
}
Program: 57778
Project: 57778
Buggy source:
@Override public void install(PurchaseObserver observer,PurchaseManagerConfig config){
  this.observer=observer;
  this.config=config;
  log(LOGTYPELOG,"String_Node_Str");
  if (SKPaymentQueue.canMakePayments()) {
    Set<String> productIdentifiers=new HashSet<String>();
    int size=config.getOfferCount();
    for (int i=0; i < size; i++) {
      productIdentifiers.add(config.getOffer(i).getIdentifier());
    }
    log(LOGTYPELOG,"String_Node_Str");
    productsRequest=new SKProductsRequest(productIdentifiers);
    productsRequest.setDelegate(new AppleProductsDelegate());
    productsRequest.start();
  }
 else {
    log(LOGTYPEERROR,"String_Node_Str");
    observer.handleInstallError(new RuntimeException("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void install(PurchaseObserver observer,PurchaseManagerConfig config){
  this.observer=observer;
  this.config=config;
  log(LOGTYPELOG,"String_Node_Str");
  if (SKPaymentQueue.canMakePayments()) {
    Set<String> productIdentifiers=new HashSet<String>();
    int size=config.getOfferCount();
    for (int i=0; i < size; i++) {
      productIdentifiers.add(config.getOffer(i).getIdentifierForStore(PurchaseManagerConfig.STORE_NAME_IOS_APPLE));
    }
    log(LOGTYPELOG,"String_Node_Str");
    productsRequest=new SKProductsRequest(productIdentifiers);
    productsRequest.setDelegate(new AppleProductsDelegate());
    productsRequest.start();
  }
 else {
    log(LOGTYPEERROR,"String_Node_Str");
    observer.handleInstallError(new RuntimeException("String_Node_Str"));
  }
}
Program: 57779
Project: 57779
Buggy source:
/** 
 * Converts a purchase to our transaction object. 
 */
Transaction transaction(SKPaymentTransaction t){
  SKPayment payment=t.getPayment();
  SKProduct product=getProductById(payment.getProductIdentifier());
  final Transaction transaction=new Transaction();
  transaction.setIdentifier(product.getProductIdentifier());
  transaction.setStoreName(PurchaseManagerConfig.STORE_NAME_IOS_APPLE);
  transaction.setOrderId(t.getTransactionIdentifier());
  transaction.setPurchaseTime(t.getTransactionDate().toDate());
  transaction.setPurchaseText("String_Node_Str" + product.getLocalizedTitle());
  transaction.setPurchaseCost((int)(product.getPrice().doubleValue() * 100));
  transaction.setPurchaseCostCurrency(product.getPriceLocale().getCurrencyCode());
  if (payment.getRequestData() != null) {
    transaction.setTransactionData(payment.getRequestData().toBase64EncodedString(NSDataBase64EncodingOptions.None));
  }
  return transaction;
}

Fixed version (ground truth):
/** 
 * Converts a purchase to our transaction object. 
 */
Transaction transaction(SKPaymentTransaction t){
  SKPayment payment=t.getPayment();
  SKProduct product=getProductById(payment.getProductIdentifier());
  Transaction transaction=new Transaction();
  transaction.setIdentifier(config.getOfferForStore(PurchaseManagerConfig.STORE_NAME_IOS_APPLE,payment.getProductIdentifier()).getIdentifier());
  transaction.setStoreName(PurchaseManagerConfig.STORE_NAME_IOS_APPLE);
  transaction.setOrderId(t.getTransactionIdentifier());
  transaction.setPurchaseTime(t.getTransactionDate().toDate());
  transaction.setPurchaseText("String_Node_Str" + product.getLocalizedTitle());
  transaction.setPurchaseCost((int)Math.round(product.getPrice().doubleValue() * 100));
  transaction.setPurchaseCostCurrency(product.getPriceLocale().getCurrencyCode());
  transaction.setReversalTime(null);
  transaction.setReversalText(null);
  if (payment.getRequestData() != null) {
    transaction.setTransactionData(payment.getRequestData().toBase64EncodedString(NSDataBase64EncodingOptions.None));
  }
 else {
    transaction.setTransactionData(null);
  }
  transaction.setTransactionDataSignature(null);
  return transaction;
}
Program: 57780
Project: 57780
Buggy source:
@Override public void dispose(){
  if (PurchaseSystem.hasManager())   PurchaseSystem.dispose();
  if (observer != null) {
    observer=null;
    config=null;
    showMessage(LOGTYPELOG,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void dispose(){
  if (observer != null) {
    observer=null;
    config=null;
    showMessage(LOGTYPELOG,"String_Node_Str");
  }
}
Program: 57782
Project: 57782
Buggy source:
@Override public void didFail(SKRequest request,NSError error){
  observer.handleInstallError(new RuntimeException("String_Node_Str" + (error != null ? error.toString() : "String_Node_Str")));
}

Fixed version (ground truth):
@Override public void didFail(SKRequest request,NSError error){
  log(LOGTYPEERROR,"String_Node_Str" + error.toString());
  log(LOGTYPELOG,"String_Node_Str" + transaction.getTransactionIdentifier());
  observer.handlePurchase(t);
  SKPaymentQueue.getDefaultQueue().finishTransaction(transaction);
}
Program: 57783
Project: 57783
Buggy source:
@Override public void didReceiveResponse(SKProductsRequest request,SKProductsResponse response){
  products=response.getProducts();
  observer.handleInstall();
}

Fixed version (ground truth):
@Override public void didReceiveResponse(SKProductsRequest request,SKProductsResponse response){
  products=response.getProducts();
  appleObserver=new AppleTransactionObserver();
  SKPaymentQueue.getDefaultQueue().addTransactionObserver(appleObserver);
  log(LOGTYPELOG,"String_Node_Str");
  log(LOGTYPELOG,"String_Node_Str");
  observer.handleInstall();
}
Program: 57784
Project: 57784
Buggy source:
@Override public void restoreCompletedTransactionsFailed(SKPaymentQueue queue,NSError error){
  if (error.getCode() == SKErrorCode.PaymentCancelled.value()) {
    observer.handleRestoreError(new RuntimeException("String_Node_Str"));
  }
 else {
    observer.handleRestoreError(new RuntimeException("String_Node_Str" + error.toString()));
  }
}

Fixed version (ground truth):
@Override public void restoreCompletedTransactionsFailed(SKPaymentQueue queue,NSError error){
  if (error.getCode() == SKErrorCode.PaymentCancelled.value()) {
    log(LOGTYPEERROR,"String_Node_Str");
    observer.handleRestoreError(new RuntimeException("String_Node_Str"));
  }
 else {
    log(LOGTYPEERROR,"String_Node_Str" + error.toString());
    observer.handleRestoreError(new RuntimeException("String_Node_Str" + error.toString()));
  }
}
Program: 57785
Project: 57785
Buggy source:
@Override public void didFinish(SKRequest r){
  if (r.equals(request)) {
    NSURL receiptURL=NSBundle.getMainBundle().getAppStoreReceiptURL();
    NSData receipt=NSData.read(receiptURL);
    String encodedReceipt=receipt.toBase64EncodedString(NSDataBase64EncodingOptions.None);
    transaction.setTransactionDataSignature(encodedReceipt);
  }
}

Fixed version (ground truth):
@Override public void didFinish(SKRequest r){
  if (r.equals(request)) {
    NSURL receiptURL=NSBundle.getMainBundle().getAppStoreReceiptURL();
    NSData receipt=NSData.read(receiptURL);
    String encodedReceipt=receipt.toBase64EncodedString(NSDataBase64EncodingOptions.None);
    t.setTransactionDataSignature(encodedReceipt);
    log(LOGTYPELOG,"String_Node_Str");
  }
 else {
    log(LOGTYPEERROR,"String_Node_Str");
  }
  log(LOGTYPELOG,"String_Node_Str" + transaction.getTransactionIdentifier());
  observer.handlePurchase(t);
  SKPaymentQueue.getDefaultQueue().finishTransaction(transaction);
}
Program: 57786
Project: 57786
Buggy source:
@Override public void purchase(String identifier){
  SKProduct product=getProductById(identifier);
  if (product == null) {
    observer.handlePurchaseError(new RuntimeException("String_Node_Str" + identifier + "String_Node_Str"));
  }
  SKPayment payment=SKPayment.createFromProduct(product);
  SKPaymentQueue.getDefaultQueue().addPayment(payment);
}

Fixed version (ground truth):
@Override public void purchase(String identifier){
  log(LOGTYPELOG,"String_Node_Str" + identifier + "String_Node_Str");
  SKProduct product=getProductById(identifier);
  if (product == null) {
    log(LOGTYPEERROR,"String_Node_Str" + identifier + "String_Node_Str");
    observer.handlePurchaseError(new RuntimeException("String_Node_Str" + identifier + "String_Node_Str"));
  }
  SKPayment payment=SKPayment.createFromProduct(product);
  SKPaymentQueue.getDefaultQueue().addPayment(payment);
}
Program: 57787
Project: 57787
Buggy source:
@Override public void restoreCompletedTransactionsFinished(SKPaymentQueue queue){
  observer.handleRestore(restoredTransactions.toArray(new Transaction[restoredTransactions.size()]));
}

Fixed version (ground truth):
@Override public void restoreCompletedTransactionsFinished(SKPaymentQueue queue){
  log(LOGTYPELOG,"String_Node_Str");
  observer.handleRestore(restoredTransactions.toArray(new Transaction[restoredTransactions.size()]));
  restoredTransactions.clear();
}
Program: 57788
Project: 57788
Buggy source:
@Override public void install(PurchaseObserver observer,PurchaseManagerConfig config){
  this.observer=observer;
  this.config=config;
  if (SKPaymentQueue.canMakePayments()) {
    appleObserver=new AppleTransactionObserver();
    SKPaymentQueue.getDefaultQueue().addTransactionObserver(appleObserver);
    Set<String> productIdentifiers=new HashSet<String>();
    int size=config.getOfferCount();
    for (int i=0; i < size; i++) {
      productIdentifiers.add(config.getOffer(i).getIdentifier());
    }
    productsRequest=new SKProductsRequest(productIdentifiers);
    productsRequest.setDelegate(new AppleProductsDelegate());
    productsRequest.start();
  }
 else {
    observer.handleInstallError(new RuntimeException("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void install(PurchaseObserver observer,PurchaseManagerConfig config){
  this.observer=observer;
  this.config=config;
  log(LOGTYPELOG,"String_Node_Str");
  if (SKPaymentQueue.canMakePayments()) {
    Set<String> productIdentifiers=new HashSet<String>();
    int size=config.getOfferCount();
    for (int i=0; i < size; i++) {
      productIdentifiers.add(config.getOffer(i).getIdentifier());
    }
    log(LOGTYPELOG,"String_Node_Str");
    productsRequest=new SKProductsRequest(productIdentifiers);
    productsRequest.setDelegate(new AppleProductsDelegate());
    productsRequest.start();
  }
 else {
    log(LOGTYPEERROR,"String_Node_Str");
    observer.handleInstallError(new RuntimeException("String_Node_Str"));
  }
}
Program: 57789
Project: 57789
Buggy source:
@Override public void purchaseRestore(){
  restoredTransactions.clear();
  SKPaymentQueue.getDefaultQueue().restoreCompletedTransactions();
}

Fixed version (ground truth):
@Override public void purchaseRestore(){
  log(LOGTYPELOG,"String_Node_Str");
  restoredTransactions.clear();
  SKPaymentQueue.getDefaultQueue().restoreCompletedTransactions();
}
Program: 57790
Project: 57790
Buggy source:
@Override public void dispose(){
  if (appleObserver != null) {
    SKPaymentQueue.getDefaultQueue().removeTransactionObserver(appleObserver);
    appleObserver=null;
    productsRequest=null;
    products=null;
    restoredTransactions.clear();
    observer=null;
    config=null;
  }
}

Fixed version (ground truth):
@Override public void dispose(){
  if (appleObserver != null) {
    SKPaymentQueue.getDefaultQueue().removeTransactionObserver(appleObserver);
    appleObserver=null;
    productsRequest=null;
    products=null;
    restoredTransactions.clear();
    observer=null;
    config=null;
    log(LOGTYPELOG,"String_Node_Str");
  }
}
Program: 57791
Project: 57791
Buggy source:
/** 
 * Converts a purchase to our transaction object. 
 */
Transaction transaction(SKPaymentTransaction t){
  SKPayment payment=t.getPayment();
  SKProduct product=getProductById(payment.getProductIdentifier());
  final Transaction transaction=new Transaction();
  transaction.setIdentifier(product.getProductIdentifier());
  transaction.setStoreName(PurchaseManagerConfig.STORE_NAME_IOS_APPLE);
  transaction.setOrderId(t.getTransactionIdentifier());
  transaction.setPurchaseTime(t.getTransactionDate().toDate());
  transaction.setPurchaseText("String_Node_Str" + product.getLocalizedTitle());
  transaction.setPurchaseCost((int)(product.getPrice().doubleValue() * 100));
  transaction.setPurchaseCostCurrency(product.getPriceLocale().getCurrencyCode());
  transaction.setTransactionData(payment.getRequestData().toBase64EncodedString(NSDataBase64EncodingOptions.None));
  if (Foundation.getMajorSystemVersion() >= 7) {
    NSURL receiptURL=NSBundle.getMainBundle().getAppStoreReceiptURL();
    NSData receipt=NSData.read(receiptURL);
    if (receipt == null) {
      final SKReceiptRefreshRequest request=new SKReceiptRefreshRequest();
      request.setDelegate(new SKRequestDelegateAdapter(){
        @Override public void didFinish(        SKRequest r){
          if (r.equals(request)) {
            NSURL receiptURL=NSBundle.getMainBundle().getAppStoreReceiptURL();
            NSData receipt=NSData.read(receiptURL);
            String encodedReceipt=receipt.toBase64EncodedString(NSDataBase64EncodingOptions.None);
            transaction.setTransactionDataSignature(encodedReceipt);
          }
        }
        @Override public void didFail(        SKRequest request,        NSError error){
        }
      }
);
      request.start();
    }
 else {
      String encodedReceipt=receipt.toBase64EncodedString(NSDataBase64EncodingOptions.None);
      transaction.setTransactionDataSignature(encodedReceipt);
    }
  }
 else {
    transaction.setTransactionDataSignature(t.getTransactionReceipt().toBase64EncodedString(NSDataBase64EncodingOptions.None));
  }
  return transaction;
}

Fixed version (ground truth):
/** 
 * Converts a purchase to our transaction object. 
 */
Transaction transaction(SKPaymentTransaction t){
  SKPayment payment=t.getPayment();
  SKProduct product=getProductById(payment.getProductIdentifier());
  final Transaction transaction=new Transaction();
  transaction.setIdentifier(product.getProductIdentifier());
  transaction.setStoreName(PurchaseManagerConfig.STORE_NAME_IOS_APPLE);
  transaction.setOrderId(t.getTransactionIdentifier());
  transaction.setPurchaseTime(t.getTransactionDate().toDate());
  transaction.setPurchaseText("String_Node_Str" + product.getLocalizedTitle());
  transaction.setPurchaseCost((int)(product.getPrice().doubleValue() * 100));
  transaction.setPurchaseCostCurrency(product.getPriceLocale().getCurrencyCode());
  if (payment.getRequestData() != null) {
    transaction.setTransactionData(payment.getRequestData().toBase64EncodedString(NSDataBase64EncodingOptions.None));
  }
  return transaction;
}
Program: 57792
Project: 57792
Buggy source:
@Override public void handlePurchaseCanceled(){
}

Fixed version (ground truth):
@Override public void handlePurchaseCanceled(){
  message("String_Node_Str");
  Gdx.app.postRunnable(new Runnable(){
    @Override public void run(){
      message("String_Node_Str");
      PurchaseSystem.dispose();
      message("String_Node_Str");
    }
  }
);
}
Program: 57794
Project: 57794
Buggy source:
/** 
 * Returns the registered manager or null for none. 
 */
public static PurchaseManager getManager(){
  return manager;
}

Fixed version (ground truth):
/** 
 * Returns the registered manager or null for none. 
 */
public static PurchaseManager getManager(){
  if (manager == null) {
    resolve();
  }
  return manager;
}
Program: 57795
Project: 57795
Buggy source:
/** 
 * Returns true if the purchase system is installed and ready to go. 
 */
public static boolean installed(){
  if (manager != null) {
    return manager.installed();
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Returns true if the purchase system is installed and ready to go. 
 */
public static boolean installed(){
  if (hasManager()) {
    return manager.installed();
  }
 else {
    return false;
  }
}
Program: 57796
Project: 57796
Buggy source:
/** 
 * Installs a purchase observer. 
 */
public static void install(PurchaseObserver observer,PurchaseManagerConfig config){
  if (manager != null) {
    manager.install(observer,config);
  }
 else {
    observer.handleInstallError(new RuntimeException("String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * Installs a purchase observer. 
 */
public static void install(PurchaseObserver observer,PurchaseManagerConfig config){
  if (hasManager()) {
    manager.install(observer,config);
  }
 else {
    observer.handleInstallError(new RuntimeException("String_Node_Str"));
  }
}
Program: 57797
Project: 57797
Buggy source:
/** 
 * Asks to restore previous purchases. Results are returned to the observer. 
 */
public static void purchaseRestore(){
  if (manager != null) {
    manager.purchaseRestore();
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Asks to restore previous purchases. Results are returned to the observer. 
 */
public static void purchaseRestore(){
  if (hasManager()) {
    manager.purchaseRestore();
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 57798
Project: 57798
Buggy source:
/** 
 * Executes a purchase. 
 */
public static void purchase(String identifier){
  if (manager != null) {
    manager.purchase(identifier);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Executes a purchase. 
 */
public static void purchase(String identifier){
  if (hasManager()) {
    manager.purchase(identifier);
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 57799
Project: 57799
Buggy source:
/** 
 * Returns the store name or null for none. 
 */
public static String storeName(){
  if (manager != null) {
    return manager.storeName();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the store name or null for none. 
 */
public static String storeName(){
  if (hasManager()) {
    return manager.storeName();
  }
 else {
    return null;
  }
}
Program: 57800
Project: 57800
Buggy source:
/** 
 * Disposes the purchase manager if there was one. 
 */
public static void dispose(){
  if (manager != null) {
    manager.dispose();
    manager=null;
  }
}

Fixed version (ground truth):
/** 
 * Disposes the purchase manager if there was one. 
 */
public static void dispose(){
  if (hasManager()) {
    manager.dispose();
    manager=null;
  }
}
Program: 57801
Project: 57801
Buggy source:
/** 
 * Returns true if there is a purchase manager available. 
 */
public static boolean hasManager(){
  return manager != null;
}

Fixed version (ground truth):
/** 
 * Returns true if there is a purchase manager available. 
 */
public static boolean hasManager(){
  return getManager() != null;
}
Program: 57802
Project: 57802
Buggy source:
/** 
 * The IV is produced by adding the initial IV to the counter. IV length  should be the same as   {@link #AES_BLOCK_SIZE}
 */
@Override public void calculateIV(byte[] initIV,long counter,byte[] IV){
  Preconditions.checkArgument(initIV.length == AES_BLOCK_SIZE);
  Preconditions.checkArgument(IV.length == AES_BLOCK_SIZE);
  System.arraycopy(initIV,0,IV,0,CTR_OFFSET);
  long l=(initIV[CTR_OFFSET + 0] << 56) + ((initIV[CTR_OFFSET + 1] & 0xFF) << 48) + ((initIV[CTR_OFFSET + 2] & 0xFF) << 40)+ ((initIV[CTR_OFFSET + 3] & 0xFF) << 32)+ ((initIV[CTR_OFFSET + 4] & 0xFF) << 24)+ ((initIV[CTR_OFFSET + 5] & 0xFF) << 16)+ ((initIV[CTR_OFFSET + 6] & 0xFF) << 8)+ (initIV[CTR_OFFSET + 7] & 0xFF);
  l+=counter;
  IV[CTR_OFFSET + 0]=(byte)(l >>> 56);
  IV[CTR_OFFSET + 1]=(byte)(l >>> 48);
  IV[CTR_OFFSET + 2]=(byte)(l >>> 40);
  IV[CTR_OFFSET + 3]=(byte)(l >>> 32);
  IV[CTR_OFFSET + 4]=(byte)(l >>> 24);
  IV[CTR_OFFSET + 5]=(byte)(l >>> 16);
  IV[CTR_OFFSET + 6]=(byte)(l >>> 8);
  IV[CTR_OFFSET + 7]=(byte)(l);
}

Fixed version (ground truth):
/** 
 * The IV is produced by adding the initial IV to the counter. IV length  should be the same as   {@link #AES_BLOCK_SIZE}
 */
@Override public void calculateIV(byte[] initIV,long counter,byte[] IV){
  Preconditions.checkArgument(initIV.length == AES_BLOCK_SIZE);
  Preconditions.checkArgument(IV.length == AES_BLOCK_SIZE);
  System.arraycopy(initIV,0,IV,0,CTR_OFFSET);
  long l=0;
  for (int i=0; i < 8; i++) {
    l=((l << 8) | (initIV[CTR_OFFSET + i] & 0xff));
  }
  l+=counter;
  IV[CTR_OFFSET + 0]=(byte)(l >>> 56);
  IV[CTR_OFFSET + 1]=(byte)(l >>> 48);
  IV[CTR_OFFSET + 2]=(byte)(l >>> 40);
  IV[CTR_OFFSET + 3]=(byte)(l >>> 32);
  IV[CTR_OFFSET + 4]=(byte)(l >>> 24);
  IV[CTR_OFFSET + 5]=(byte)(l >>> 16);
  IV[CTR_OFFSET + 6]=(byte)(l >>> 8);
  IV[CTR_OFFSET + 7]=(byte)(l);
}
Program: 57803
Project: 57803
Buggy source:
@Override synchronized protected int next(int nbits){
  fillReservoir(4);
  int n=reservoir[pos] | (reservoir[pos + 1] << 8) | (reservoir[pos + 2] << 16)| (reservoir[pos + 3] << 24);
  pos+=4;
  return n & (0xffffffff >> (32 - nbits));
}

Fixed version (ground truth):
@Override synchronized protected int next(int nbits){
  fillReservoir(4);
  int n=0;
  for (int i=0; i < 4; i++) {
    n=((n << 8) | (reservoir[pos++] & 0xff));
  }
  return n & (0xffffffff >> (32 - nbits));
}
Program: 57804
Project: 57804
Buggy source:
@Override public Configuration getConf(){
  return conf;
}

Fixed version (ground truth):
@Override synchronized public Configuration getConf(){
  return conf;
}
Program: 57805
Project: 57805
Buggy source:
@Override public void close() throws IOException {
  stream.close();
}

Fixed version (ground truth):
@Override synchronized public void close() throws IOException {
  stream.close();
}
Program: 57806
Project: 57806
Buggy source:
@Override public void setConf(Configuration conf){
  this.conf=conf;
  this.randomDevPath=conf.get(HADOOP_SECURITY_SECURE_RANDOM_DEVICE_FILE_PATH_KEY,HADOOP_SECURITY_SECURE_RANDOM_DEVICE_FILE_PATH_DEFAULT);
  File randomDevFile=new File(randomDevPath);
  try {
    this.stream=new FileInputStream(randomDevFile);
    fillReservoir(0);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override synchronized public void setConf(Configuration conf){
  this.conf=conf;
  this.randomDevPath=conf.get(HADOOP_SECURITY_SECURE_RANDOM_DEVICE_FILE_PATH_KEY,HADOOP_SECURITY_SECURE_RANDOM_DEVICE_FILE_PATH_DEFAULT);
  File randomDevFile=new File(randomDevPath);
  try {
    this.stream=new FileInputStream(randomDevFile);
    fillReservoir(0);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 57807
Project: 57807
Buggy source:
/** 
 * Remove xattr of a file or directory.Value in xAttr parameter is ignored. <<<<<<< .working Name must be prefixed with user/trusted/security/system/raw. ======= The name must be prefixed with the namespace followed by ".". For example, "user.attr". >>>>>>> .merge-right.r1614550 <p/> <<<<<<< .working A regular user only can remove xattr of "user" namespace. A super user can remove xattr of "user" and "trusted" namespace. XAttr of "security" and "system" namespace is only used/exposed  internally to the FS impl. The xattrs of the "raw" namespace are only used/exposed when accessed in the /.reserved/raw HDFS directory hierarchy. These attributes can only be accessed by the superuser. <p/>
 * @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
   * http://en.wikipedia.org/wiki/Extended_file_attributes</a>======= Refer to the HDFS extended attributes user documentation for details. >>>>>>> .merge-right.r1614550
 * @param src file or directory
 * @param xAttr <code>XAttr</code> to remove
 * @throws IOException
 */
@AtMostOnce public void removeXAttr(String src,XAttr xAttr) throws IOException ;

Fixed version (ground truth):
/** 
 * Remove xattr of a file or directory.Value in xAttr parameter is ignored. The name must be prefixed with the namespace followed by ".". For example, "user.attr". <p/> Refer to the HDFS extended attributes user documentation for details.
 * @param src file or directory
 * @param xAttr <code>XAttr</code> to remove
 * @throws IOException
 */
@AtMostOnce public void removeXAttr(String src,XAttr xAttr) throws IOException ;
Program: 57808
Project: 57808
Buggy source:
@Override public synchronized void shutdownDatanode(boolean forUpgrade) throws IOException {
  LOG.info("String_Node_Str" + forUpgrade + "String_Node_Str");
  if (shutdownInProgress) {
    throw new IOException("String_Node_Str");
  }
  shutdownInProgress=true;
  shutdownForUpgrade=forUpgrade;
  Thread shutdownThread=new Thread(){
    @Override public void run(){
      if (!shutdownForUpgrade) {
        try {
          Thread.sleep(1000);
        }
 catch (        InterruptedException ie) {
        }
      }
      shutdown();
    }
  }
;
  shutdownThread.setDaemon(true);
  shutdownThread.start();
}

Fixed version (ground truth):
@Override public synchronized void shutdownDatanode(boolean forUpgrade) throws IOException {
  checkSuperuserPrivilege();
  LOG.info("String_Node_Str" + forUpgrade + "String_Node_Str");
  if (shutdownInProgress) {
    throw new IOException("String_Node_Str");
  }
  shutdownInProgress=true;
  shutdownForUpgrade=forUpgrade;
  Thread shutdownThread=new Thread(){
    @Override public void run(){
      if (!shutdownForUpgrade) {
        try {
          Thread.sleep(1000);
        }
 catch (        InterruptedException ie) {
        }
      }
      shutdown();
    }
  }
;
  shutdownThread.setDaemon(true);
  shutdownThread.start();
}
Program: 57809
Project: 57809
Buggy source:
@Override public void deleteBlockPool(String blockPoolId,boolean force) throws IOException {
  LOG.info("String_Node_Str" + blockPoolId + "String_Node_Str"+ force);
  if (blockPoolManager.get(blockPoolId) != null) {
    LOG.warn("String_Node_Str" + blockPoolId + "String_Node_Str");
    throw new IOException("String_Node_Str" + "String_Node_Str");
  }
  data.deleteBlockPool(blockPoolId,force);
}

Fixed version (ground truth):
@Override public void deleteBlockPool(String blockPoolId,boolean force) throws IOException {
  checkSuperuserPrivilege();
  LOG.info("String_Node_Str" + blockPoolId + "String_Node_Str"+ force);
  if (blockPoolManager.get(blockPoolId) != null) {
    LOG.warn("String_Node_Str" + blockPoolId + "String_Node_Str");
    throw new IOException("String_Node_Str" + "String_Node_Str");
  }
  data.deleteBlockPool(blockPoolId,force);
}
Program: 57812
Project: 57812
Buggy source:
@Override public void refreshNamenodes() throws IOException {
  conf=new Configuration();
  refreshNamenodes(conf);
}

Fixed version (ground truth):
@Override public void refreshNamenodes() throws IOException {
  checkSuperuserPrivilege();
  conf=new Configuration();
  refreshNamenodes(conf);
}
Program: 57813
Project: 57813
Buggy source:
/** 
 * Returns the length of the input. 
 */
public int getLength(){
  return buffer.getLength();
}

Fixed version (ground truth):
/** 
 * Returns the index one greater than the last valid character in the input stream buffer.
 */
public int getLength(){
  return buffer.getLength();
}