nus-yam/ex-repair huggingface dataset:
Program: 199029
Project: 199029
Buggy source:
public void panelExpansionChanged(PanelView panel,float frac){
  boolean fullyClosed=true;
  PanelView fullyOpenedPanel=null;
  if (DEBUG)   LOG("String_Node_Str",mState,panel.getName());
  mPanelExpandedFractionSum=0f;
  for (  PanelView pv : mPanels) {
    boolean visible=pv.getExpandedHeight() > 0;
    pv.setVisibility(visible ? View.VISIBLE : View.GONE);
    if (pv.getExpandedHeight() > 0f) {
      if (mState == STATE_CLOSED) {
        go(STATE_OPENING);
        onPanelPeeked();
      }
      fullyClosed=false;
      final float thisFrac=pv.getExpandedFraction();
      mPanelExpandedFractionSum+=(visible ? thisFrac : 0);
      if (DEBUG)       LOG("String_Node_Str",pv.getName(),thisFrac);
      if (panel == pv) {
        if (thisFrac == 1f)         fullyOpenedPanel=panel;
      }
    }
  }
  mPanelExpandedFractionSum/=mPanels.size();
  if (fullyOpenedPanel != null && !mTracking) {
    go(STATE_OPEN);
    onPanelFullyOpened(fullyOpenedPanel);
  }
 else   if (fullyClosed && !mTracking && mState != STATE_CLOSED) {
    go(STATE_CLOSED);
    onAllPanelsCollapsed();
  }
  if (DEBUG)   LOG("String_Node_Str",mState,(fullyOpenedPanel != null) ? "String_Node_Str" : "String_Node_Str",fullyClosed ? "String_Node_Str" : "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param panel the panel which changed its expansion state
 * @param frac the fraction from the expansion in [0, 1]
 * @param expanded whether the panel is currently expanded; this is independent from thefraction as the panel also might be expanded if the fraction is 0
 */
public void panelExpansionChanged(PanelView panel,float frac,boolean expanded){
  boolean fullyClosed=true;
  PanelView fullyOpenedPanel=null;
  if (DEBUG)   LOG("String_Node_Str",mState,panel.getName());
  mPanelExpandedFractionSum=0f;
  for (  PanelView pv : mPanels) {
    boolean visible=pv.getExpandedHeight() > 0;
    pv.setVisibility(visible ? View.VISIBLE : View.GONE);
    if (expanded) {
      if (mState == STATE_CLOSED) {
        go(STATE_OPENING);
        onPanelPeeked();
      }
      fullyClosed=false;
      final float thisFrac=pv.getExpandedFraction();
      mPanelExpandedFractionSum+=(visible ? thisFrac : 0);
      if (DEBUG)       LOG("String_Node_Str",pv.getName(),thisFrac);
      if (panel == pv) {
        if (thisFrac == 1f)         fullyOpenedPanel=panel;
      }
    }
  }
  mPanelExpandedFractionSum/=mPanels.size();
  if (fullyOpenedPanel != null && !mTracking) {
    go(STATE_OPEN);
    onPanelFullyOpened(fullyOpenedPanel);
  }
 else   if (fullyClosed && !mTracking && mState != STATE_CLOSED) {
    go(STATE_CLOSED);
    onAllPanelsCollapsed();
  }
  if (DEBUG)   LOG("String_Node_Str",mState,(fullyOpenedPanel != null) ? "String_Node_Str" : "String_Node_Str",fullyClosed ? "String_Node_Str" : "String_Node_Str");
}
Program: 199031
Project: 199031
Buggy source:
private InputStream getIconWithApi(String[] pathOut,String iconName){
  if (mSimulatedPlatformVersion == 0) {
    String path=pathOut[0];
    String dirName=path.substring(0,path.lastIndexOf('/'));
    pathOut[0]=dirName + "String_Node_Str" + "String_Node_Str"+ iconName;
    InputStream stream=getClass().getResourceAsStream(pathOut[0]);
    if (stream != null) {
      return stream;
    }
  }
  return getClass().getResourceAsStream(pathOut[0]);
}

Fixed version (ground truth):
private InputStream getIconWithApi(String[] pathOut,String iconName){
  if (mSimulatedPlatformVersion == 0) {
    String path=pathOut[0];
    String dirName=path.substring(0,path.lastIndexOf('/'));
    path=dirName + "String_Node_Str" + "String_Node_Str"+ iconName;
    InputStream stream=getClass().getResourceAsStream(path);
    if (stream != null) {
      pathOut[0]=path;
      return stream;
    }
  }
  return getClass().getResourceAsStream(pathOut[0]);
}
Program: 199032
Project: 199032
Buggy source:
/** 
 * A new GATT descriptor has been discovered. Finally, add the descriptor to the related characteristic. This should conclude the remote device update.
 * @hide
 */
public void onGetDescriptor(String address,int srvcType,int srvcInstId,ParcelUuid srvcUuid,int charInstId,ParcelUuid charUuid,int descrInstId,ParcelUuid descUuid){
  if (DBG)   Log.d(TAG,"String_Node_Str" + address + "String_Node_Str"+ descUuid);
  if (!address.equals(mDevice.getAddress())) {
    return;
  }
  BluetoothGattService service=getService(mDevice,srvcUuid.getUuid(),srvcInstId,srvcType);
  if (service == null)   return;
  BluetoothGattCharacteristic characteristic=service.getCharacteristic(charUuid.getUuid());
  if (characteristic == null)   return;
  characteristic.addDescriptor(new BluetoothGattDescriptor(characteristic,descUuid.getUuid(),descrInstId,0));
}

Fixed version (ground truth):
/** 
 * A new GATT descriptor has been discovered. Finally, add the descriptor to the related characteristic. This should conclude the remote device update.
 * @hide
 */
public void onGetDescriptor(String address,int srvcType,int srvcInstId,ParcelUuid srvcUuid,int charInstId,ParcelUuid charUuid,int descrInstId,ParcelUuid descUuid){
  if (DBG)   Log.d(TAG,"String_Node_Str" + address + "String_Node_Str"+ descUuid);
  if (!address.equals(mDevice.getAddress())) {
    return;
  }
  BluetoothGattService service=getService(mDevice,srvcUuid.getUuid(),srvcInstId,srvcType);
  if (service == null)   return;
  BluetoothGattCharacteristic characteristic=service.getCharacteristic(charUuid.getUuid(),charInstId);
  if (characteristic == null)   return;
  characteristic.addDescriptor(new BluetoothGattDescriptor(characteristic,descUuid.getUuid(),descrInstId,0));
}
Program: 199035
Project: 199035
Buggy source:
/** 
 * A new GATT descriptor has been discovered. Finally, add the descriptor to the related characteristic. This should conclude the remote device update.
 * @hide
 */
public void onGetDescriptor(String address,int srvcType,int srvcInstId,ParcelUuid srvcUuid,int charInstId,ParcelUuid charUuid,int descrInstId,ParcelUuid descUuid){
  if (DBG)   Log.d(TAG,"String_Node_Str" + address + "String_Node_Str"+ descUuid);
  if (!address.equals(mDevice.getAddress())) {
    return;
  }
  BluetoothGattService service=getService(mDevice,srvcUuid.getUuid(),srvcInstId,srvcType);
  if (service == null)   return;
  BluetoothGattCharacteristic characteristic=service.getCharacteristic(charUuid.getUuid());
  if (characteristic == null)   return;
  characteristic.addDescriptor(new BluetoothGattDescriptor(characteristic,descUuid.getUuid(),descrInstId,0));
}

Fixed version (ground truth):
/** 
 * A new GATT descriptor has been discovered. Finally, add the descriptor to the related characteristic. This should conclude the remote device update.
 * @hide
 */
public void onGetDescriptor(String address,int srvcType,int srvcInstId,ParcelUuid srvcUuid,int charInstId,ParcelUuid charUuid,int descrInstId,ParcelUuid descUuid){
  if (DBG)   Log.d(TAG,"String_Node_Str" + address + "String_Node_Str"+ descUuid);
  if (!address.equals(mDevice.getAddress())) {
    return;
  }
  BluetoothGattService service=getService(mDevice,srvcUuid.getUuid(),srvcInstId,srvcType);
  if (service == null)   return;
  BluetoothGattCharacteristic characteristic=service.getCharacteristic(charUuid.getUuid(),charInstId);
  if (characteristic == null)   return;
  characteristic.addDescriptor(new BluetoothGattDescriptor(characteristic,descUuid.getUuid(),descrInstId,0));
}
Program: 199036
Project: 199036
Buggy source:
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  if (keyCode == KeyEvent.KEYCODE_TAB) {
    final boolean backward=event.isShiftPressed();
    mRecentsView.focusNextTask(!backward);
    return true;
  }
  return super.onKeyDown(keyCode,event);
}

Fixed version (ground truth):
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  if (keyCode == KeyEvent.KEYCODE_TAB) {
    final boolean backward=event.isShiftPressed();
    mRecentsView.focusNextTask(!backward);
    return true;
  }
  mDebugTrigger.onKeyEvent(keyCode);
  return super.onKeyDown(keyCode,event);
}
Program: 199037
Project: 199037
Buggy source:
public void onEnterAnimationTriggered(){
  mScrimViews.startEnterRecentsAnimation();
}

