nus-yam/ex-repair huggingface dataset:
Program: 10420
Project: 10420
Buggy source:
@Override public void performDeath(){
  super.performDeath();
  SKNode splort=(SKNode)sharedDeathSplort.copy();
  splort.setZPosition(-1.0);
  splort.setZPosition(-1.0);
  splort.setZRotation(virtualZRotation);
  splort.setPosition(getPosition());
  splort.setAlpha(0.1);
  splort.runAction(SKAction.fadeAlphaTo(1.0,0.5));
  APAMultiplayerLayeredCharacterScene scene=getCharacterScene();
  scene.addNode(splort,APAWorldLayer.BelowCharacter);
  runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.fadeAlphaTo(0.0,0.5),SKAction.removeFromParent())));
  smokeEmitter.runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.wait(2.0),SKAction.runBlock(new Runnable(){
    @Override public void run(){
      smokeEmitter.setParticleBirthRate(2.0);
    }
  }
),SKAction.wait(2.0),SKAction.runBlock(new Runnable(){
    @Override public void run(){
      smokeEmitter.setParticleBirthRate(0.0);
    }
  }
),SKAction.wait(10.0),SKAction.fadeAlphaTo(0.0,0.5),SKAction.removeFromParent())));
  inactiveGoblins.clear();
}

Fixed version (ground truth):
@Override public void performDeath(){
  super.performDeath();
  SKNode splort=(SKNode)sharedDeathSplort.copy();
  splort.setZPosition(-1.0);
  splort.setZPosition(-1.0);
  splort.setZRotation(virtualZRotation);
  splort.setPosition(getPosition());
  splort.setAlpha(0.1);
  splort.runAction(SKAction.fadeAlphaTo(1.0,0.5));
  APAMultiplayerLayeredCharacterScene scene=getCharacterScene();
  scene.addNode(splort,APAWorldLayer.BelowCharacter);
  runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.fadeAlphaTo(0.0,0.5),SKAction.removeFromParent())));
  smokeEmitter.runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.wait(2.0),SKAction.run(new Runnable(){
    @Override public void run(){
      smokeEmitter.setParticleBirthRate(2.0);
    }
  }
),SKAction.wait(2.0),SKAction.run(new Runnable(){
    @Override public void run(){
      smokeEmitter.setParticleBirthRate(0.0);
    }
  }
),SKAction.wait(10.0),SKAction.fadeAlphaTo(0.0,0.5),SKAction.removeFromParent())));
  inactiveGoblins.clear();
}
Program: 10421
Project: 10421
Buggy source:
private void fireAnimation(final APAAnimationState animationState,NSArray<SKTexture> frames,String key){
  SKAction animAction=getAction(key);
  if (animAction != null | frames.size() < 1) {
    return;
  }
  activeAnimationKey=key;
  runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.animate(frames,animationSpeed,true,false),SKAction.runBlock(new Runnable(){
    @Override public void run(){
      animationHasCompleted(animationState);
    }
  }
))),key);
}

Fixed version (ground truth):
private void fireAnimation(final APAAnimationState animationState,NSArray<SKTexture> frames,String key){
  SKAction animAction=getAction(key);
  if (animAction != null | frames.size() < 1) {
    return;
  }
  activeAnimationKey=key;
  runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.animate(frames,animationSpeed,true,false),SKAction.run(new Runnable(){
    @Override public void run(){
      animationHasCompleted(animationState);
    }
  }
))),key);
}
Program: 10422
Project: 10422
Buggy source:
@Override void animationDidComplete(APAAnimationState animationState){
  super.animationDidComplete(animationState);
switch (animationState) {
case Death:
    removeAllActions();
  runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.wait(0.75),SKAction.fadeOut(1.0),SKAction.runBlock(new Runnable(){
    @Override public void run(){
      removeFromParent();
      cave.recycle(APAGoblin.this);
    }
  }
))));
break;
default :
break;
}
}

Fixed version (ground truth):
@Override void animationDidComplete(APAAnimationState animationState){
  super.animationDidComplete(animationState);
switch (animationState) {
case Death:
    removeAllActions();
  runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.wait(0.75),SKAction.fadeOut(1.0),SKAction.run(new Runnable(){
    @Override public void run(){
      removeFromParent();
      cave.recycle(APAGoblin.this);
    }
  }
))));
break;
default :
break;
}
}
Program: 10423
Project: 10423
Buggy source:
@Override void animationDidComplete(APAAnimationState animationState){
switch (animationState) {
case Death:
    final APAMultiplayerLayeredCharacterScene scene=getCharacterScene();
  SKEmitterNode emitter=(SKEmitterNode)sharedDeathEmitter.copy();
emitter.setZPosition(-0.8);
addChild(emitter);
APAUtils.runOneShotEmitter(emitter,4.5);
runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.wait(4.0),SKAction.runBlock(new Runnable(){
@Override public void run(){
scene.heroWasKilled(APAHeroCharacter.this);
}
}
),SKAction.removeFromParent())));
break;
case Attack:
fireProjectile();
break;
default :
break;
}
}

Fixed version (ground truth):
@Override void animationDidComplete(APAAnimationState animationState){
switch (animationState) {
case Death:
    final APAMultiplayerLayeredCharacterScene scene=getCharacterScene();
  SKEmitterNode emitter=(SKEmitterNode)sharedDeathEmitter.copy();
emitter.setZPosition(-0.8);
addChild(emitter);
APAUtils.runOneShotEmitter(emitter,4.5);
runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.wait(4.0),SKAction.run(new Runnable(){
@Override public void run(){
scene.heroWasKilled(APAHeroCharacter.this);
}
}
),SKAction.removeFromParent())));
break;
case Attack:
fireProjectile();
break;
default :
break;
}
}
Program: 10424
Project: 10424
Buggy source:
public static void runOneShotEmitter(final SKEmitterNode emitter,double duration){
  emitter.runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.wait(duration),SKAction.runBlock(new Runnable(){
    @Override public void run(){
      emitter.setParticleBirthRate(0);
    }
  }
),SKAction.wait(emitter.getParticleLifetime() + emitter.getParticleLifetimeRange()),SKAction.removeFromParent())));
}

Fixed version (ground truth):
public static void runOneShotEmitter(final SKEmitterNode emitter,double duration){
  emitter.runAction(SKAction.sequence(new NSArray<SKAction>(SKAction.wait(duration),SKAction.run(new Runnable(){
    @Override public void run(){
      emitter.setParticleBirthRate(0);
    }
  }
),SKAction.wait(emitter.getParticleLifetime() + emitter.getParticleLifetimeRange()),SKAction.removeFromParent())));
}
Program: 10425
Project: 10425
Buggy source:
/** 
 * Handler for the NSUserDefaultsDidChangeNotification. Loads the preferences from the defaults database into the holding properies, then asks the tableView to reload itself.
 */
