nus-yam/ex-repair huggingface dataset:
Program: 198919
Project: 198919
Buggy source:
@Override public void run(){
  if (task.isActive) {
    RecentsTaskLoader.getInstance().getSystemServicesProxy().moveTaskToFront(task.key.id,launchOpts);
  }
 else {
    Intent i=new Intent(task.key.baseIntent);
    i.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
    if ((i.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == 0) {
      i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    }
    try {
      UserHandle taskUser=new UserHandle(task.userId);
      if (launchOpts != null) {
        getContext().startActivityAsUser(i,launchOpts.toBundle(),taskUser);
      }
 else {
        getContext().startActivityAsUser(i,taskUser);
        if (lockToTask) {
          ssp.lockCurrentTask();
        }
      }
    }
 catch (    ActivityNotFoundException anfe) {
      Console.logError(getContext(),"String_Node_Str");
    }
    onTaskViewDismissed(task);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (task.isActive) {
    RecentsTaskLoader.getInstance().getSystemServicesProxy().moveTaskToFront(task.key.id,launchOpts);
  }
 else {
    Intent i=new Intent(task.key.baseIntent);
    i.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
    if (!Utilities.isDocument(i)) {
      i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    }
    try {
      UserHandle taskUser=new UserHandle(task.userId);
      if (launchOpts != null) {
        getContext().startActivityAsUser(i,launchOpts.toBundle(),taskUser);
      }
 else {
        getContext().startActivityAsUser(i,taskUser);
        if (lockToTask) {
          ssp.lockCurrentTask();
        }
      }
    }
 catch (    ActivityNotFoundException anfe) {
      Console.logError(getContext(),"String_Node_Str");
    }
    onTaskViewDismissed(task);
  }
}
Program: 198920
Project: 198920
Buggy source:
@Override public void onTaskViewDismissed(Task t){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.deleteTaskData(t,false);
  int flags=t.key.baseIntent.getFlags();
  boolean isDocument=(flags & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
  RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id,isDocument);
}

Fixed version (ground truth):
@Override public void onTaskViewDismissed(Task t){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.deleteTaskData(t,false);
  RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id,Utilities.isDocument(t.key.baseIntent));
}
Program: 198921
Project: 198921
Buggy source:
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    setStackScroll(mScroller.getCurrY());
    if (mScroller.isFinished()) {
      decHwLayersRefCount("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void computeScroll(){
  if (mScroller.computeScrollOffset()) {
    setStackScroll(mScroller.getCurrY());
    invalidate();
    if (mScroller.isFinished()) {
      decHwLayersRefCount("String_Node_Str");
    }
  }
}
Program: 198922
Project: 198922
Buggy source:
/** 
 * Removes all the entries in the cache. 
 */
final void evictAll(){
  mCache.evictAll();
  mKeys.clear();
}

Fixed version (ground truth):
/** 
 * Removes all the entries in the cache. 
 */
final void evictAll(){
  mCache.evictAll();
  mTaskKeys.clear();
}
Program: 198923
Project: 198923
Buggy source:
@Override protected int sizeOf(Task.TaskKey t,V v){
  return computeSize(v);
}

Fixed version (ground truth):
@Override protected int sizeOf(Integer taskId,V v){
  return computeSize(v);
}
Program: 198924
Project: 198924
Buggy source:
/** 
 * Gets a specific entry in the cache. 
 */
final V get(Task.TaskKey key){
  return mCache.get(key);
}

Fixed version (ground truth):
/** 
 * Gets a specific entry in the cache. 
 */
final V get(Task.TaskKey key){
  return mCache.get(key.id);
}
Program: 198925
Project: 198925
Buggy source:
public KeyStoreLruCache(int cacheSize){
  mCache=new LruCache<Task.TaskKey,V>(cacheSize){
    @Override protected int sizeOf(    Task.TaskKey t,    V v){
      return computeSize(v);
    }
    @Override protected void entryRemoved(    boolean evicted,    Task.TaskKey key,    V oldV,    V newV){
      mKeys.remove(key);
    }
  }
;
}

Fixed version (ground truth):
public KeyStoreLruCache(int cacheSize){
  mCache=new LruCache<Integer,V>(cacheSize){
    @Override protected int sizeOf(    Integer taskId,    V v){
      return computeSize(v);
    }
    @Override protected void entryRemoved(    boolean evicted,    Integer taskId,    V oldV,    V newV){
      mTaskKeys.remove(taskId);
    }
  }
;
}
Program: 198926
Project: 198926
Buggy source:
@Override protected void entryRemoved(boolean evicted,Task.TaskKey key,V oldV,V newV){
  mKeys.remove(key);
}

Fixed version (ground truth):
@Override protected void entryRemoved(boolean evicted,Integer taskId,V oldV,V newV){
  mTaskKeys.remove(taskId);
}
Program: 198927
Project: 198927
Buggy source:
/** 
 * Puts an entry in the cache for a specific key. 
 */
final void put(Task.TaskKey key,V value){
  mCache.put(key,value);
  if (mKeys.containsKey(key)) {
    mKeys.get(key).updateLastActiveTime(key.lastActiveTime);
  }
 else {
    mKeys.put(key,key);
  }
}

Fixed version (ground truth):
/** 
 * Puts an entry in the cache for a specific key. 
 */
final void put(Task.TaskKey key,V value){
  mCache.put(key.id,value);
  mTaskKeys.put(key.id,key);
}
Program: 198928
Project: 198928
Buggy source:
/** 
 * Removes a cache entry for a specific key. 
 */
final void remove(Task.TaskKey key){
  mCache.remove(key);
  mKeys.remove(key);
}

Fixed version (ground truth):
/** 
 * Removes a cache entry for a specific key. 
 */
final void remove(Task.TaskKey key){
  mCache.remove(key.id);
  mTaskKeys.remove(key.id);
}
Program: 198930
Project: 198930
Buggy source:
/** 
 * 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);
  boolean requiresLoad=false;
  if (applicationIcon == null) {
    applicationIcon=mDefaultApplicationIcon;
    requiresLoad=true;
  }
  if (thumbnail == null) {
    thumbnail=mLoadingThumbnail;
    requiresLoad=true;
  }
  if (requiresLoad) {
    mLoadQueue.addTask(t);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon);
}

Fixed version (ground truth):
/** 
 * Acquires the task resource data directly from the pool. 
 */
public void loadTaskData(Task t){
  Drawable applicationIcon=mApplicationIconCache.getAndInvalidateIfModified(t.key);
  Bitmap thumbnail=mThumbnailCache.getAndInvalidateIfModified(t.key);
  boolean requiresLoad=(applicationIcon == null) || (thumbnail == null);
  applicationIcon=applicationIcon != null ? applicationIcon : mDefaultApplicationIcon;
  thumbnail=thumbnail != null ? thumbnail : mDefaultThumbnail;
  if (requiresLoad) {
    mLoadQueue.addTask(t);
  }
  t.notifyTaskDataLoaded(thumbnail,applicationIcon);
}
Program: 198931
Project: 198931
Buggy source:
private static List<ActivityManager.RecentTaskInfo> getRecentTasks(SystemServicesProxy ssp){
  List<ActivityManager.RecentTaskInfo> tasks=ssp.getRecentTasks(50,UserHandle.CURRENT.getIdentifier());
  Collections.reverse(tasks);
  return tasks;
}

Fixed version (ground truth):
/** 
 * Gets the list of recent tasks, ordered from back to front. 
 */
private static List<ActivityManager.RecentTaskInfo> getRecentTasks(SystemServicesProxy ssp){
  List<ActivityManager.RecentTaskInfo> tasks=ssp.getRecentTasks(50,UserHandle.CURRENT.getIdentifier());
  Collections.reverse(tasks);
  return tasks;
}
Program: 198933
Project: 198933
Buggy source:
@Override public void run(){
  if (task.isActive) {
    RecentsTaskLoader.getInstance().getSystemServicesProxy().moveTaskToFront(task.key.id,launchOpts);
  }
 else {
    Intent i=new Intent(task.key.baseIntent);
    i.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
    if ((i.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == 0) {
      i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    }
    try {
      UserHandle taskUser=new UserHandle(task.userId);
      if (launchOpts != null) {
        getContext().startActivityAsUser(i,launchOpts.toBundle(),taskUser);
      }
 else {
        getContext().startActivityAsUser(i,taskUser);
        if (lockToTask) {
          ssp.lockCurrentTask();
        }
      }
    }
 catch (    ActivityNotFoundException anfe) {
      Console.logError(getContext(),"String_Node_Str");
    }
    onTaskViewDismissed(task);
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (task.isActive) {
    RecentsTaskLoader.getInstance().getSystemServicesProxy().moveTaskToFront(task.key.id,launchOpts);
  }
 else {
    Intent i=new Intent(task.key.baseIntent);
    i.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
    if (!Utilities.isDocument(i)) {
      i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    }
    try {
      UserHandle taskUser=new UserHandle(task.userId);
      if (launchOpts != null) {
        getContext().startActivityAsUser(i,launchOpts.toBundle(),taskUser);
      }
 else {
        getContext().startActivityAsUser(i,taskUser);
        if (lockToTask) {
          ssp.lockCurrentTask();
        }
      }
    }
 catch (    ActivityNotFoundException anfe) {
      Console.logError(getContext(),"String_Node_Str");
    }
    onTaskViewDismissed(task);
  }
}
Program: 198934
Project: 198934
Buggy source:
@Override public void onTaskViewDismissed(Task t){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.deleteTaskData(t,false);
  int flags=t.key.baseIntent.getFlags();
  boolean isDocument=(flags & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) == Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
  RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id,isDocument);
}

Fixed version (ground truth):
@Override public void onTaskViewDismissed(Task t){
  RecentsTaskLoader loader=RecentsTaskLoader.getInstance();
  loader.deleteTaskData(t,false);
  RecentsTaskLoader.getInstance().getSystemServicesProxy().removeTask(t.key.id,Utilities.isDocument(t.key.baseIntent));
}
Program: 198935
Project: 198935
Buggy source:
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      notifyWakeLockAcquiredLocked(wakeLock);
      mWakeLocks.add(wakeLock);
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
  }
}

Fixed version (ground truth):
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    boolean notifyAcquire;
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
      notifyAcquire=false;
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      mWakeLocks.add(wakeLock);
      notifyAcquire=true;
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
    if (notifyAcquire) {
      notifyWakeLockAcquiredLocked(wakeLock);
    }
  }
}
Program: 198936
Project: 198936
Buggy source:
@Override public void dismiss(TimePicker view,boolean isCancel,int hourOfDay,int minute){
  if (!isCancel) {
    mTimeSetCallback.onTimeSet(view,hourOfDay,minute);
  }
  TimePickerDialog.this.dismiss();
}