Fixed version (ground truth):
/** 
 * Called when the enter recents animation is triggered. 
 */
public void onEnterAnimationTriggered(){
  mScrimViews.startEnterRecentsAnimation();
}
Program: 199038
Project: 199038
Buggy source:
@Override public void run(){
  AlternateRecentsComponent.notifyVisibilityChanged(false);
  if (mLaunchIntent != null) {
    if (mLaunchOpts != null) {
      startActivityAsUser(mLaunchIntent,new UserHandle(UserHandle.USER_CURRENT));
    }
 else {
      startActivityAsUser(mLaunchIntent,mLaunchOpts.toBundle(),new UserHandle(UserHandle.USER_CURRENT));
    }
  }
 else {
    finish();
    if (mUseCustomFinishTransition) {
      overridePendingTransition(R.anim.recents_to_launcher_enter,R.anim.recents_to_launcher_exit);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  onDebugModeTriggered();
}
Program: 199039
Project: 199039
Buggy source:
@Override public void onAttachedToWindow(){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.SystemUIHandshake,"String_Node_Str","String_Node_Str",Console.AnsiRed);
  }
  super.onAttachedToWindow();
  IntentFilter filter=new IntentFilter();
  filter.addAction(RecentsService.ACTION_HIDE_RECENTS_ACTIVITY);
  filter.addAction(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
  filter.addAction(RecentsService.ACTION_START_ENTER_ANIMATION);
  registerReceiver(mServiceBroadcastReceiver,filter);
  filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  registerReceiver(mScreenOffReceiver,filter);
  RecentsTaskLoader.getInstance().registerReceivers(this,mRecentsView);
  if (mConfig.searchBarAppWidgetId >= 0) {
    mAppWidgetHost.startListening(this);
  }
}

Fixed version (ground truth):
@Override public void onAttachedToWindow(){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.SystemUIHandshake,"String_Node_Str","String_Node_Str",Console.AnsiRed);
  }
  super.onAttachedToWindow();
  IntentFilter filter=new IntentFilter();
  filter.addAction(RecentsService.ACTION_HIDE_RECENTS_ACTIVITY);
  filter.addAction(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
  filter.addAction(RecentsService.ACTION_START_ENTER_ANIMATION);
  filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
  registerReceiver(mServiceBroadcastReceiver,filter);
  filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  registerReceiver(mScreenOffReceiver,filter);
  RecentsTaskLoader.getInstance().registerReceivers(this,mRecentsView);
  if (mConfig.searchBarAppWidgetId >= 0) {
    mAppWidgetHost.startListening(this);
  }
}
Program: 199041
Project: 199041
Buggy source:
/** 
 * Calculates the luminance-preserved greyscale of a given color. 
 */