private void onDefaultsChanged(){
  NSUserDefaults standardDefaults=NSUserDefaults.getStandardUserDefaults();
  firstName=standardDefaults.getString(FIRST_NAME_KEY);
  lastName=standardDefaults.getString(LAST_NAME_KEY);
  int textColor=(int)standardDefaults.getInteger(NAME_COLOR_KEY);
switch (textColor) {
case 1:
    nameColor=UIColor.blue();
  break;
case 2:
nameColor=UIColor.red();
break;
case 3:
nameColor=UIColor.green();
break;
default :
throw new RuntimeException("String_Node_Str" + textColor + "String_Node_Str"+ NAME_COLOR_KEY);
}
getTableView().reloadData();
}

Fixed version (ground truth):
/** 
 * Handler for the NSUserDefaultsDidChangeNotification. Loads the preferences from the defaults database into the holding properies, then asks the tableView to reload itself.
 */
private void onDefaultsChanged(){
  NSUserDefaults standardDefaults=NSUserDefaults.getStandardUserDefaults();
  firstName=standardDefaults.getString(FIRST_NAME_KEY);
  lastName=standardDefaults.getString(LAST_NAME_KEY);
  int textColor=standardDefaults.getInt(NAME_COLOR_KEY);
switch (textColor) {
case 1:
    nameColor=UIColor.blue();
  break;
case 2:
nameColor=UIColor.red();
break;
case 3:
nameColor=UIColor.green();
break;
default :
throw new RuntimeException("String_Node_Str" + textColor + "String_Node_Str"+ NAME_COLOR_KEY);
}
getTableView().reloadData();
}
Program: 10426
Project: 10426
Buggy source:
public static boolean useMovieBackground(){
  registerDefaults();
  return NSUserDefaults.getStandardUserDefaults().getInteger(MOVIE_BACKGROUND_IMAGE_KEY) != 0;
}

Fixed version (ground truth):
public static boolean useMovieBackground(){
  registerDefaults();
  return NSUserDefaults.getStandardUserDefaults().getInt(MOVIE_BACKGROUND_IMAGE_KEY) != 0;
}
Program: 10427
Project: 10427
Buggy source:
/** 
 * The color of the background area behind the movie can be any UIColor value. 
 */
public static UIColor getBackgroundColor(){
  registerDefaults();
  UIColor[] colors=new UIColor[]{UIColor.black(),UIColor.darkGray(),UIColor.lightGray(),UIColor.white(),UIColor.gray(),UIColor.red(),UIColor.green(),UIColor.blue(),UIColor.cyan(),UIColor.yellow(),UIColor.magenta(),UIColor.orange(),UIColor.purple(),UIColor.brown(),UIColor.clear()};
  return colors[(int)NSUserDefaults.getStandardUserDefaults().getInteger(BACKGROUND_COLOR_KEY)];
}

Fixed version (ground truth):
/** 
 * The color of the background area behind the movie can be any UIColor value.
 */
public static UIColor getBackgroundColor(){
  registerDefaults();
  UIColor[] colors=new UIColor[]{UIColor.black(),UIColor.darkGray(),UIColor.lightGray(),UIColor.white(),UIColor.gray(),UIColor.red(),UIColor.green(),UIColor.blue(),UIColor.cyan(),UIColor.yellow(),UIColor.magenta(),UIColor.orange(),UIColor.purple(),UIColor.brown(),UIColor.clear()};
  return colors[NSUserDefaults.getStandardUserDefaults().getInt(BACKGROUND_COLOR_KEY)];
}
Program: 10428
Project: 10428
Buggy source:
/** 
 * Movie control style can be one of: MPMovieControlStyleNone, MPMovieControlStyleEmbedded, MPMovieControlStyleFullscreen. Movie control style describes the style of the playback controls. It can be one of: MPMovieControlStyleNone, MPMovieControlStyleEmbedded, MPMovieControlStyleFullscreen, MPMovieControlStyleDefault, MPMovieControlStyleFullscreen 
 */
public static MPMovieControlStyle getControlStyle(){
  registerDefaults();
  return MPMovieControlStyle.valueOf(NSUserDefaults.getStandardUserDefaults().getInteger(CONTROL_STYLE_KEY));
}

Fixed version (ground truth):
/** 
 * Movie control style can be one of: MPMovieControlStyleNone, MPMovieControlStyleEmbedded, MPMovieControlStyleFullscreen. Movie control style describes the style of the playback controls. It can be one of: MPMovieControlStyleNone, MPMovieControlStyleEmbedded, MPMovieControlStyleFullscreen, MPMovieControlStyleDefault, MPMovieControlStyleFullscreen
 */
public static MPMovieControlStyle getControlStyle(){
  registerDefaults();
  return MPMovieControlStyle.valueOf(NSUserDefaults.getStandardUserDefaults().getInt(CONTROL_STYLE_KEY));
}
Program: 10429
Project: 10429
Buggy source:
/** 
 * Movie scaling mode can be one of: MPMovieScalingModeNone, MPMovieScalingModeAspectFit, MPMovieScalingModeAspectFill, MPMovieScalingModeFill. Movie scaling mode describes how the movie content is scaled to fit the frame of its view. It may be one of: MPMovieScalingModeNone, MPMovieScalingModeAspectFit, MPMovieScalingModeAspectFill, MPMovieScalingModeFill. 
 */
public static MPMovieScalingMode getScalingMode(){
  registerDefaults();
  return MPMovieScalingMode.valueOf(NSUserDefaults.getStandardUserDefaults().getInteger(SCALING_MODE_KEY));
}

Fixed version (ground truth):
/** 
 * Movie scaling mode can be one of: MPMovieScalingModeNone, MPMovieScalingModeAspectFit, MPMovieScalingModeAspectFill, MPMovieScalingModeFill. Movie scaling mode describes how the movie content is scaled to fit the frame of its view. It may be one of: MPMovieScalingModeNone, MPMovieScalingModeAspectFit, MPMovieScalingModeAspectFill, MPMovieScalingModeFill.
 */
public static MPMovieScalingMode getScalingMode(){
  registerDefaults();
  return MPMovieScalingMode.valueOf(NSUserDefaults.getStandardUserDefaults().getInt(SCALING_MODE_KEY));
}
Program: 10430
Project: 10430
Buggy source:
/** 
 * Movie repeat mode describes how the movie player repeats content at the end of playback. Movie repeat mode can be one of: MPMovieRepeatModeNone, MPMovieRepeatModeOne. 
 */