Fixed version (ground truth):
@Override public void dismiss(TimePicker view,boolean isCancel,int hourOfDay,int minute){
  mIsCanceled=isCancel;
  if (!isCancel) {
    mTimeSetCallback.onTimeSet(view,hourOfDay,minute);
    TimePickerDialog.this.dismiss();
  }
 else {
    TimePickerDialog.this.cancel();
  }
}
Program: 198938
Project: 198938
Buggy source:
private void tryNotifyTimeSet(){
  if (mTimeSetCallback != null) {
    mTimePicker.clearFocus();
    mTimeSetCallback.onTimeSet(mTimePicker,mTimePicker.getCurrentHour(),mTimePicker.getCurrentMinute());
  }
}

Fixed version (ground truth):
private void tryNotifyTimeSet(){
  if (mTimeSetCallback != null && !mIsCanceled) {
    mTimePicker.clearFocus();
    mTimeSetCallback.onTimeSet(mTimePicker,mTimePicker.getCurrentHour(),mTimePicker.getCurrentMinute());
  }
}
Program: 198939
Project: 198939
Buggy source:
@Override public void dismiss(TimePicker view,boolean isCancel,int hourOfDay,int minute){
  if (!isCancel) {
    mTimeSetCallback.onTimeSet(view,hourOfDay,minute);
  }
  TimePickerDialog.this.dismiss();
}