private static int colorToGreyscale(int color){
  return Math.round(0.2126f * Color.red(color) + 0.7152f * Color.green(color) + 0.0722f * Color.blue(color));
}

Fixed version (ground truth):
/** 
 * Calculates the luminance-preserved greyscale of a given color. 
 */
public static int colorToGreyscale(int color){
  return Math.round(0.2126f * Color.red(color) + 0.7152f * Color.green(color) + 0.0722f * Color.blue(color));
}
Program: 199042
Project: 199042
Buggy source:
@Override public void run(){
  t.notifyTaskDataLoaded(newThumbnail,newIcon,forceLoadTask);
}

Fixed version (ground truth):
@Override public void run(){
  t.notifyTaskDataLoaded(newThumbnail,newIcon);
}
Program: 199044
Project: 199044
Buggy source:
/** 
 * Acquires the task resource data from the pool. 
 */
public void loadTaskData(Task t){
  Drawable applicationIcon=mApplicationIconCache.get(t.key);
  Bitmap thumbnail=mThumbnailCache.get(t.key);
  if (Console.Enabled) {
    Console.log(Constants.Log.App.TaskDataLoader,"String_Node_Str",t + "String_Node_Str" + applicationIcon+ "String_Node_Str"+ thumbnail+ "String_Node_Str"+ mThumbnailCache.size());
  }
  boolean requiresLoad=false;
  if (applicationIcon == null) {
    applicationIcon=mDefaultApplicationIcon;
    requiresLoad=true;
  }
  if (thumbnail == null) {
    thumbnail=mLoadingThumbnail;
    requiresLoad=true;
  }
  if (requiresLoad) {
    mLoadQueue.addTask(t,false);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon,false);
}

Fixed version (ground truth):
/** 
 * Acquires the task resource data directly from the pool. 
 */