public static MPMovieRepeatMode getRepeatMode(){
  registerDefaults();
  return MPMovieRepeatMode.valueOf(NSUserDefaults.getStandardUserDefaults().getInteger(REPEAT_MODE_KEY));
}

Fixed version (ground truth):
/** 
 * Movie repeat mode describes how the movie player repeats content at the end of playback. Movie repeat mode can be one of: MPMovieRepeatModeNone, MPMovieRepeatModeOne.
 */
public static MPMovieRepeatMode getRepeatMode(){
  registerDefaults();
  return MPMovieRepeatMode.valueOf(NSUserDefaults.getStandardUserDefaults().getInt(REPEAT_MODE_KEY));
}
Program: 10431
Project: 10431
Buggy source:
@Override public void viewDidLoad(){
  super.viewDidLoad();
  long globalLevel=NSUserDefaults.getStandardUserDefaults().getInteger(PIA_GLOBAL_LEVEL_NUMBER_KEY);
  if (globalLevel <= 0) {
    NSUserDefaults.getStandardUserDefaults().put(PIA_GLOBAL_LEVEL_NUMBER_KEY,0);
    NSUserDefaults.getStandardUserDefaults().synchronize();
  }
}

Fixed version (ground truth):
@Override public void viewDidLoad(){
  super.viewDidLoad();
  long globalLevel=NSUserDefaults.getStandardUserDefaults().getInt(PIA_GLOBAL_LEVEL_NUMBER_KEY);
  if (globalLevel <= 0) {
    NSUserDefaults.getStandardUserDefaults().put(PIA_GLOBAL_LEVEL_NUMBER_KEY,0);
    NSUserDefaults.getStandardUserDefaults().synchronize();
  }
}
Program: 10432
Project: 10432
Buggy source:
@IBAction private void sendPIALevelTracking(UIResponder sender){
  System.out.println("String_Node_Str");
  long highestLevel=NSUserDefaults.getStandardUserDefaults().getInteger(PIA_GLOBAL_LEVEL_NUMBER_KEY);
  CBLevelType levelType=CBLevelType.HIGHEST_LEVEL_REACHED;
  String eventLabel="String_Node_Str";
  String eventDescription="String_Node_Str";
  long subLevel=0;
  CBAnalytics.trackLevelInfo(eventLabel,levelType,highestLevel,subLevel,eventDescription);
  renderPIALevelTrackingAlert(eventLabel,levelType,highestLevel,subLevel,eventDescription);
  NSUserDefaults.getStandardUserDefaults().put(PIA_GLOBAL_LEVEL_NUMBER_KEY,highestLevel + 1);
  NSUserDefaults.getStandardUserDefaults().synchronize();
}

Fixed version (ground truth):
@IBAction private void sendPIALevelTracking(UIResponder sender){
  System.out.println("String_Node_Str");
  long highestLevel=NSUserDefaults.getStandardUserDefaults().getInt(PIA_GLOBAL_LEVEL_NUMBER_KEY);
  CBLevelType levelType=CBLevelType.HIGHEST_LEVEL_REACHED;
  String eventLabel="String_Node_Str";
  String eventDescription="String_Node_Str";
  long subLevel=0;
  CBAnalytics.trackLevelInfo(eventLabel,levelType,highestLevel,subLevel,eventDescription);
  renderPIALevelTrackingAlert(eventLabel,levelType,highestLevel,subLevel,eventDescription);
  NSUserDefaults.getStandardUserDefaults().put(PIA_GLOBAL_LEVEL_NUMBER_KEY,highestLevel + 1);
  NSUserDefaults.getStandardUserDefaults().synchronize();
}
Program: 10433
Project: 10433
Buggy source:
private void readDirectory(){
  documentURLs.clear();
  String documentsDirectoryPath=getApplicationDocumentsDirectory();
  NSArray<NSURL> documentsDirectoryContents=NSFileManager.getDefaultManager().getContentsOfDirectoryAtPath(documentsDirectoryPath);
  for (  NSURL url : documentsDirectoryContents) {
    String filePath=documentsDirectoryPath + "String_Node_Str" + url.getLastPathComponent();
    NSURL fileURL=new NSURL(new File(filePath));
    boolean isDirectory=NSFileManager.getDefaultManager().isDirectoryAtPath(filePath);
    if (!(isDirectory && url.getLastPathComponent().equals("String_Node_Str"))) {
      documentURLs.add(fileURL);
    }
  }
  getTableView().reloadData();
}

Fixed version (ground truth):
private void readDirectory(){
  documentURLs.clear();
  String documentsDirectoryPath=getApplicationDocumentsDirectory();
  NSArray<NSURL> documentsDirectoryContents;
  try {
    documentsDirectoryContents=NSFileManager.getDefaultManager().getContentsOfDirectoryAtPath(documentsDirectoryPath);
    for (    NSURL url : documentsDirectoryContents) {
      String filePath=documentsDirectoryPath + "String_Node_Str" + url.getLastPathComponent();
      NSURL fileURL=new NSURL(new File(filePath));
      boolean isDirectory=NSFileManager.getDefaultManager().isDirectoryAtPath(filePath);
      if (!(isDirectory && url.getLastPathComponent().equals("String_Node_Str"))) {
        documentURLs.add(fileURL);
      }
    }
  }
 catch (  NSErrorException e) {
    throw new Error(e);
  }
  getTableView().reloadData();
}
Program: 10434
Project: 10434
Buggy source:
/** 
 * Used to get the App Store's response to your request and notifies your observer 
 */
@Override public void didReceiveResponse(SKProductsRequest request,SKProductsResponse response){
  if (response.getProducts().size() > 0) {
    availableProducts.addAll(response.getProducts());
    status=IAPProductRequestStatus.ProductsFound;
    NSNotificationCenter.getDefaultCenter().postNotification(IAPProductRequestNotification,this);
  }
  if (response.getInvalidProductIdentifiers().size() > 0) {
    invalidProductIds.addAll(response.getInvalidProductIdentifiers());
    status=IAPProductRequestStatus.IdentifiersNotFound;
    NSNotificationCenter.getDefaultCenter().postNotification(IAPProductRequestNotification,this);
  }
}

Fixed version (ground truth):
/** 
 * Used to get the App Store's response to your request and notifies your observer
 */