Fixed version (ground truth):
@Override public void dismiss(TimePicker view,boolean isCancel,int hourOfDay,int minute){
  mIsCanceled=isCancel;
  if (!isCancel) {
    mTimeSetCallback.onTimeSet(view,hourOfDay,minute);
    TimePickerDialog.this.dismiss();
  }
 else {
    TimePickerDialog.this.cancel();
  }
}
Program: 198941
Project: 198941
Buggy source:
private void tryNotifyTimeSet(){
  if (mTimeSetCallback != null) {
    mTimePicker.clearFocus();
    mTimeSetCallback.onTimeSet(mTimePicker,mTimePicker.getCurrentHour(),mTimePicker.getCurrentMinute());
  }
}

Fixed version (ground truth):
private void tryNotifyTimeSet(){
  if (mTimeSetCallback != null && !mIsCanceled) {
    mTimePicker.clearFocus();
    mTimeSetCallback.onTimeSet(mTimePicker,mTimePicker.getCurrentHour(),mTimePicker.getCurrentMinute());
  }
}
Program: 198942
Project: 198942
Buggy source:
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      notifyWakeLockAcquiredLocked(wakeLock);
      mWakeLocks.add(wakeLock);
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
  }
}

Fixed version (ground truth):
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    boolean notifyAcquire;
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
      notifyAcquire=false;
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      mWakeLocks.add(wakeLock);
      notifyAcquire=true;
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
    if (notifyAcquire) {
      notifyWakeLockAcquiredLocked(wakeLock);
    }
  }
}
Program: 198943
Project: 198943
Buggy source:
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      notifyWakeLockAcquiredLocked(wakeLock);
      mWakeLocks.add(wakeLock);
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
  }
}