public void loadTaskData(Task t){
  Drawable applicationIcon=mApplicationIconCache.get(t.key);
  Bitmap thumbnail=mThumbnailCache.get(t.key);
  if (Console.Enabled) {
    Console.log(Constants.Log.App.TaskDataLoader,"String_Node_Str",t + "String_Node_Str" + applicationIcon+ "String_Node_Str"+ thumbnail+ "String_Node_Str"+ mThumbnailCache.size());
  }
  boolean requiresLoad=false;
  if (applicationIcon == null) {
    applicationIcon=mDefaultApplicationIcon;
    requiresLoad=true;
  }
  if (thumbnail == null) {
    thumbnail=mLoadingThumbnail;
    requiresLoad=true;
  }
  if (requiresLoad) {
    mLoadQueue.addTask(t,false);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon);
}
Program: 199045
Project: 199045
Buggy source:
public Task(int id,boolean isActive,Intent intent,String activityTitle,BitmapDrawable activityIcon,int colorPrimary,int userId,long lastActiveTime){
  this.key=new TaskKey(id,intent,userId,lastActiveTime);
  this.activityLabel=activityTitle;
  this.activityIcon=activityIcon;
  this.colorPrimary=colorPrimary;
  this.isActive=isActive;
  this.userId=userId;
}

Fixed version (ground truth):
public Task(int id,boolean isActive,Intent intent,String activityTitle,BitmapDrawable activityIcon,int colorPrimary,int userId,long lastActiveTime){
  this.key=new TaskKey(id,intent,userId,lastActiveTime);
  this.activityLabel=activityTitle;
  this.activityIcon=activityIcon;
  this.colorPrimary=colorPrimary;
  this.colorPrimaryGreyscale=Utilities.colorToGreyscale(colorPrimary);
  this.isActive=isActive;
  this.userId=userId;
}
Program: 199046
Project: 199046
Buggy source:
public void onTaskDataLoaded(boolean reloadingTaskData);

Fixed version (ground truth):
public void onTaskDataLoaded();
Program: 199047
Project: 199047
Buggy source:
/** 
 * Notifies the callback listeners that this task has been loaded 
 */
public void notifyTaskDataLoaded(Bitmap thumbnail,Drawable applicationIcon,boolean reloadingTaskData){
  this.applicationIcon=applicationIcon;
  this.thumbnail=thumbnail;
  if (mCb != null) {
    mCb.onTaskDataLoaded(reloadingTaskData);
  }
}

Fixed version (ground truth):
/** 
 * Notifies the callback listeners that this task has been loaded 
 */
public void notifyTaskDataLoaded(Bitmap thumbnail,Drawable applicationIcon){
  this.applicationIcon=applicationIcon;
  this.thumbnail=thumbnail;
  if (mCb != null) {
    mCb.onTaskDataLoaded();
  }
}
Program: 199048
Project: 199048
Buggy source:
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  if (keyCode == KeyEvent.KEYCODE_TAB) {
    final boolean backward=event.isShiftPressed();
    mRecentsView.focusNextTask(!backward);
    return true;
  }
  return super.onKeyDown(keyCode,event);
}

Fixed version (ground truth):
@Override public boolean onKeyDown(int keyCode,KeyEvent event){
  if (keyCode == KeyEvent.KEYCODE_TAB) {
    final boolean backward=event.isShiftPressed();
    mRecentsView.focusNextTask(!backward);
    return true;
  }
  mDebugTrigger.onKeyEvent(keyCode);
  return super.onKeyDown(keyCode,event);
}
Program: 199049
Project: 199049
Buggy source:
public void onEnterAnimationTriggered(){
  mScrimViews.startEnterRecentsAnimation();
}

Fixed version (ground truth):
/** 
 * Called when the enter recents animation is triggered. 
 */
public void onEnterAnimationTriggered(){
  mScrimViews.startEnterRecentsAnimation();
}
Program: 199050
Project: 199050
Buggy source:
@Override public void run(){
  AlternateRecentsComponent.notifyVisibilityChanged(false);
  if (mLaunchIntent != null) {
    if (mLaunchOpts != null) {
      startActivityAsUser(mLaunchIntent,new UserHandle(UserHandle.USER_CURRENT));
    }
 else {
      startActivityAsUser(mLaunchIntent,mLaunchOpts.toBundle(),new UserHandle(UserHandle.USER_CURRENT));
    }
  }
 else {
    finish();
    if (mUseCustomFinishTransition) {
      overridePendingTransition(R.anim.recents_to_launcher_enter,R.anim.recents_to_launcher_exit);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  onDebugModeTriggered();
}
Program: 199051
Project: 199051
Buggy source:
@Override public void onAttachedToWindow(){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.SystemUIHandshake,"String_Node_Str","String_Node_Str",Console.AnsiRed);
  }
  super.onAttachedToWindow();
  IntentFilter filter=new IntentFilter();
  filter.addAction(RecentsService.ACTION_HIDE_RECENTS_ACTIVITY);
  filter.addAction(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
  filter.addAction(RecentsService.ACTION_START_ENTER_ANIMATION);
  registerReceiver(mServiceBroadcastReceiver,filter);
  filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  registerReceiver(mScreenOffReceiver,filter);
  RecentsTaskLoader.getInstance().registerReceivers(this,mRecentsView);
  if (mConfig.searchBarAppWidgetId >= 0) {
    mAppWidgetHost.startListening(this);
  }
}

Fixed version (ground truth):
@Override public void onAttachedToWindow(){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.SystemUIHandshake,"String_Node_Str","String_Node_Str",Console.AnsiRed);
  }
  super.onAttachedToWindow();
  IntentFilter filter=new IntentFilter();
  filter.addAction(RecentsService.ACTION_HIDE_RECENTS_ACTIVITY);
  filter.addAction(RecentsService.ACTION_TOGGLE_RECENTS_ACTIVITY);
  filter.addAction(RecentsService.ACTION_START_ENTER_ANIMATION);
  filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
  registerReceiver(mServiceBroadcastReceiver,filter);
  filter=new IntentFilter();
  filter.addAction(Intent.ACTION_SCREEN_OFF);
  registerReceiver(mScreenOffReceiver,filter);
  RecentsTaskLoader.getInstance().registerReceivers(this,mRecentsView);
  if (mConfig.searchBarAppWidgetId >= 0) {
    mAppWidgetHost.startListening(this);
  }
}
Program: 199053
Project: 199053
Buggy source:
/** 
 * Calculates the luminance-preserved greyscale of a given color. 
 */