@Override public void didReceiveResponse(SKProductsRequest request,SKProductsResponse response){
  if (response.getProducts().size() > 0) {
    availableProducts.addAll(response.getProducts());
    status=IAPProductRequestStatus.ProductsFound;
    NSNotificationCenter.getDefaultCenter().postNotification(IAPProductRequestNotification,this);
  }
  if (response.getInvalidProductIdentifiers().size() > 0) {
    invalidProductIds.addAll(response.getInvalidProductIdentifiers());
    status=IAPProductRequestStatus.IdentifiersNotFound;
    NSNotificationCenter.getDefaultCenter().postNotification(IAPProductRequestNotification,this);
  }
}
Program: 10435
Project: 10435
Buggy source:
/** 
 * @param identifier
 * @return the product's title matching a given product identifier 
 */
public String getTitleForId(String identifier){
  for (  SKProduct product : availableProducts) {
    if (product.getProductIdentifier().equals(identifier)) {
      return product.getLocalizedTitle();
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param identifier
 * @return the product's title matching a given product identifier
 */
public String getTitleForId(String identifier){
  for (  SKProduct product : availableProducts) {
    if (product.getProductIdentifier().equals(identifier)) {
      return product.getLocalizedTitle();
    }
  }
  return null;
}
Program: 10436
Project: 10436
Buggy source:
/** 
 * Query the App Store about the given product identifiers
 * @param productIds 
 */
public void fetchProductInformationForIds(List<String> productIds){
  SKProductsRequest request=new SKProductsRequest(new HashSet<String>(productIds));
  request.setDelegate(this);
  request.start();
}

Fixed version (ground truth):
/** 
 * Query the App Store about the given product identifiers
 * @param productIds
 */
public void fetchProductInformationForIds(List<String> productIds){
  SKProductsRequest request=new SKProductsRequest(new HashSet<String>(productIds));
  request.setDelegate(this);
  request.start();
}
Program: 10438
Project: 10438
Buggy source:
public ImageScrollView(){
  setShowsHorizontalScrollIndicator(false);
  setShowsHorizontalScrollIndicator(false);
  setBouncesZoom(true);
  setDecelerationRate(UIScrollView.DecelerationRateFast());
  setDelegate(new UIScrollViewDelegateAdapter(){
    @Override public UIView getViewForZooming(    UIScrollView scrollView){
      return zoomView;
    }
  }
);
}

Fixed version (ground truth):
public ImageScrollView(){
  setShowsHorizontalScrollIndicator(false);
  setShowsHorizontalScrollIndicator(false);
  setBouncesZoom(true);
  setDecelerationRate(UIScrollView.getFastDecelerationRate());
  setDelegate(new UIScrollViewDelegateAdapter(){
    @Override public UIView getViewForZooming(    UIScrollView scrollView){
      return zoomView;
    }
  }
);
}
Program: 10440
Project: 10440
Buggy source:
private NSArray<NSIndexPath> getIndexPathsFromIndexesWithSection(NSIndexSet indexSet,final long section){
  final NSArray<NSIndexPath> indexPaths=new NSMutableArray<>(indexSet.getCount());
  indexSet.enumerateIndexes(new VoidBlock2<Long,BooleanPtr>(){
    @Override public void invoke(    Long idx,    BooleanPtr stop){
      indexPaths.add(NSIndexPath.createWithItem(idx,section));
    }
  }
);
  return indexPaths;
}

Fixed version (ground truth):
private NSArray<NSIndexPath> getIndexPathsFromIndexesWithSection(NSIndexSet indexSet,final long section){
  final NSArray<NSIndexPath> indexPaths=new NSMutableArray<>(indexSet.size());
  indexSet.enumerateIndexes(new VoidBlock2<Long,BooleanPtr>(){
    @Override public void invoke(    Long idx,    BooleanPtr stop){
      indexPaths.add(NSIndexPath.createWithItem(idx,section));
    }
  }
);
  return indexPaths;
}
Program: 10441
Project: 10441
Buggy source:
private void updateImage(){
  lastImageViewSize=imageView.getBounds().getSize();
  double scale=UIScreen.getMainScreen().getScale();
  CGSize targetSize=new CGSize(imageView.getBounds().getWidth() * scale,imageView.getBounds().getHeight() * scale);
  PHImageRequestOptions options=new PHImageRequestOptions();
  options.setNetworkAccessAllowed(true);
  options.setProgressHandler(new VoidBlock4<Boolean,Double,NSError,BooleanPtr>(){
    @Override public void invoke(    Boolean a,    final Double progress,    NSError c,    BooleanPtr d){
      DispatchQueue.getMainQueue().async(new Runnable(){
        @Override public void run(){
          progressView.setProgress(progress.floatValue());
          progressView.setHidden(progress <= 0 || progress >= 1);
        }
      }
);
    }
  }
);
  PHImageManager.getDefaultManager().requestImageForAsset(asset,targetSize,PHImageContentMode.AspectFill,options,new VoidBlock2<UIImage,NSDictionary<NSString,NSObject>>(){
    @Override public void invoke(    UIImage result,    NSDictionary<NSString,NSObject> info){
      if (result != null) {
        imageView.setImage(result);
      }
    }
  }
);
}

Fixed version (ground truth):
private void updateImage(){
  lastImageViewSize=imageView.getBounds().getSize();
  double scale=UIScreen.getMainScreen().getScale();
  CGSize targetSize=new CGSize(imageView.getBounds().getWidth() * scale,imageView.getBounds().getHeight() * scale);
  PHImageRequestOptions options=new PHImageRequestOptions();
  options.setNetworkAccessAllowed(true);
  options.setProgressHandler(new VoidBlock4<Double,NSError,BooleanPtr,NSDictionary<NSString,NSObject>>(){
    @Override public void invoke(    final Double progress,    NSError error,    BooleanPtr c,    NSDictionary<NSString,NSObject> d){
      DispatchQueue.getMainQueue().async(new Runnable(){
        @Override public void run(){
          progressView.setProgress(progress.floatValue());
          progressView.setHidden(progress <= 0 || progress >= 1);
        }
      }
);
    }
  }
);
  PHImageManager.getDefaultManager().requestImageForAsset(asset,targetSize,PHImageContentMode.AspectFill,options,new VoidBlock2<UIImage,NSDictionary<NSString,NSObject>>(){
    @Override public void invoke(    UIImage result,    NSDictionary<NSString,NSObject> info){
      if (result != null) {
        imageView.setImage(result);
      }
    }
  }
);
}
Program: 10444
Project: 10444
Buggy source:
/** 
 * Locates the file representing the root page of the settings for this app, invokes loadDefaults:fromSettingsPage:inSettingsBundleAtURL: on it, and registers the loaded values as the app's defaults. 
 */
private void populateRegistrationDomain(){
  NSURL settingsBundleURL=NSBundle.getMainBundle().findResourceURLInSubPath("String_Node_Str","String_Node_Str");
  NSDictionary<?,?> appDefaults=loadDefaults("String_Node_Str",settingsBundleURL);
  NSUserDefaults.getStandardUserDefaults().registerDefaults(appDefaults);
  NSUserDefaults.getStandardUserDefaults().synchronize();
}

Fixed version (ground truth):
/** 
 * Locates the file representing the root page of the settings for this app, invokes loadDefaults:fromSettingsPage:inSettingsBundleAtURL: on it, and registers the loaded values as the app's defaults. 
 */
private void populateRegistrationDomain(){
  NSURL settingsBundleURL=NSBundle.getMainBundle().findResourceURL("String_Node_Str","String_Node_Str");
  NSDictionary<?,?> appDefaults=loadDefaults("String_Node_Str",settingsBundleURL);
  NSUserDefaults.getStandardUserDefaults().registerDefaults(appDefaults);
  NSUserDefaults.getStandardUserDefaults().synchronize();
}
Program: 10445
Project: 10445
Buggy source:
@Override public void didUpdateUserLocation(final MKMapView mapView,final MKUserLocation userLocation){
  final MachineSizedSIntPtr centerMapFirstTime=new MachineSizedSIntPtr();
  if ((userLocation.getCoordinate().getLatitude() != 0.0) && (userLocation.getCoordinate().getLongitude() != 0.0)) {
    Dispatch.once(centerMapFirstTime,new Runnable(){
      @Override public void run(){
        mapView.setCenterCoordinate(userLocation.getCoordinate(),true);
      }
    }
);
  }
  geocoder.reverseGeocodeLocation(mapView.getUserLocation().getLocation(),new VoidBlock2<NSArray<CLPlacemark>,NSError>(){
    @Override public void invoke(    NSArray<CLPlacemark> placemarks,    NSError error){
      if (placemarks != null && placemarks.size() > 0) {
        placemark=placemarks.get(0);
        getAddressButton.setEnabled(true);
      }
 else {
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void didUpdateUserLocation(final MKMapView mapView,final MKUserLocation userLocation){
  if ((userLocation.getCoordinate().getLatitude() != 0.0) && (userLocation.getCoordinate().getLongitude() != 0.0)) {
    Dispatch.once(new Runnable(){
      @Override public void run(){
        mapView.setCenterCoordinate(userLocation.getCoordinate(),true);
      }
    }
);
  }
  geocoder.reverseGeocodeLocation(mapView.getUserLocation().getLocation(),new VoidBlock2<NSArray<CLPlacemark>,NSError>(){
    @Override public void invoke(    NSArray<CLPlacemark> placemarks,    NSError error){
      if (placemarks != null && placemarks.size() > 0) {
        placemark=placemarks.get(0);
        getAddressButton.setEnabled(true);
      }
 else {
      }
    }
  }
);
}
Program: 10450
Project: 10450
Buggy source:
public void startRecording() throws Exception {
  AudioStreamBasicDescription asbd=new AudioStreamBasicDescription(mSampleRate,mFormatID,mFormatFlags,mBytesPerPacket,mFramesPerPacket,mBytesPerFrame,mChannelsPerFrame,mBitsPerChannel,0);
  AudioQueuePtr mQueuePtr=new AudioQueuePtr();
  AudioQueueBufferPtr mBuffers=Struct.allocate(AudioQueueBufferPtr.class,kNumberBuffers);
  AQRecorderState aqData=new AQRecorderState(this);
  mStateID=aqData.mID();
  Method callbackMethod=null;
  Method[] methods=this.getClass().getMethods();
  int i=methods.length;
  while (i-- > 0)   if (methods[i].getName().equals("String_Node_Str")) {
    callbackMethod=methods[i];
    break;
  }
  FunctionPtr fp=new FunctionPtr(callbackMethod);
  VoidPtr vp=aqData.as(VoidPtr.class);
  AudioQueueError aqe=AudioQueue.newInput(asbd,fp,vp,null,null,0,mQueuePtr);
  System.out.println(CFRunLoopMode.Common.value());
  System.out.println(aqe.name());
  mQueue=mQueuePtr.get();
  int bufferByteSize=deriveBufferSize(mQueue,asbd,0.5);
  System.out.println("String_Node_Str" + bufferByteSize);
  AudioQueueBufferPtr[] buffers=mBuffers.toArray(kNumberBuffers);
  for (i=0; i < kNumberBuffers; ++i) {
    mQueue.allocateBuffer(bufferByteSize,buffers[i]);
    mQueue.enqueueBuffer(buffers[i].get(),0,null);
  }
  mRunning=true;
  mQueue.start(null);
}

Fixed version (ground truth):
public void startRecording() throws Exception {
  AudioStreamBasicDescription asbd=new AudioStreamBasicDescription(mSampleRate,mFormatID,mFormatFlags,mBytesPerPacket,mFramesPerPacket,mBytesPerFrame,mChannelsPerFrame,mBitsPerChannel,0);
  AudioQueuePtr mQueuePtr=new AudioQueuePtr();
  AudioQueueBufferPtr mBuffers=Struct.allocate(AudioQueueBufferPtr.class,kNumberBuffers);
  AQRecorderState aqData=new AQRecorderState(this);
  mStateID=aqData.mID();
  Method callbackMethod=null;
  Method[] methods=this.getClass().getMethods();
  int i=methods.length;
  while (i-- > 0)   if (methods[i].getName().equals("String_Node_Str")) {
    callbackMethod=methods[i];
    break;
  }
  FunctionPtr fp=new FunctionPtr(callbackMethod);
  VoidPtr vp=aqData.as(VoidPtr.class);
  OSStatus aqe=AudioQueue.newInput(asbd,fp,vp,null,null,0,mQueuePtr);
  System.out.println(CFRunLoopMode.Common.value());
  System.out.println(AudioQueueError.valueOf(aqe.getStatusCode()));
  mQueue=mQueuePtr.get();
  int bufferByteSize=deriveBufferSize(mQueue,asbd,0.5);
  System.out.println("String_Node_Str" + bufferByteSize);
  AudioQueueBufferPtr[] buffers=mBuffers.toArray(kNumberBuffers);
  for (i=0; i < kNumberBuffers; ++i) {
    mQueue.allocateBuffer(bufferByteSize,buffers[i]);
    mQueue.enqueueBuffer(buffers[i].get(),0,null);
  }
  mRunning=true;
  mQueue.start(null);
}
Program: 10452
Project: 10452
Buggy source:
public void run(){
  AudioStreamBasicDescription asbd=new AudioStreamBasicDescription(mSampleRate,mFormatID,mFormatFlags,mBytesPerPacket,mFramesPerPacket,mBytesPerFrame,mChannelsPerFrame,mBitsPerChannel,0);
  AudioQueuePtr mQueuePtr=new AudioQueuePtr();
  Method callbackMethod=null;
  Method[] methods=me.getClass().getMethods();
  int i=methods.length;
  while (i-- > 0)   if (methods[i].getName().equals("String_Node_Str")) {
    callbackMethod=methods[i];
    break;
  }
  FunctionPtr fp=new FunctionPtr(callbackMethod);
  AQPlayerState aqData=new AQPlayerState(me);
  mStateID=aqData.mID();
  VoidPtr vp=aqData.as(VoidPtr.class);
  AudioQueueError aqe=AudioQueue.newOutput(asbd,fp,vp,null,null,0,mQueuePtr);
  System.out.println(aqe.name());
  mQueue=mQueuePtr.get();
  int bufferByteSize=deriveBufferSize(asbd,2,0.5);
  System.out.println("String_Node_Str" + bufferByteSize);
  System.out.println("String_Node_Str" + (int)AudioQueueParam.Volume.value());
  mQueue.setParameter((int)AudioQueueParam.Volume.value(),1.0f);
  mRunning=true;
  AudioQueueBufferPtr mBuffers=Struct.allocate(AudioQueueBufferPtr.class,kNumberBuffers);
  AudioQueueBufferPtr[] buffers=mBuffers.toArray(kNumberBuffers);
  for (i=0; i < kNumberBuffers; ++i) {
    mQueue.allocateBuffer(bufferByteSize,buffers[i]);
    nextChunk(mQueue,buffers[i].get());
  }
  System.out.println("String_Node_Str");
  mQueue.start(null);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  AudioStreamBasicDescription asbd=new AudioStreamBasicDescription(mSampleRate,mFormatID,mFormatFlags,mBytesPerPacket,mFramesPerPacket,mBytesPerFrame,mChannelsPerFrame,mBitsPerChannel,0);
  AudioQueuePtr mQueuePtr=new AudioQueuePtr();
  Method callbackMethod=null;
  Method[] methods=me.getClass().getMethods();
  int i=methods.length;
  while (i-- > 0)   if (methods[i].getName().equals("String_Node_Str")) {
    callbackMethod=methods[i];
    break;
  }
  FunctionPtr fp=new FunctionPtr(callbackMethod);
  AQPlayerState aqData=new AQPlayerState(me);
  mStateID=aqData.mID();
  VoidPtr vp=aqData.as(VoidPtr.class);
  OSStatus aqe=AudioQueue.newOutput(asbd,fp,vp,null,null,0,mQueuePtr);
  System.out.println(AudioQueueError.valueOf(aqe.getStatusCode()));
  mQueue=mQueuePtr.get();
  int bufferByteSize=deriveBufferSize(asbd,2,0.5);
  System.out.println("String_Node_Str" + bufferByteSize);
  System.out.println("String_Node_Str" + (int)AudioQueueParam.Volume.value());
  mQueue.setParameter((int)AudioQueueParam.Volume.value(),1.0f);
  mRunning=true;
  AudioQueueBufferPtr mBuffers=Struct.allocate(AudioQueueBufferPtr.class,kNumberBuffers);
  AudioQueueBufferPtr[] buffers=mBuffers.toArray(kNumberBuffers);
  for (i=0; i < kNumberBuffers; ++i) {
    mQueue.allocateBuffer(bufferByteSize,buffers[i]);
    nextChunk(mQueue,buffers[i].get());
  }
  System.out.println("String_Node_Str");
  mQueue.start(null);
  System.out.println("String_Node_Str");
}
Program: 10453
Project: 10453
Buggy source:
public AtomicElementView(CGRect frame){
  super(frame);
  setBackgroundColor(UIColor.clear());
  UITapGestureRecognizer tapGestureRecognizer=new UITapGestureRecognizer(new UIGestureRecognizer.GestureListener(){
    @Override public void handleGesture(    UIGestureRecognizer gestureRecognizer){
      viewController.flipCurrentView();
    }
  }
);
  addGestureRecognizer(tapGestureRecognizer);
}

Fixed version (ground truth):
public AtomicElementView(CGRect frame){
  super(frame);
  setBackgroundColor(UIColor.clear());
  UITapGestureRecognizer tapGestureRecognizer=new UITapGestureRecognizer(new UIGestureRecognizer.OnGestureListener(){
    @Override public void onGesture(    UIGestureRecognizer gestureRecognizer){
      viewController.flipCurrentView();
    }
  }
);
  addGestureRecognizer(tapGestureRecognizer);
}
Program: 10455
Project: 10455
Buggy source:
private PhotoAnnotation getAnnotationInGrid(MKMapRect gridMapRect,List<PhotoAnnotation> annotations){
  NSSet<NSObject> visibleAnnotationsInBucket=mapView.getAnnotations(gridMapRect);
  for (  MKAnnotation annotation : annotations) {
    if (visibleAnnotationsInBucket.contains(annotation)) {
      return annotations.get(0);
    }
  }
  final MKMapPoint centerMapPoint=new MKMapPoint(gridMapRect.getOrigin().getX() + gridMapRect.getSize().getWidth() / 2,gridMapRect.getOrigin().getY() + gridMapRect.getSize().getHeight() / 2);
  Comparator<MKAnnotation> comparator=new Comparator<MKAnnotation>(){
    @Override public int compare(    MKAnnotation lhs,    MKAnnotation rhs){
      MKMapPoint mapPoint1=MKMapPoint.create(lhs.getCoordinate());
      MKMapPoint mapPoint2=MKMapPoint.create(rhs.getCoordinate());
      double distance1=MKMapPoint.getMetersBetween(mapPoint1,centerMapPoint);
      double distance2=MKMapPoint.getMetersBetween(mapPoint2,centerMapPoint);
      if (distance1 < distance2) {
        return -1;
      }
      if (distance1 > distance2) {
        return 1;
      }
      return 0;
    }
  }
;
  Collections.sort(annotations,comparator);
  return annotations.get(0);
}

Fixed version (ground truth):
private PhotoAnnotation getAnnotationInGrid(MKMapRect gridMapRect,List<PhotoAnnotation> annotations){
  Set<MKAnnotation> visibleAnnotationsInBucket=mapView.getAnnotations(gridMapRect);
  for (  MKAnnotation annotation : annotations) {
    if (visibleAnnotationsInBucket.contains(annotation)) {
      return annotations.get(0);
    }
  }
  final MKMapPoint centerMapPoint=new MKMapPoint(gridMapRect.getOrigin().getX() + gridMapRect.getSize().getWidth() / 2,gridMapRect.getOrigin().getY() + gridMapRect.getSize().getHeight() / 2);
  Comparator<MKAnnotation> comparator=new Comparator<MKAnnotation>(){
    @Override public int compare(    MKAnnotation lhs,    MKAnnotation rhs){
      MKMapPoint mapPoint1=MKMapPoint.create(lhs.getCoordinate());
      MKMapPoint mapPoint2=MKMapPoint.create(rhs.getCoordinate());
      double distance1=MKMapPoint.getMetersBetween(mapPoint1,centerMapPoint);
      double distance2=MKMapPoint.getMetersBetween(mapPoint2,centerMapPoint);
      if (distance1 < distance2) {
        return -1;
      }
      if (distance1 > distance2) {
        return 1;
      }
      return 0;
    }
  }
;
  Collections.sort(annotations,comparator);
  return annotations.get(0);
}
Program: 10456
Project: 10456
Buggy source:
private void populateWorldWithAllPhotoAnnotations(){
  final LoadingStatus loadingStatus=LoadingStatus.getDefaultLoadingStatus(getView().getFrame().getWidth());
  getView().addSubview(loadingStatus);
  DispatchQueue.getGlobalQueue(DispatchQueue.PRIORITY_DEFAULT,0).async(new Runnable(){
    @Override public void run(){
      System.out.println("String_Node_Str");
      List<PhotoAnnotation> photos=loadPhotoSet("String_Node_Str");
      if (photos == null)       throw new UnsupportedOperationException("String_Node_Str");
      System.out.println("String_Node_Str");
      PhotoMapViewController.this.photos=photos;
      DispatchQueue.getMainQueue().async(new Runnable(){
        @Override public void run(){
          NSArray<?> p=new NSArray<>(PhotoMapViewController.this.photos);
          allAnnotationsMapView.addAnnotations((NSArray<NSObject>)p);
          updateVisibleAnnotations();
          loadingStatus.removeFromSuperviewWithFade();
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
private void populateWorldWithAllPhotoAnnotations(){
  final LoadingStatus loadingStatus=LoadingStatus.getDefaultLoadingStatus(getView().getFrame().getWidth());
  getView().addSubview(loadingStatus);
  DispatchQueue.getGlobalQueue(DispatchQueue.PRIORITY_DEFAULT,0).async(new Runnable(){
    @Override public void run(){
      System.out.println("String_Node_Str");
      List<MKAnnotation> photos=loadPhotoSet("String_Node_Str");
      if (photos == null)       throw new UnsupportedOperationException("String_Node_Str");
      System.out.println("String_Node_Str");
      PhotoMapViewController.this.photos=photos;
      DispatchQueue.getMainQueue().async(new Runnable(){
        @Override public void run(){
          allAnnotationsMapView.addAnnotations(PhotoMapViewController.this.photos);
          updateVisibleAnnotations();
          loadingStatus.removeFromSuperviewWithFade();
        }
      }
);
    }
  }
);
}
Program: 10459
Project: 10459
Buggy source:
@Override public MKAnnotationView getAnnotationView(MKMapView mapView,MKAnnotation annotation){
  final String annotationIdentifier="String_Node_Str";
  if (mapView != PhotoMapViewController.this.mapView) {
    return null;
  }
  if (annotation instanceof PhotoAnnotation) {
    MKPinAnnotationView annotationView=(MKPinAnnotationView)mapView.dequeueReusableAnnotationView(annotationIdentifier);
    if (annotationView == null) {
      annotationView=new MKPinAnnotationView();
      annotationView.setAnnotation(annotation);
      annotationView.setCanShowCallout(true);
      annotationView.setPinColor(MKPinAnnotationColor.Red);
      annotationView.setAnimatesDrop(true);
      UIButton disclosureButton=UIButton.create(UIButtonType.DetailDisclosure);
      annotationView.setRightCalloutAccessoryView(disclosureButton);
    }
 else {
      annotationView.setAnnotation(annotation);
    }
    return annotationView;
  }
  return null;
}

Fixed version (ground truth):
@Override public MKAnnotationView getAnnotationView(MKMapView mapView,MKAnnotation annotation){
  final String annotationIdentifier="String_Node_Str";
  if (mapView != PhotoMapViewController.this.mapView) {
    return null;
  }
  if (annotation instanceof PhotoAnnotation) {
    MKPinAnnotationView annotationView=(MKPinAnnotationView)mapView.dequeueReusableAnnotationView(annotationIdentifier);
    if (annotationView == null) {
      annotationView=new MKPinAnnotationView(annotation,annotationIdentifier);
      annotationView.setCanShowCallout(true);
      annotationView.setPinColor(MKPinAnnotationColor.Red);
      annotationView.setAnimatesDrop(true);
      UIButton disclosureButton=UIButton.create(UIButtonType.DetailDisclosure);
      annotationView.setRightCalloutAccessoryView(disclosureButton);
    }
 else {
      annotationView.setAnnotation(annotation);
    }
    return annotationView;
  }
  return null;
}
Program: 10461
Project: 10461
Buggy source:
private static NSArray<?> getImageData(){
  if (imageData == null) {
    String path=NSBundle.getMainBundle().findResourcePath("String_Node_Str","String_Node_Str");
    NSData plistData=NSData.read(new File(path));
    try {
      imageData=(NSArray<?>)NSPropertyListSerialization.getPropertyListFromData(plistData,0);
    }
 catch (    NSErrorException e) {
      System.err.println("String_Node_Str" + e.getError());
    }
  }
  return imageData;
}

Fixed version (ground truth):
private static NSArray<?> getImageData(){
  if (imageData == null) {
    String path=NSBundle.getMainBundle().findResourcePath("String_Node_Str","String_Node_Str");
    NSData plistData=NSData.read(new File(path));
    try {
      imageData=(NSArray<?>)NSPropertyListSerialization.getPropertyListFromData(plistData,NSPropertyListMutabilityOptions.None);
    }
 catch (    NSErrorException e) {
      System.err.println("String_Node_Str" + e.getError());
    }
  }
  return imageData;
}
Program: 10462
Project: 10462
Buggy source:
@Override public void setFrame(CGRect frame){
  boolean sizeChanging=!frame.getSize().equalToSize(getFrame().getSize());
  if (sizeChanging) {
    prepareToResize();
  }
  super.setFrame(frame);
  if (sizeChanging) {
    recoverFromResizing();
  }
}

Fixed version (ground truth):
@Override public void setFrame(CGRect frame){
  boolean sizeChanging=!frame.getSize().equalsTo(getFrame().getSize());
  if (sizeChanging) {
    prepareToResize();
  }
  super.setFrame(frame);
  if (sizeChanging) {
    recoverFromResizing();
  }
}
Program: 10463
Project: 10463
Buggy source:
@Method(selector="String_Node_Str") public static Class<?> getLayerClass(){
  return CATiledLayer.class;
}

Fixed version (ground truth):
@Method(selector="String_Node_Str") public static Class<? extends CALayer> getLayerClass(){
  return CATiledLayer.class;
}
Program: 10465
Project: 10465
Buggy source:
public void onClick(UIBarButtonItem barButtonItem){
  onSave();
}

Fixed version (ground truth):
@Override public void onClick(UIBarButtonItem barButtonItem){
  onSave();
}
Program: 10466
Project: 10466
Buggy source:
@Override public void viewDidLoad(){
  super.viewDidLoad();
  getNavigationItem().setRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Done,new OnClickListener(){
    public void onClick(    UIBarButtonItem barButtonItem){
      onSave();
    }
  }
));
}

Fixed version (ground truth):
@Override public void viewDidLoad(){
  super.viewDidLoad();
  getNavigationItem().setRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Done,new OnClickListener(){
    @Override public void onClick(    UIBarButtonItem barButtonItem){
      onSave();
    }
  }
));
}
Program: 10467
Project: 10467
Buggy source:
public void onClick(UIBarButtonItem barButtonItem){
  setEditing(false,true);
}

Fixed version (ground truth):
@Override public void onClick(UIBarButtonItem barButtonItem){
  setEditing(false,true);
}
Program: 10468
Project: 10468
Buggy source:
@Override public void viewDidLoad(){
  super.viewDidLoad();
  getNavigationItem().setRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Add,new OnClickListener(){
    public void onClick(    UIBarButtonItem barButtonItem){
      onAdd();
    }
  }
));
  editBarButtonItem=new UIBarButtonItem(UIBarButtonSystemItem.Edit,new OnClickListener(){
    public void onClick(    UIBarButtonItem barButtonItem){
      setEditing(true,true);
    }
  }
);
  doneBarButtonItem=new UIBarButtonItem(UIBarButtonSystemItem.Done,new OnClickListener(){
    public void onClick(    UIBarButtonItem barButtonItem){
      setEditing(false,true);
    }
  }
);
  getNavigationItem().setLeftBarButtonItem(editBarButtonItem);
}

Fixed version (ground truth):
@Override public void viewDidLoad(){
  super.viewDidLoad();
  getNavigationItem().setRightBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Add,new OnClickListener(){
    @Override public void onClick(    UIBarButtonItem barButtonItem){
      onAdd();
    }
  }
));
  editBarButtonItem=new UIBarButtonItem(UIBarButtonSystemItem.Edit,new OnClickListener(){
    @Override public void onClick(    UIBarButtonItem barButtonItem){
      setEditing(true,true);
    }
  }
);
  doneBarButtonItem=new UIBarButtonItem(UIBarButtonSystemItem.Done,new OnClickListener(){
    @Override public void onClick(    UIBarButtonItem barButtonItem){
      setEditing(false,true);
    }
  }
);
  getNavigationItem().setLeftBarButtonItem(editBarButtonItem);
}
Program: 10469
Project: 10469
Buggy source:
public void onClick(UIBarButtonItem barButtonItem){
  selectedTask=null;
  dismissViewController(true,null);
}

Fixed version (ground truth):
@Override public void onClick(UIBarButtonItem barButtonItem){
  selectedTask=null;
  dismissViewController(true,null);
}
Program: 10470
Project: 10470
Buggy source:
@Override public void viewDidLoad(){
  super.viewDidLoad();
  getNavigationItem().setLeftBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Cancel,new OnClickListener(){
    public void onClick(    UIBarButtonItem barButtonItem){
      selectedTask=null;
      dismissViewController(true,null);
    }
  }
));
}

Fixed version (ground truth):
@Override public void viewDidLoad(){
  super.viewDidLoad();
  getNavigationItem().setLeftBarButtonItem(new UIBarButtonItem(UIBarButtonSystemItem.Cancel,new OnClickListener(){
    @Override public void onClick(    UIBarButtonItem barButtonItem){
      selectedTask=null;
      dismissViewController(true,null);
    }
  }
));
}
Program: 10471
Project: 10471
Buggy source:
/** 
 * Create button with provided parameters
 * @param title title of button
 * @param frame frame of button
 * @param image image in button
 * @param imagePressed state to show when image is pressed
 * @param darkTextColor should text of dark color be displayed
 * @return a new UIButton 
 */
private static UIButton newButton(String title,CGRect frame,UIImage image,UIImage imagePressed,boolean darkTextColor){
  UIButton button=new UIButton(frame);
  button.setContentVerticalAlignment(UIControlContentVerticalAlignment.Center);
  button.setContentHorizontalAlignment(UIControlContentHorizontalAlignment.Center);
  button.setTitle(title,UIControlState.Normal);
  if (darkTextColor) {
    button.setTitleColor(UIColor.black(),UIControlState.Normal);
  }
 else {
    button.setTitleColor(UIColor.white(),UIControlState.Normal);
  }
  UIImage newImage=image.newStretchable(12,0);
  button.setBackgroundImage(newImage,UIControlState.Normal);
  UIImage newPressedImage=imagePressed.newStretchable(12,0);
  button.setBackgroundImage(newPressedImage,UIControlState.Highlighted);
  button.setBackgroundColor(UIColor.clear());
  return button;
}

Fixed version (ground truth):
/** 
 * Create button with provided parameters
 * @param title title of button
 * @param frame frame of button
 * @param image image in button
 * @param imagePressed state to show when image is pressed
 * @param darkTextColor should text of dark color be displayed
 * @return a new UIButton 
 */
private static UIButton newButton(String title,CGRect frame,UIImage image,UIImage imagePressed,boolean darkTextColor){
  UIButton button=new UIButton(frame);
  button.setContentVerticalAlignment(UIControlContentVerticalAlignment.Center);
  button.setContentHorizontalAlignment(UIControlContentHorizontalAlignment.Center);
  button.setTitle(title,UIControlState.Normal);
  if (darkTextColor) {
    button.setTitleColor(UIColor.black(),UIControlState.Normal);
  }
 else {
    button.setTitleColor(UIColor.white(),UIControlState.Normal);
  }
  UIImage newImage=image.createStretchable(12,0);
  button.setBackgroundImage(newImage,UIControlState.Normal);
  UIImage newPressedImage=imagePressed.createStretchable(12,0);
  button.setBackgroundImage(newPressedImage,UIControlState.Highlighted);
  button.setBackgroundColor(UIColor.clear());
  return button;
}