Fixed version (ground truth):
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    boolean notifyAcquire;
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
      notifyAcquire=false;
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      mWakeLocks.add(wakeLock);
      notifyAcquire=true;
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
    if (notifyAcquire) {
      notifyWakeLockAcquiredLocked(wakeLock);
    }
  }
}
Program: 198944
Project: 198944
Buggy source:
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      notifyWakeLockAcquiredLocked(wakeLock);
      mWakeLocks.add(wakeLock);
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
  }
}

Fixed version (ground truth):
private void acquireWakeLockInternal(IBinder lock,int flags,String tag,String packageName,WorkSource ws,String historyTag,int uid,int pid){
synchronized (mLock) {
    if (DEBUG_SPEW) {
      Slog.d(TAG,"String_Node_Str" + Objects.hashCode(lock) + "String_Node_Str"+ Integer.toHexString(flags)+ "String_Node_Str"+ tag+ "String_Node_Str"+ ws+ "String_Node_Str"+ uid+ "String_Node_Str"+ pid);
    }
    WakeLock wakeLock;
    int index=findWakeLockIndexLocked(lock);
    boolean notifyAcquire;
    if (index >= 0) {
      wakeLock=mWakeLocks.get(index);
      if (!wakeLock.hasSameProperties(flags,tag,ws,uid,pid)) {
        notifyWakeLockChangingLocked(wakeLock,flags,tag,packageName,uid,pid,ws,historyTag);
        wakeLock.updateProperties(flags,tag,packageName,ws,historyTag,uid,pid);
      }
      notifyAcquire=false;
    }
 else {
      wakeLock=new WakeLock(lock,flags,tag,packageName,ws,historyTag,uid,pid);
      try {
        lock.linkToDeath(wakeLock,0);
      }
 catch (      RemoteException ex) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      mWakeLocks.add(wakeLock);
      notifyAcquire=true;
    }
    applyWakeLockFlagsOnAcquireLocked(wakeLock);
    mDirty|=DIRTY_WAKE_LOCKS;
    updatePowerStateLocked();
    if (notifyAcquire) {
      notifyWakeLockAcquiredLocked(wakeLock);
    }
  }
}
Program: 198945
Project: 198945
Buggy source:
@Override public void dismiss(TimePicker view,boolean isCancel,int hourOfDay,int minute){
  if (!isCancel) {
    mTimeSetCallback.onTimeSet(view,hourOfDay,minute);
  }
  TimePickerDialog.this.dismiss();
}

Fixed version (ground truth):
@Override public void dismiss(TimePicker view,boolean isCancel,int hourOfDay,int minute){
  mIsCanceled=isCancel;
  if (!isCancel) {
    mTimeSetCallback.onTimeSet(view,hourOfDay,minute);
    TimePickerDialog.this.dismiss();
  }
 else {
    TimePickerDialog.this.cancel();
  }
}
Program: 198947
Project: 198947
Buggy source:
private void tryNotifyTimeSet(){
  if (mTimeSetCallback != null) {
    mTimePicker.clearFocus();
    mTimeSetCallback.onTimeSet(mTimePicker,mTimePicker.getCurrentHour(),mTimePicker.getCurrentMinute());
  }
}