private static int colorToGreyscale(int color){
  return Math.round(0.2126f * Color.red(color) + 0.7152f * Color.green(color) + 0.0722f * Color.blue(color));
}

Fixed version (ground truth):
/** 
 * Calculates the luminance-preserved greyscale of a given color. 
 */
public static int colorToGreyscale(int color){
  return Math.round(0.2126f * Color.red(color) + 0.7152f * Color.green(color) + 0.0722f * Color.blue(color));
}
Program: 199054
Project: 199054
Buggy source:
@Override public void run(){
  t.notifyTaskDataLoaded(newThumbnail,newIcon,forceLoadTask);
}

Fixed version (ground truth):
@Override public void run(){
  t.notifyTaskDataLoaded(newThumbnail,newIcon);
}
Program: 199056
Project: 199056
Buggy source:
/** 
 * Acquires the task resource data from the pool. 
 */
public void loadTaskData(Task t){
  Drawable applicationIcon=mApplicationIconCache.get(t.key);
  Bitmap thumbnail=mThumbnailCache.get(t.key);
  if (Console.Enabled) {
    Console.log(Constants.Log.App.TaskDataLoader,"String_Node_Str",t + "String_Node_Str" + applicationIcon+ "String_Node_Str"+ thumbnail+ "String_Node_Str"+ mThumbnailCache.size());
  }
  boolean requiresLoad=false;
  if (applicationIcon == null) {
    applicationIcon=mDefaultApplicationIcon;
    requiresLoad=true;
  }
  if (thumbnail == null) {
    thumbnail=mLoadingThumbnail;
    requiresLoad=true;
  }
  if (requiresLoad) {
    mLoadQueue.addTask(t,false);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon,false);
}

Fixed version (ground truth):
/** 
 * Acquires the task resource data directly from the pool. 
 */
public void loadTaskData(Task t){
  Drawable applicationIcon=mApplicationIconCache.get(t.key);
  Bitmap thumbnail=mThumbnailCache.get(t.key);
  if (Console.Enabled) {
    Console.log(Constants.Log.App.TaskDataLoader,"String_Node_Str",t + "String_Node_Str" + applicationIcon+ "String_Node_Str"+ thumbnail+ "String_Node_Str"+ mThumbnailCache.size());
  }
  boolean requiresLoad=false;
  if (applicationIcon == null) {
    applicationIcon=mDefaultApplicationIcon;
    requiresLoad=true;
  }
  if (thumbnail == null) {
    thumbnail=mLoadingThumbnail;
    requiresLoad=true;
  }
  if (requiresLoad) {
    mLoadQueue.addTask(t,false);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon);
}
Program: 199057
Project: 199057
Buggy source:
public Task(int id,boolean isActive,Intent intent,String activityTitle,BitmapDrawable activityIcon,int colorPrimary,int userId,long lastActiveTime){
  this.key=new TaskKey(id,intent,userId,lastActiveTime);
  this.activityLabel=activityTitle;
  this.activityIcon=activityIcon;
  this.colorPrimary=colorPrimary;
  this.isActive=isActive;
  this.userId=userId;
}

Fixed version (ground truth):
public Task(int id,boolean isActive,Intent intent,String activityTitle,BitmapDrawable activityIcon,int colorPrimary,int userId,long lastActiveTime){
  this.key=new TaskKey(id,intent,userId,lastActiveTime);
  this.activityLabel=activityTitle;
  this.activityIcon=activityIcon;
  this.colorPrimary=colorPrimary;
  this.colorPrimaryGreyscale=Utilities.colorToGreyscale(colorPrimary);
  this.isActive=isActive;
  this.userId=userId;
}
Program: 199058
Project: 199058
Buggy source:
public void onTaskDataLoaded(boolean reloadingTaskData);

Fixed version (ground truth):
public void onTaskDataLoaded();
Program: 199059
Project: 199059
Buggy source:
/** 
 * Notifies the callback listeners that this task has been loaded 
 */
public void notifyTaskDataLoaded(Bitmap thumbnail,Drawable applicationIcon,boolean reloadingTaskData){
  this.applicationIcon=applicationIcon;
  this.thumbnail=thumbnail;
  if (mCb != null) {
    mCb.onTaskDataLoaded(reloadingTaskData);
  }
}

Fixed version (ground truth):
/** 
 * Notifies the callback listeners that this task has been loaded 
 */
public void notifyTaskDataLoaded(Bitmap thumbnail,Drawable applicationIcon){
  this.applicationIcon=applicationIcon;
  this.thumbnail=thumbnail;
  if (mCb != null) {
    mCb.onTaskDataLoaded();
  }
}
Program: 199061
Project: 199061
Buggy source:
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && length != 0 && magic != 0 && flag == 1 && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}
Program: 199063
Project: 199063
Buggy source:
private InputStream getIconWithApi(String[] pathOut,String iconName){
  if (mSimulatedPlatformVersion == 0) {
    String path=pathOut[0];
    String dirName=path.substring(0,path.lastIndexOf('/'));
    pathOut[0]=dirName + "String_Node_Str" + "String_Node_Str"+ iconName;
    InputStream stream=getClass().getResourceAsStream(pathOut[0]);
    if (stream != null) {
      return stream;
    }
  }
  return getClass().getResourceAsStream(pathOut[0]);
}

Fixed version (ground truth):
private InputStream getIconWithApi(String[] pathOut,String iconName){
  if (mSimulatedPlatformVersion == 0) {
    String path=pathOut[0];
    String dirName=path.substring(0,path.lastIndexOf('/'));
    path=dirName + "String_Node_Str" + "String_Node_Str"+ iconName;
    InputStream stream=getClass().getResourceAsStream(path);
    if (stream != null) {
      pathOut[0]=path;
      return stream;
    }
  }
  return getClass().getResourceAsStream(pathOut[0]);
}
Program: 199064
Project: 199064
Buggy source:
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && length != 0 && magic != 0 && flag == 1 && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}
Program: 199065
Project: 199065
Buggy source:
private InputStream getIconWithApi(String[] pathOut,String iconName){
  if (mSimulatedPlatformVersion == 0) {
    String path=pathOut[0];
    String dirName=path.substring(0,path.lastIndexOf('/'));
    pathOut[0]=dirName + "String_Node_Str" + "String_Node_Str"+ iconName;
    InputStream stream=getClass().getResourceAsStream(pathOut[0]);
    if (stream != null) {
      return stream;
    }
  }
  return getClass().getResourceAsStream(pathOut[0]);
}

Fixed version (ground truth):
private InputStream getIconWithApi(String[] pathOut,String iconName){
  if (mSimulatedPlatformVersion == 0) {
    String path=pathOut[0];
    String dirName=path.substring(0,path.lastIndexOf('/'));
    path=dirName + "String_Node_Str" + "String_Node_Str"+ iconName;
    InputStream stream=getClass().getResourceAsStream(path);
    if (stream != null) {
      pathOut[0]=path;
      return stream;
    }
  }
  return getClass().getResourceAsStream(pathOut[0]);
}
Program: 199066
Project: 199066
Buggy source:
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && length != 0 && magic != 0 && flag == 1 && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}
Program: 199067
Project: 199067
Buggy source:
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && length != 0 && magic != 0 && flag == 1 && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}
Program: 199068
Project: 199068
Buggy source:
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gallery app can use this method to retrieve mini-thumbnail. Full size images share the same IDs with their corresponding thumbnails.
 * @param id the ID of the image (same of full size image).
 * @param data the buffer to store mini-thumbnail.
 */