Fixed version (ground truth):
private void tryNotifyTimeSet(){
  if (mTimeSetCallback != null && !mIsCanceled) {
    mTimePicker.clearFocus();
    mTimeSetCallback.onTimeSet(mTimePicker,mTimePicker.getCurrentHour(),mTimePicker.getCurrentMinute());
  }
}
Program: 198950
Project: 198950
Buggy source:
@Override public void onClick(View v){
  detail.setToggleState(!toggleState);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
}
Program: 198951
Project: 198951
Buggy source:
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mDateTime,!showingDetail);
  transition(mQsDetailHeader,showingDetail);
  if (showingDetail) {
    mQsDetailHeaderTitle.setText(detail.getTitle());
    final Boolean toggleState=detail.getToggleState();
    if (toggleState == null) {
      mQsDetailHeaderSwitch.setVisibility(INVISIBLE);
      mQsDetailHeader.setClickable(false);
    }
 else {
      mQsDetailHeaderSwitch.setVisibility(VISIBLE);
      mQsDetailHeaderSwitch.setChecked(toggleState);
      mQsDetailHeader.setClickable(true);
      mQsDetailHeader.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          detail.setToggleState(!toggleState);
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}

Fixed version (ground truth):
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mDateTime,!showingDetail);
  transition(mQsDetailHeader,showingDetail);
  if (showingDetail) {
    mQsDetailHeaderTitle.setText(detail.getTitle());
    final Boolean toggleState=detail.getToggleState();
    if (toggleState == null) {
      mQsDetailHeaderSwitch.setVisibility(INVISIBLE);
      mQsDetailHeader.setClickable(false);
    }
 else {
      mQsDetailHeaderSwitch.setVisibility(VISIBLE);
      mQsDetailHeaderSwitch.setChecked(toggleState);
      mQsDetailHeader.setClickable(true);
      mQsDetailHeader.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}
Program: 198952
Project: 198952
Buggy source:
@Override public void onClick(View v){
  detail.setToggleState(!toggleState);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
}
Program: 198953
Project: 198953
Buggy source:
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mDateTime,!showingDetail);
  transition(mQsDetailHeader,showingDetail);
  if (showingDetail) {
    mQsDetailHeaderTitle.setText(detail.getTitle());
    final Boolean toggleState=detail.getToggleState();
    if (toggleState == null) {
      mQsDetailHeaderSwitch.setVisibility(INVISIBLE);
      mQsDetailHeader.setClickable(false);
    }
 else {
      mQsDetailHeaderSwitch.setVisibility(VISIBLE);
      mQsDetailHeaderSwitch.setChecked(toggleState);
      mQsDetailHeader.setClickable(true);
      mQsDetailHeader.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          detail.setToggleState(!toggleState);
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}

Fixed version (ground truth):
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mDateTime,!showingDetail);
  transition(mQsDetailHeader,showingDetail);
  if (showingDetail) {
    mQsDetailHeaderTitle.setText(detail.getTitle());
    final Boolean toggleState=detail.getToggleState();
    if (toggleState == null) {
      mQsDetailHeaderSwitch.setVisibility(INVISIBLE);
      mQsDetailHeader.setClickable(false);
    }
 else {
      mQsDetailHeaderSwitch.setVisibility(VISIBLE);
      mQsDetailHeaderSwitch.setChecked(toggleState);
      mQsDetailHeader.setClickable(true);
      mQsDetailHeader.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}
Program: 198954
Project: 198954
Buggy source:
@Override public void onClick(View v){
  detail.setToggleState(!toggleState);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
}
Program: 198955
Project: 198955
Buggy source:
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mDateTime,!showingDetail);
  transition(mQsDetailHeader,showingDetail);
  if (showingDetail) {
    mQsDetailHeaderTitle.setText(detail.getTitle());
    final Boolean toggleState=detail.getToggleState();
    if (toggleState == null) {
      mQsDetailHeaderSwitch.setVisibility(INVISIBLE);
      mQsDetailHeader.setClickable(false);
    }
 else {
      mQsDetailHeaderSwitch.setVisibility(VISIBLE);
      mQsDetailHeaderSwitch.setChecked(toggleState);
      mQsDetailHeader.setClickable(true);
      mQsDetailHeader.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          detail.setToggleState(!toggleState);
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}

Fixed version (ground truth):
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mDateTime,!showingDetail);
  transition(mQsDetailHeader,showingDetail);
  if (showingDetail) {
    mQsDetailHeaderTitle.setText(detail.getTitle());
    final Boolean toggleState=detail.getToggleState();
    if (toggleState == null) {
      mQsDetailHeaderSwitch.setVisibility(INVISIBLE);
      mQsDetailHeader.setClickable(false);
    }
 else {
      mQsDetailHeaderSwitch.setVisibility(VISIBLE);
      mQsDetailHeaderSwitch.setChecked(toggleState);
      mQsDetailHeader.setClickable(true);
      mQsDetailHeader.setOnClickListener(new OnClickListener(){
        @Override public void onClick(        View v){
          detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}
Program: 198956
Project: 198956
Buggy source:
/** 
 * Starts the recents activity 
 */
void startAlternateRecentsActivity(ActivityManager.RunningTaskInfo topTask,ActivityOptions opts,String extraFlag){
  Intent intent=new Intent(sToggleRecentsAction);
  intent.setClassName(sRecentsPackage,sRecentsActivity);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
  if (extraFlag != null) {
    intent.putExtra(extraFlag,true);
  }
  intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,mTriggeredFromAltTab);
  intent.putExtra(EXTRA_TRIGGERED_FROM_TASK_ID,(topTask != null) ? topTask.id : -1);
  if (opts != null) {
    mContext.startActivityAsUser(intent,opts.toBundle(),new UserHandle(UserHandle.USER_CURRENT));
  }
 else {
    mContext.startActivityAsUser(intent,new UserHandle(UserHandle.USER_CURRENT));
  }
}

Fixed version (ground truth):
/** 
 * Starts the recents activity 
 */
void startAlternateRecentsActivity(ActivityManager.RunningTaskInfo topTask,ActivityOptions opts,String extraFlag){
  Intent intent=new Intent(sToggleRecentsAction);
  intent.setClassName(sRecentsPackage,sRecentsActivity);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
  if (extraFlag != null) {
    intent.putExtra(extraFlag,true);
  }
  intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB,mTriggeredFromAltTab);
  intent.putExtra(EXTRA_TRIGGERED_FROM_TASK_ID,(topTask != null) ? topTask.id : -1);
  if (opts != null) {
    mContext.startActivityAsUser(intent,opts.toBundle(),UserHandle.CURRENT);
  }
 else {
    mContext.startActivityAsUser(intent,UserHandle.CURRENT);
  }
}
Program: 198957
Project: 198957
Buggy source:
/** 
 * Starts the recents activity 
 */
void startRecentsActivity(ActivityManager.RunningTaskInfo topTask,boolean isTopTaskHome){
  SystemServicesProxy ssp=mSystemServicesProxy;
  List<ActivityManager.RecentTaskInfo> recentTasks=ssp.getRecentTasks(3,UserHandle.CURRENT.getIdentifier());
  boolean useThumbnailTransition=!isTopTaskHome;
  boolean hasRecentTasks=!recentTasks.isEmpty();
  if (useThumbnailTransition) {
    ActivityOptions opts=getThumbnailTransitionActivityOptions(topTask);
    if (opts != null) {
      if (sLastScreenshot != null) {
        startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_APP_FULL_SCREENSHOT);
      }
 else {
        startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_APP_THUMBNAIL);
      }
    }
 else {
      useThumbnailTransition=false;
    }
  }
  if (!useThumbnailTransition) {
    if (hasRecentTasks) {
      ActivityOptions opts=getHomeTransitionActivityOptions();
      startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_HOME);
    }
 else {
      ActivityOptions opts=getUnknownTransitionActivityOptions();
      startAlternateRecentsActivity(topTask,opts,null);
    }
  }
  if (Console.Enabled) {
    Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,Constants.Log.App.TimeRecentsStartupKey,"String_Node_Str");
  }
  mLastToggleTime=System.currentTimeMillis();
}