public synchronized byte[] getMiniThumbFromFile(long id,byte[] data){
  RandomAccessFile r=miniThumbDataFile();
  if (r == null)   return null;
  long pos=id * BYTES_PER_MINTHUMB;
  FileLock lock=null;
  try {
    mBuffer.clear();
    lock=mChannel.lock(pos,BYTES_PER_MINTHUMB,true);
    int size=mChannel.read(mBuffer,pos);
    if (size > 1 + 8 + 4) {
      mBuffer.position(0);
      byte flag=mBuffer.get();
      long magic=mBuffer.getLong();
      int length=mBuffer.getInt();
      if (size >= 1 + 8 + 4+ length && length != 0 && magic != 0 && flag == 1 && data.length >= length) {
        mBuffer.get(data,0,length);
        return data;
      }
    }
  }
 catch (  IOException ex) {
    Log.w(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex);
  }
catch (  RuntimeException ex) {
    Log.e(TAG,"String_Node_Str" + id + "String_Node_Str"+ ex.getClass());
  }
 finally {
    try {
      if (lock != null)       lock.release();
    }
 catch (    IOException ex) {
    }
  }
  return null;
}
Program: 199069
Project: 199069
Buggy source:
/** 
 * Terminate instrumentation of the application.  This will cause the application process to exit, removing this instrumentation from the next time the application is started. 
 * @param resultCode Overall success/failure of instrumentation. 
 * @param results Any results to send back to the code that started the instrumentation.
 */
public void finish(int resultCode,Bundle results){
  if (mAutomaticPerformanceSnapshots) {
    endPerformanceSnapshot();
  }
  if (mPerfMetrics != null) {
    results.putAll(mPerfMetrics);
  }
  if (mUiAutomation != null) {
    mUiAutomation.disconnect();
    mUiAutomation=null;
  }
  mThread.finishInstrumentation(resultCode,results);
}

Fixed version (ground truth):
/** 
 * Terminate instrumentation of the application.  This will cause the application process to exit, removing this instrumentation from the next time the application is started. 
 * @param resultCode Overall success/failure of instrumentation. 
 * @param results Any results to send back to the code that started the instrumentation.
 */
public void finish(int resultCode,Bundle results){
  if (mAutomaticPerformanceSnapshots) {
    endPerformanceSnapshot();
  }
  if (mPerfMetrics != null) {
    if (results == null) {
      results=new Bundle();
    }
    results.putAll(mPerfMetrics);
  }
  if (mUiAutomation != null) {
    mUiAutomation.disconnect();
    mUiAutomation=null;
  }
  mThread.finishInstrumentation(resultCode,results);
}
Program: 199070
Project: 199070
Buggy source:
/** 
 * Terminate instrumentation of the application.  This will cause the application process to exit, removing this instrumentation from the next time the application is started. 
 * @param resultCode Overall success/failure of instrumentation. 
 * @param results Any results to send back to the code that started the instrumentation.
 */
public void finish(int resultCode,Bundle results){
  if (mAutomaticPerformanceSnapshots) {
    endPerformanceSnapshot();
  }
  if (mPerfMetrics != null) {
    results.putAll(mPerfMetrics);
  }
  if (mUiAutomation != null) {
    mUiAutomation.disconnect();
    mUiAutomation=null;
  }
  mThread.finishInstrumentation(resultCode,results);
}

Fixed version (ground truth):
/** 
 * Terminate instrumentation of the application.  This will cause the application process to exit, removing this instrumentation from the next time the application is started. 
 * @param resultCode Overall success/failure of instrumentation. 
 * @param results Any results to send back to the code that started the instrumentation.
 */
public void finish(int resultCode,Bundle results){
  if (mAutomaticPerformanceSnapshots) {
    endPerformanceSnapshot();
  }
  if (mPerfMetrics != null) {
    if (results == null) {
      results=new Bundle();
    }
    results.putAll(mPerfMetrics);
  }
  if (mUiAutomation != null) {
    mUiAutomation.disconnect();
    mUiAutomation=null;
  }
  mThread.finishInstrumentation(resultCode,results);
}
Program: 199071
Project: 199071
Buggy source:
/** 
 * Handle message sent by   {@link #showLocked}.
 * @see #SHOW
 */
private void handleShow(Bundle options){
synchronized (KeyguardViewMediator.this) {
    if (!mSystemReady) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      return;
    }
 else {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
    }
    mStatusBarKeyguardViewManager.show(options);
    mShowing=true;
    mKeyguardDonePending=false;
    updateActivityLockScreenState();
    adjustStatusBarLocked();
    userActivity();
    playSounds(true);
    mShowKeyguardWakeLock.release();
  }
  mKeyguardDisplayManager.show();
}

Fixed version (ground truth):
/** 
 * Handle message sent by   {@link #showLocked}.
 * @see #SHOW
 */
private void handleShow(Bundle options){
synchronized (KeyguardViewMediator.this) {
    if (!mSystemReady) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      return;
    }
 else {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
    }
    mStatusBarKeyguardViewManager.show(options);
    mHiding=false;
    mShowing=true;
    mKeyguardDonePending=false;
    updateActivityLockScreenState();
    adjustStatusBarLocked();
    userActivity();
    playSounds(true);
    mShowKeyguardWakeLock.release();
  }
  mKeyguardDisplayManager.show();
}
Program: 199072
Project: 199072
Buggy source:
private void handleStartKeyguardExitAnimation(long startTime,long fadeoutDuration){
synchronized (KeyguardViewMediator.this) {
    if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) {
      playSounds(false);
    }
    mStatusBarKeyguardViewManager.hide(startTime,fadeoutDuration);
    mShowing=false;
    mKeyguardDonePending=false;
    updateActivityLockScreenState();
    adjustStatusBarLocked();
  }
}

Fixed version (ground truth):
private void handleStartKeyguardExitAnimation(long startTime,long fadeoutDuration){
synchronized (KeyguardViewMediator.this) {
    if (!mHiding) {
      return;
    }
    mHiding=false;
    if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) {
      playSounds(false);
    }
    mStatusBarKeyguardViewManager.hide(startTime,fadeoutDuration);
    mShowing=false;
    mKeyguardDonePending=false;
    updateActivityLockScreenState();
    adjustStatusBarLocked();
  }
}
Program: 199073
Project: 199073
Buggy source:
/** 
 * Handle message sent by   {@link #hideLocked()}
 * @see #HIDE
 */
private void handleHide(){
synchronized (KeyguardViewMediator.this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      if (mShowing) {
        mWM.keyguardGoingAway();
      }
 else {
        handleStartKeyguardExitAnimation(0,0);
      }
    }
 catch (    RemoteException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Handle message sent by   {@link #hideLocked()}
 * @see #HIDE
 */
private void handleHide(){
synchronized (KeyguardViewMediator.this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      mHiding=true;
      if (mShowing) {
        mWM.keyguardGoingAway();
      }
 else {
        handleStartKeyguardExitAnimation(0,0);
      }
    }
 catch (    RemoteException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
}
Program: 199075
Project: 199075
Buggy source:
/** 
 * Handle message sent by   {@link #showLocked}.
 * @see #SHOW
 */
private void handleShow(Bundle options){
synchronized (KeyguardViewMediator.this) {
    if (!mSystemReady) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      return;
    }
 else {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
    }
    mStatusBarKeyguardViewManager.show(options);
    mShowing=true;
    mKeyguardDonePending=false;
    updateActivityLockScreenState();
    adjustStatusBarLocked();
    userActivity();
    playSounds(true);
    mShowKeyguardWakeLock.release();
  }
  mKeyguardDisplayManager.show();
}

Fixed version (ground truth):
/** 
 * Handle message sent by   {@link #showLocked}.
 * @see #SHOW
 */
private void handleShow(Bundle options){
synchronized (KeyguardViewMediator.this) {
    if (!mSystemReady) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      return;
    }
 else {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
    }
    mStatusBarKeyguardViewManager.show(options);
    mHiding=false;
    mShowing=true;
    mKeyguardDonePending=false;
    updateActivityLockScreenState();
    adjustStatusBarLocked();
    userActivity();
    playSounds(true);
    mShowKeyguardWakeLock.release();
  }
  mKeyguardDisplayManager.show();
}
Program: 199076
Project: 199076
Buggy source:
private void handleStartKeyguardExitAnimation(long startTime,long fadeoutDuration){
synchronized (KeyguardViewMediator.this) {
    if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) {
      playSounds(false);
    }
    mStatusBarKeyguardViewManager.hide(startTime,fadeoutDuration);
    mShowing=false;
    mKeyguardDonePending=false;
    updateActivityLockScreenState();
    adjustStatusBarLocked();
  }
}

Fixed version (ground truth):
private void handleStartKeyguardExitAnimation(long startTime,long fadeoutDuration){
synchronized (KeyguardViewMediator.this) {
    if (!mHiding) {
      return;
    }
    mHiding=false;
    if (TelephonyManager.EXTRA_STATE_IDLE.equals(mPhoneState)) {
      playSounds(false);
    }
    mStatusBarKeyguardViewManager.hide(startTime,fadeoutDuration);
    mShowing=false;
    mKeyguardDonePending=false;
    updateActivityLockScreenState();
    adjustStatusBarLocked();
  }
}
Program: 199077
Project: 199077
Buggy source:
/** 
 * Handle message sent by   {@link #hideLocked()}
 * @see #HIDE
 */
private void handleHide(){
synchronized (KeyguardViewMediator.this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      if (mShowing) {
        mWM.keyguardGoingAway();
      }
 else {
        handleStartKeyguardExitAnimation(0,0);
      }
    }
 catch (    RemoteException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Handle message sent by   {@link #hideLocked()}
 * @see #HIDE
 */
private void handleHide(){
synchronized (KeyguardViewMediator.this) {
    if (DEBUG)     Log.d(TAG,"String_Node_Str");
    try {
      mHiding=true;
      if (mShowing) {
        mWM.keyguardGoingAway();
      }
 else {
        handleStartKeyguardExitAnimation(0,0);
      }
    }
 catch (    RemoteException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
}