Fixed version (ground truth):
/** 
 * Starts the recents activity 
 */
void startRecentsActivity(ActivityManager.RunningTaskInfo topTask,boolean isTopTaskHome){
  SystemServicesProxy ssp=mSystemServicesProxy;
  List<ActivityManager.RecentTaskInfo> recentTasks=ssp.getRecentTasks(3,UserHandle.CURRENT.getIdentifier());
  boolean useThumbnailTransition=!isTopTaskHome;
  boolean hasRecentTasks=!recentTasks.isEmpty();
  if (useThumbnailTransition) {
    ActivityOptions opts=getThumbnailTransitionActivityOptions(topTask);
    if (opts != null) {
      if (sLastScreenshot != null) {
        startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_APP_FULL_SCREENSHOT);
      }
 else {
        startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_APP_THUMBNAIL);
      }
    }
 else {
      useThumbnailTransition=false;
    }
  }
  if (!useThumbnailTransition) {
    if (hasRecentTasks) {
      ActivityOptions opts=getHomeTransitionActivityOptions();
      startAlternateRecentsActivity(topTask,opts,EXTRA_FROM_HOME);
    }
 else {
      ActivityOptions opts=getUnknownTransitionActivityOptions();
      startAlternateRecentsActivity(topTask,opts,null);
    }
  }
  mLastToggleTime=System.currentTimeMillis();
}
Program: 198958
Project: 198958
Buggy source:
/** 
 * Shows the recents 
 */
public void onShowRecents(boolean triggeredFromAltTab,View statusBarView){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.RecentsComponent,"String_Node_Str");
  }
  mStatusBarView=statusBarView;
  mTriggeredFromAltTab=triggeredFromAltTab;
  try {
    startRecentsActivity();
  }
 catch (  ActivityNotFoundException e) {
    Console.logRawError("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Shows the recents 
 */
public void onShowRecents(boolean triggeredFromAltTab,View statusBarView){
  mStatusBarView=statusBarView;
  mTriggeredFromAltTab=triggeredFromAltTab;
  try {
    startRecentsActivity();
  }
 catch (  ActivityNotFoundException e) {
    Console.logRawError("String_Node_Str",e);
  }
}
Program: 198959
Project: 198959
Buggy source:
/** 
 * Toggles the alternate recents activity 
 */
public void onToggleRecents(View statusBarView){
  if (Console.Enabled) {
    Console.logStartTracingTime(Constants.Log.App.TimeRecentsStartup,Constants.Log.App.TimeRecentsStartupKey);
    Console.logStartTracingTime(Constants.Log.App.TimeRecentsLaunchTask,Constants.Log.App.TimeRecentsLaunchKey);
    Console.log(Constants.Log.App.RecentsComponent,"String_Node_Str","String_Node_Str");
  }
  mStatusBarView=statusBarView;
  mTriggeredFromAltTab=false;
  try {
    toggleRecentsActivity();
  }
 catch (  ActivityNotFoundException e) {
    Console.logRawError("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Toggles the alternate recents activity 
 */
public void onToggleRecents(View statusBarView){
  mStatusBarView=statusBarView;
  mTriggeredFromAltTab=false;
  try {
    toggleRecentsActivity();
  }
 catch (  ActivityNotFoundException e) {
    Console.logRawError("String_Node_Str",e);
  }
}
Program: 198960
Project: 198960
Buggy source:
public void onStart(){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.RecentsComponent,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void onStart(){
}
Program: 198961
Project: 198961
Buggy source:
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.RecentsComponent,"String_Node_Str");
  }
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcast(intent);
    }
  }
}

Fixed version (ground truth):
/** 
 * Hides the recents 
 */
public void onHideRecents(boolean triggeredFromAltTab){
  if (mBootCompleted) {
    if (isRecentsTopMost(getTopMostTask(),null)) {
      Intent intent=new Intent(RecentsActivity.ACTION_HIDE_RECENTS_ACTIVITY);
      intent.setPackage(mContext.getPackageName());
      intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
      intent.putExtra(RecentsActivity.EXTRA_TRIGGERED_FROM_ALT_TAB,triggeredFromAltTab);
      mContext.sendBroadcast(intent);
    }
  }
}
Program: 198962
Project: 198962
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    if (Console.Enabled) {
      Console.logTraceTime(Constants.Log.App.TimeRecentsStartup,Constants.Log.App.TimeRecentsStartupKey,"String_Node_Str");
      Console.logTraceTime(Constants.Log.App.TimeRecentsLaunchTask,Constants.Log.App.TimeRecentsLaunchKey,"String_Node_Str");
    }
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(RecentsActivity.ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
    mContext.sendBroadcast(intent);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 198963
Project: 198963
Buggy source:
@Override public void onTaskViewClicked(){
  AlternateRecentsComponent.notifyVisibilityChanged(false);
}

Fixed version (ground truth):
@Override public void onTaskViewClicked(){
  AlternateRecentsComponent.notifyVisibilityChanged(false);
  mVisible=false;
}
Program: 198964
Project: 198964
Buggy source:
@Override protected void onStop(){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.SystemUIHandshake,"String_Node_Str","String_Node_Str",Console.AnsiRed);
  }
  super.onStop();
  unregisterReceiver(mServiceBroadcastReceiver);
  if (mConfig.searchBarAppWidgetId >= 0) {
    mAppWidgetHost.stopListening();
  }
  mVisible=false;
}

Fixed version (ground truth):
@Override protected void onStop(){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.SystemUIHandshake,"String_Node_Str","String_Node_Str",Console.AnsiRed);
  }
  super.onStop();
  unregisterReceiver(mServiceBroadcastReceiver);
  if (mConfig.searchBarAppWidgetId >= 0) {
    mAppWidgetHost.stopListening();
  }
}
Program: 198965
Project: 198965
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(Intent.ACTION_SCREEN_OFF)) {
    mFinishLaunchHomeRunnable.run();
  }
 else   if (action.equals(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED)) {
    refreshSearchWidget();
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(Intent.ACTION_SCREEN_OFF) && mVisible) {
    mFinishLaunchHomeRunnable.run();
  }
 else   if (action.equals(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED)) {
    refreshSearchWidget();
  }
}
Program: 198966
Project: 198966
Buggy source:
@Override public void onTaskViewClicked(){
  AlternateRecentsComponent.notifyVisibilityChanged(false);
}

Fixed version (ground truth):
@Override public void onTaskViewClicked(){
  AlternateRecentsComponent.notifyVisibilityChanged(false);
  mVisible=false;
}
Program: 198967
Project: 198967
Buggy source:
@Override protected void onStop(){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.SystemUIHandshake,"String_Node_Str","String_Node_Str",Console.AnsiRed);
  }
  super.onStop();
  unregisterReceiver(mServiceBroadcastReceiver);
  if (mConfig.searchBarAppWidgetId >= 0) {
    mAppWidgetHost.stopListening();
  }
  mVisible=false;
}

Fixed version (ground truth):
@Override protected void onStop(){
  if (Console.Enabled) {
    Console.log(Constants.Log.App.SystemUIHandshake,"String_Node_Str","String_Node_Str",Console.AnsiRed);
  }
  super.onStop();
  unregisterReceiver(mServiceBroadcastReceiver);
  if (mConfig.searchBarAppWidgetId >= 0) {
    mAppWidgetHost.stopListening();
  }
}
Program: 198968
Project: 198968
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(Intent.ACTION_SCREEN_OFF)) {
    mFinishLaunchHomeRunnable.run();
  }
 else   if (action.equals(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED)) {
    refreshSearchWidget();
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  String action=intent.getAction();
  if (action.equals(Intent.ACTION_SCREEN_OFF) && mVisible) {
    mFinishLaunchHomeRunnable.run();
  }
 else   if (action.equals(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED)) {
    refreshSearchWidget();
  }
}
Program: 198969
Project: 198969
Buggy source:
/** 
 * Destroys all hardware rendering resources. This method is invoked when the system needs to reclaim resources. Upon execution of this method, you should free any OpenGL resources created by the view. Note: you <strong>must</strong> call <code>super.destroyHardwareResources()</code> when overriding this method.
 * @hide
 */
protected void destroyHardwareResources(){
}

Fixed version (ground truth):
/** 
 * Destroys all hardware rendering resources. This method is invoked when the system needs to reclaim resources. Upon execution of this method, you should free any OpenGL resources created by the view. Note: you <strong>must</strong> call <code>super.destroyHardwareResources()</code> when overriding this method.
 * @hide
 */
protected void destroyHardwareResources(){
  resetDisplayList();
}
Program: 198970
Project: 198970
Buggy source:
private void updateNotificationTranslucency(){
  float alpha=(mNotificationStackScroller.getNotificationsTopY() + mNotificationStackScroller.getItemHeight()) / (mQsMinExpansionHeight + mNotificationStackScroller.getItemHeight() / 2);
  alpha=Math.max(0,Math.min(alpha,1));
  alpha=(float)Math.pow(alpha,0.75);
  mNotificationStackScroller.setAlpha(alpha);
}

Fixed version (ground truth):
private void updateNotificationTranslucency(){
  float alpha=(getNotificationsTopY() + mNotificationStackScroller.getItemHeight()) / (mQsMinExpansionHeight + mNotificationStackScroller.getItemHeight() / 2);
  alpha=Math.max(0,Math.min(alpha,1));
  alpha=(float)Math.pow(alpha,0.75);
  mNotificationStackScroller.setAlpha(alpha);
}
Program: 198971
Project: 198971
Buggy source:
private void updateHeaderKeyguard(){
  mHeader.setTranslationY(0f);
  float alpha;
  if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    alpha=mNotificationStackScroller.getNotificationsTopY() / (mQsMinExpansionHeight + mNotificationsHeaderCollideDistance);
  }
 else {
    alpha=mNotificationStackScroller.getNotificationsTopY() / mQsMinExpansionHeight;
  }
  alpha=Math.max(0,Math.min(alpha,1));
  alpha=(float)Math.pow(alpha,0.75);
  mHeader.setAlpha(alpha);
  mKeyguardBottomArea.setAlpha(alpha);
  setQsTranslation(mQsExpansionHeight);
}

Fixed version (ground truth):
private void updateHeaderKeyguard(){
  mHeader.setTranslationY(0f);
  float alpha;
  if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    alpha=getNotificationsTopY() / (mQsMinExpansionHeight + mNotificationsHeaderCollideDistance);
  }
 else {
    alpha=getNotificationsTopY() / mQsMinExpansionHeight;
  }
  alpha=Math.max(0,Math.min(alpha,1));
  alpha=(float)Math.pow(alpha,0.75);
  mHeader.setAlpha(alpha);
  mKeyguardBottomArea.setAlpha(alpha);
  setQsTranslation(mQsExpansionHeight);
}
Program: 198972
Project: 198972
Buggy source:
/** 
 * Destroys all hardware rendering resources. This method is invoked when the system needs to reclaim resources. Upon execution of this method, you should free any OpenGL resources created by the view. Note: you <strong>must</strong> call <code>super.destroyHardwareResources()</code> when overriding this method.
 * @hide
 */
protected void destroyHardwareResources(){
}

Fixed version (ground truth):
/** 
 * Destroys all hardware rendering resources. This method is invoked when the system needs to reclaim resources. Upon execution of this method, you should free any OpenGL resources created by the view. Note: you <strong>must</strong> call <code>super.destroyHardwareResources()</code> when overriding this method.
 * @hide
 */
protected void destroyHardwareResources(){
  resetDisplayList();
}
Program: 198973
Project: 198973
Buggy source:
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  mTemporaryDetach=false;
  if (mEditor != null)   mEditor.onAttachedToWindow();
}

Fixed version (ground truth):
@Override protected void onAttachedToWindow(){
  super.onAttachedToWindow();
  mTemporaryDetach=false;
  if (mEditor != null)   mEditor.onAttachedToWindow();
  if (mPreDrawListenerDetached) {
    getViewTreeObserver().addOnPreDrawListener(this);
    mPreDrawListenerDetached=false;
  }
}