nus-yam/ex-repair huggingface dataset:
Program: 199200
Project: 199200
Buggy source:
private void handleAllocateLogicalAddress(final int deviceType,int preferredAddress,final AllocateLogicalAddressCallback callback){
  assertRunOnIoThread();
  int startAddress=preferredAddress;
  if (preferredAddress == HdmiCec.ADDR_UNREGISTERED) {
    for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
      if (deviceType == HdmiCec.getTypeFromAddress(i)) {
        startAddress=i;
        break;
      }
    }
  }
  int logicalAddress=HdmiCec.ADDR_UNREGISTERED;
  for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
    int curAddress=(startAddress + i) % NUM_LOGICAL_ADDRESS;
    if (curAddress != HdmiCec.ADDR_UNREGISTERED && deviceType == HdmiCec.getTypeFromAddress(i)) {
      if (!sendPollMessage(curAddress,RETRY_COUNT_FOR_LOGICAL_ADDRESS_ALLOCATION)) {
        logicalAddress=curAddress;
        break;
      }
    }
  }
  final int assignedAddress=logicalAddress;
  if (callback != null) {
    runOnServiceThread(new Runnable(){
      @Override public void run(){
        callback.onAllocated(deviceType,assignedAddress);
      }
    }
);
  }
}

Fixed version (ground truth):
private void handleAllocateLogicalAddress(final int deviceType,int preferredAddress,final AllocateLogicalAddressCallback callback){
  assertRunOnIoThread();
  int startAddress=preferredAddress;
  if (preferredAddress == HdmiCec.ADDR_UNREGISTERED) {
    for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
      if (deviceType == HdmiCec.getTypeFromAddress(i)) {
        startAddress=i;
        break;
      }
    }
  }
  int logicalAddress=HdmiCec.ADDR_UNREGISTERED;
  for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
    int curAddress=(startAddress + i) % NUM_LOGICAL_ADDRESS;
    if (curAddress != HdmiCec.ADDR_UNREGISTERED && deviceType == HdmiCec.getTypeFromAddress(curAddress)) {
      if (!sendPollMessage(curAddress,RETRY_COUNT_FOR_LOGICAL_ADDRESS_ALLOCATION)) {
        logicalAddress=curAddress;
        break;
      }
    }
  }
  final int assignedAddress=logicalAddress;
  if (callback != null) {
    runOnServiceThread(new Runnable(){
      @Override public void run(){
        callback.onAllocated(deviceType,assignedAddress);
      }
    }
);
  }
}
Program: 199201
Project: 199201
Buggy source:
/** 
 * Constructor.
 */
public HdmiCecMessage(int source,int destination,int opcode,byte[] params){
  mSource=source;
  mDestination=destination;
  mOpcode=opcode;
  mParams=Arrays.copyOf(params,params.length);
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public HdmiCecMessage(int source,int destination,int opcode,byte[] params){
  mSource=source;
  mDestination=destination;
  mOpcode=opcode & 0xFF;
  mParams=Arrays.copyOf(params,params.length);
}
Program: 199202
Project: 199202
Buggy source:
@Override public void sendTimerMessage(int state,long delayMillis){
  sendMessageDelayed(obtainMessage(MSG_TIMEOUT,state),delayMillis);
}

Fixed version (ground truth):
@Override public void sendTimerMessage(int state,long delayMillis){
  sendMessageDelayed(obtainMessage(MSG_TIMEOUT,state,0),delayMillis);
}
Program: 199203
Project: 199203
Buggy source:
/** 
 * Get the status of display device connected through HDMI bus.
 * @param callback {@link DisplayStatusCallback} object to get informedof the result
 */
public void queryDisplayStatus(DisplayStatusCallback callback){
  try {
    mService.oneTouchPlay(getCallbackWrapper(callback));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Get the status of display device connected through HDMI bus.
 * @param callback {@link DisplayStatusCallback} object to get informedof the result
 */
public void queryDisplayStatus(DisplayStatusCallback callback){
  try {
    mService.queryDisplayStatus(getCallbackWrapper(callback));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 199204
Project: 199204
Buggy source:
/** 
 * Constructor.
 */
public HdmiCecMessage(int source,int destination,int opcode,byte[] params){
  mSource=source;
  mDestination=destination;
  mOpcode=opcode;
  mParams=Arrays.copyOf(params,params.length);
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public HdmiCecMessage(int source,int destination,int opcode,byte[] params){
  mSource=source;
  mDestination=destination;
  mOpcode=opcode & 0xFF;
  mParams=Arrays.copyOf(params,params.length);
}
Program: 199205
Project: 199205
Buggy source:
@Override public void sendTimerMessage(int state,long delayMillis){
  sendMessageDelayed(obtainMessage(MSG_TIMEOUT,state),delayMillis);
}

Fixed version (ground truth):
@Override public void sendTimerMessage(int state,long delayMillis){
  sendMessageDelayed(obtainMessage(MSG_TIMEOUT,state,0),delayMillis);
}
Program: 199206
Project: 199206
Buggy source:
private void handleAllocateLogicalAddress(final int deviceType,int preferredAddress,final AllocateLogicalAddressCallback callback){
  assertRunOnIoThread();
  int startAddress=preferredAddress;
  if (preferredAddress == HdmiCec.ADDR_UNREGISTERED) {
    for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
      if (deviceType == HdmiCec.getTypeFromAddress(i)) {
        startAddress=i;
        break;
      }
    }
  }
  int logicalAddress=HdmiCec.ADDR_UNREGISTERED;
  for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
    int curAddress=(startAddress + i) % NUM_LOGICAL_ADDRESS;
    if (curAddress != HdmiCec.ADDR_UNREGISTERED && deviceType == HdmiCec.getTypeFromAddress(i)) {
      if (!sendPollMessage(curAddress,RETRY_COUNT_FOR_LOGICAL_ADDRESS_ALLOCATION)) {
        logicalAddress=curAddress;
        break;
      }
    }
  }
  final int assignedAddress=logicalAddress;
  if (callback != null) {
    runOnServiceThread(new Runnable(){
      @Override public void run(){
        callback.onAllocated(deviceType,assignedAddress);
      }
    }
);
  }
}

Fixed version (ground truth):
private void handleAllocateLogicalAddress(final int deviceType,int preferredAddress,final AllocateLogicalAddressCallback callback){
  assertRunOnIoThread();
  int startAddress=preferredAddress;
  if (preferredAddress == HdmiCec.ADDR_UNREGISTERED) {
    for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
      if (deviceType == HdmiCec.getTypeFromAddress(i)) {
        startAddress=i;
        break;
      }
    }
  }
  int logicalAddress=HdmiCec.ADDR_UNREGISTERED;
  for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
    int curAddress=(startAddress + i) % NUM_LOGICAL_ADDRESS;
    if (curAddress != HdmiCec.ADDR_UNREGISTERED && deviceType == HdmiCec.getTypeFromAddress(curAddress)) {
      if (!sendPollMessage(curAddress,RETRY_COUNT_FOR_LOGICAL_ADDRESS_ALLOCATION)) {
        logicalAddress=curAddress;
        break;
      }
    }
  }
  final int assignedAddress=logicalAddress;
  if (callback != null) {
    runOnServiceThread(new Runnable(){
      @Override public void run(){
        callback.onAllocated(deviceType,assignedAddress);
      }
    }
);
  }
}
Program: 199207
Project: 199207
Buggy source:
/** 
 * Get the status of display device connected through HDMI bus.
 * @param callback {@link DisplayStatusCallback} object to get informedof the result
 */
public void queryDisplayStatus(DisplayStatusCallback callback){
  try {
    mService.oneTouchPlay(getCallbackWrapper(callback));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Get the status of display device connected through HDMI bus.
 * @param callback {@link DisplayStatusCallback} object to get informedof the result
 */
public void queryDisplayStatus(DisplayStatusCallback callback){
  try {
    mService.queryDisplayStatus(getCallbackWrapper(callback));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 199208
Project: 199208
Buggy source:
public void resetViews(){
  mBlockTouches=false;
  mPageSwiper.reset();
  closeQs();
}

Fixed version (ground truth):
@Override public void resetViews(){
  mBlockTouches=false;
  mPageSwiper.reset();
  closeQs();
}
Program: 199209
Project: 199209
Buggy source:
public void collapseAllPanels(boolean animate){
  boolean waiting=false;
  for (  PanelView pv : mPanels) {
    if (animate && !pv.isFullyCollapsed()) {
      pv.collapse();
      waiting=true;
    }
 else {
      pv.setExpandedFraction(0);
      pv.setVisibility(View.GONE);
      pv.cancelPeek();
    }
  }
  if (DEBUG)   LOG("String_Node_Str",animate,waiting);
  if (!waiting && mState != STATE_CLOSED) {
    go(STATE_CLOSED);
    onAllPanelsCollapsed();
  }
}

Fixed version (ground truth):
public void collapseAllPanels(boolean animate){
  boolean waiting=false;
  for (  PanelView pv : mPanels) {
    if (animate && !pv.isFullyCollapsed()) {
      pv.collapse();
      waiting=true;
    }
 else {
      pv.setExpandedFraction(0);
      pv.setVisibility(View.GONE);
      pv.cancelPeek();
      pv.resetViews();
    }
  }
  if (DEBUG)   LOG("String_Node_Str",animate,waiting);
  if (!waiting && mState != STATE_CLOSED) {
    go(STATE_CLOSED);
    onAllPanelsCollapsed();
  }
}
Program: 199210
Project: 199210
Buggy source:
public boolean isSyntheticEntry(Entry ent){
  return ent.key.equals(SYNTHETIC_KEY);
}

Fixed version (ground truth):
public boolean isSyntheticEntry(Entry ent){
  return ent.key.equals(mSynKey);
}
Program: 199211
Project: 199211
Buggy source:
public void resetViews(){
  mBlockTouches=false;
  mPageSwiper.reset();
  closeQs();
}

Fixed version (ground truth):
@Override public void resetViews(){
  mBlockTouches=false;
  mPageSwiper.reset();
  closeQs();
}
Program: 199212
Project: 199212
Buggy source:
public void collapseAllPanels(boolean animate){
  boolean waiting=false;
  for (  PanelView pv : mPanels) {
    if (animate && !pv.isFullyCollapsed()) {
      pv.collapse();
      waiting=true;
    }
 else {
      pv.setExpandedFraction(0);
      pv.setVisibility(View.GONE);
      pv.cancelPeek();
    }
  }
  if (DEBUG)   LOG("String_Node_Str",animate,waiting);
  if (!waiting && mState != STATE_CLOSED) {
    go(STATE_CLOSED);
    onAllPanelsCollapsed();
  }
}

Fixed version (ground truth):
public void collapseAllPanels(boolean animate){
  boolean waiting=false;
  for (  PanelView pv : mPanels) {
    if (animate && !pv.isFullyCollapsed()) {
      pv.collapse();
      waiting=true;
    }
 else {
      pv.setExpandedFraction(0);
      pv.setVisibility(View.GONE);
      pv.cancelPeek();
      pv.resetViews();
    }
  }
  if (DEBUG)   LOG("String_Node_Str",animate,waiting);
  if (!waiting && mState != STATE_CLOSED) {
    go(STATE_CLOSED);
    onAllPanelsCollapsed();
  }
}
Program: 199213
Project: 199213
Buggy source:
/** 
 * Get the status of display device connected through HDMI bus.
 * @param callback {@link DisplayStatusCallback} object to get informedof the result
 */
public void queryDisplayStatus(DisplayStatusCallback callback){
  try {
    mService.oneTouchPlay(getCallbackWrapper(callback));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Get the status of display device connected through HDMI bus.
 * @param callback {@link DisplayStatusCallback} object to get informedof the result
 */
public void queryDisplayStatus(DisplayStatusCallback callback){
  try {
    mService.queryDisplayStatus(getCallbackWrapper(callback));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 199214
Project: 199214
Buggy source:
public void resetViews(){
  mBlockTouches=false;
  mPageSwiper.reset();
  closeQs();
}

Fixed version (ground truth):
@Override public void resetViews(){
  mBlockTouches=false;
  mPageSwiper.reset();
  closeQs();
}
Program: 199215
Project: 199215
Buggy source:
public void collapseAllPanels(boolean animate){
  boolean waiting=false;
  for (  PanelView pv : mPanels) {
    if (animate && !pv.isFullyCollapsed()) {
      pv.collapse();
      waiting=true;
    }
 else {
      pv.setExpandedFraction(0);
      pv.setVisibility(View.GONE);
      pv.cancelPeek();
    }
  }
  if (DEBUG)   LOG("String_Node_Str",animate,waiting);
  if (!waiting && mState != STATE_CLOSED) {
    go(STATE_CLOSED);
    onAllPanelsCollapsed();
  }
}

Fixed version (ground truth):
public void collapseAllPanels(boolean animate){
  boolean waiting=false;
  for (  PanelView pv : mPanels) {
    if (animate && !pv.isFullyCollapsed()) {
      pv.collapse();
      waiting=true;
    }
 else {
      pv.setExpandedFraction(0);
      pv.setVisibility(View.GONE);
      pv.cancelPeek();
      pv.resetViews();
    }
  }
  if (DEBUG)   LOG("String_Node_Str",animate,waiting);
  if (!waiting && mState != STATE_CLOSED) {
    go(STATE_CLOSED);
    onAllPanelsCollapsed();
  }
}
Program: 199216
Project: 199216
Buggy source:
public boolean isSyntheticEntry(Entry ent){
  return ent.key.equals(SYNTHETIC_KEY);
}

Fixed version (ground truth):
public boolean isSyntheticEntry(Entry ent){
  return ent.key.equals(mSynKey);
}
Program: 199218
Project: 199218
Buggy source:
/** 
 * Get the status of display device connected through HDMI bus.
 * @param callback {@link DisplayStatusCallback} object to get informedof the result
 */
public void queryDisplayStatus(DisplayStatusCallback callback){
  try {
    mService.oneTouchPlay(getCallbackWrapper(callback));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Get the status of display device connected through HDMI bus.
 * @param callback {@link DisplayStatusCallback} object to get informedof the result
 */
public void queryDisplayStatus(DisplayStatusCallback callback){
  try {
    mService.queryDisplayStatus(getCallbackWrapper(callback));
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 199219
Project: 199219
Buggy source:
public boolean isSyntheticEntry(Entry ent){
  return ent.key.equals(SYNTHETIC_KEY);
}

Fixed version (ground truth):
public boolean isSyntheticEntry(Entry ent){
  return ent.key.equals(mSynKey);
}
Program: 199220
Project: 199220
Buggy source:
/** 
 * Constructor.
 */
public HdmiCecMessage(int source,int destination,int opcode,byte[] params){
  mSource=source;
  mDestination=destination;
  mOpcode=opcode;
  mParams=Arrays.copyOf(params,params.length);
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public HdmiCecMessage(int source,int destination,int opcode,byte[] params){
  mSource=source;
  mDestination=destination;
  mOpcode=opcode & 0xFF;
  mParams=Arrays.copyOf(params,params.length);
}
Program: 199221
Project: 199221
Buggy source:
@Override public void sendTimerMessage(int state,long delayMillis){
  sendMessageDelayed(obtainMessage(MSG_TIMEOUT,state),delayMillis);
}

Fixed version (ground truth):
@Override public void sendTimerMessage(int state,long delayMillis){
  sendMessageDelayed(obtainMessage(MSG_TIMEOUT,state,0),delayMillis);
}
Program: 199223
Project: 199223
Buggy source:
private void handleAllocateLogicalAddress(final int deviceType,int preferredAddress,final AllocateLogicalAddressCallback callback){
  assertRunOnIoThread();
  int startAddress=preferredAddress;
  if (preferredAddress == HdmiCec.ADDR_UNREGISTERED) {
    for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
      if (deviceType == HdmiCec.getTypeFromAddress(i)) {
        startAddress=i;
        break;
      }
    }
  }
  int logicalAddress=HdmiCec.ADDR_UNREGISTERED;
  for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
    int curAddress=(startAddress + i) % NUM_LOGICAL_ADDRESS;
    if (curAddress != HdmiCec.ADDR_UNREGISTERED && deviceType == HdmiCec.getTypeFromAddress(i)) {
      if (!sendPollMessage(curAddress,RETRY_COUNT_FOR_LOGICAL_ADDRESS_ALLOCATION)) {
        logicalAddress=curAddress;
        break;
      }
    }
  }
  final int assignedAddress=logicalAddress;
  if (callback != null) {
    runOnServiceThread(new Runnable(){
      @Override public void run(){
        callback.onAllocated(deviceType,assignedAddress);
      }
    }
);
  }
}

Fixed version (ground truth):
private void handleAllocateLogicalAddress(final int deviceType,int preferredAddress,final AllocateLogicalAddressCallback callback){
  assertRunOnIoThread();
  int startAddress=preferredAddress;
  if (preferredAddress == HdmiCec.ADDR_UNREGISTERED) {
    for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
      if (deviceType == HdmiCec.getTypeFromAddress(i)) {
        startAddress=i;
        break;
      }
    }
  }
  int logicalAddress=HdmiCec.ADDR_UNREGISTERED;
  for (int i=0; i < NUM_LOGICAL_ADDRESS; ++i) {
    int curAddress=(startAddress + i) % NUM_LOGICAL_ADDRESS;
    if (curAddress != HdmiCec.ADDR_UNREGISTERED && deviceType == HdmiCec.getTypeFromAddress(curAddress)) {
      if (!sendPollMessage(curAddress,RETRY_COUNT_FOR_LOGICAL_ADDRESS_ALLOCATION)) {
        logicalAddress=curAddress;
        break;
      }
    }
  }
  final int assignedAddress=logicalAddress;
  if (callback != null) {
    runOnServiceThread(new Runnable(){
      @Override public void run(){
        callback.onAllocated(deviceType,assignedAddress);
      }
    }
);
  }
}
Program: 199227
Project: 199227
Buggy source:
public RankingFuture process(NotificationRecord record){
  if (record == null || record.getNotification() == null) {
    if (DBG)     Slog.d(TAG,"String_Node_Str");
    return null;
  }
  final Notification notification=record.getNotification();
  if ((notification.defaults & Notification.DEFAULT_VIBRATE) != 0 || notification.vibrate != null || (notification.defaults & Notification.DEFAULT_SOUND) != 0 || notification.sound != null || notification.fullScreenIntent != null) {
    record.setRecentlyIntusive(true);
  }
  return new RankingFuture(record,HANG_TIME_MS){
    @Override public void work(){
      mRecord.setRecentlyIntusive(false);
    }
  }
;
}

Fixed version (ground truth):
public RankingReconsideration process(NotificationRecord record){
  if (record == null || record.getNotification() == null) {
    if (DBG)     Slog.d(TAG,"String_Node_Str");
    return null;
  }
  final Notification notification=record.getNotification();
  if ((notification.defaults & Notification.DEFAULT_VIBRATE) != 0 || notification.vibrate != null || (notification.defaults & Notification.DEFAULT_SOUND) != 0 || notification.sound != null || notification.fullScreenIntent != null) {
    record.setRecentlyIntusive(true);
  }
  return new RankingReconsideration(record.getKey(),HANG_TIME_MS){
    @Override public void work(){
    }
    @Override public void applyChangesLocked(    NotificationRecord record){
      record.setRecentlyIntusive(false);
    }
  }
;
}
Program: 199228
Project: 199228
Buggy source:
@Override public void work(){
  mRecord.setRecentlyIntusive(false);
}

Fixed version (ground truth):
@Override public void work(){
}
Program: 199229
Project: 199229
Buggy source:
private void handleRankingReconsideration(Message message){
  if (!(message.obj instanceof RankingFuture))   return;
  RankingFuture future=(RankingFuture)message.obj;
  future.run();
  try {
    NotificationRecord record=future.get();
synchronized (mNotificationList) {
      int before=mNotificationList.indexOf(record);
      if (before != -1) {
        Collections.sort(mNotificationList,mRankingComparator);
        int after=mNotificationList.indexOf(record);
        if (before != after) {
          scheduleSendRankingUpdate();
        }
      }
    }
  }
 catch (  InterruptedException e) {
  }
catch (  ExecutionException e) {
  }
}

Fixed version (ground truth):
private void handleRankingReconsideration(Message message){
  if (!(message.obj instanceof RankingReconsideration))   return;
  RankingReconsideration recon=(RankingReconsideration)message.obj;
  recon.run();
  boolean orderChanged;
synchronized (mNotificationList) {
    final NotificationRecord record=mNotificationsByKey.get(recon.getKey());
    if (record == null) {
      return;
    }
    int before=findNotificationRecordIndexLocked(record);
    recon.applyChangesLocked(record);
    Collections.sort(mNotificationList,mRankingComparator);
    int after=findNotificationRecordIndexLocked(record);
    orderChanged=before != after;
  }
  if (orderChanged) {
    scheduleSendRankingUpdate();
  }
}
Program: 199231
Project: 199231
Buggy source:
private void scheduleRankingReconsideration(RankingFuture future){
  if (future != null) {
    Message m=Message.obtain(mRankingHandler,MESSAGE_RECONSIDER_RANKING,future);
    long delay=future.getDelay(TimeUnit.MILLISECONDS);
    mRankingHandler.sendMessageDelayed(m,delay);
  }
}

Fixed version (ground truth):
private void scheduleRankingReconsideration(RankingReconsideration recon){
  if (recon != null) {
    Message m=Message.obtain(mRankingHandler,MESSAGE_RECONSIDER_RANKING,recon);
    long delay=recon.getDelay(TimeUnit.MILLISECONDS);
    mRankingHandler.sendMessageDelayed(m,delay);
  }
}
Program: 199232
Project: 199232
Buggy source:
/** 
 * Called once per notification that is posted or updated.
 * @return null if the work is done, or a future if there is more to do. The{@link RankingFuture} will be run on a worker thread, and if notifications are re-orderedby that execution, the  {@link NotificationManagerService} may send order updateevents to the  {@link android.service.notification.NotificationListenerService}s.
 */
public RankingFuture process(NotificationManagerService.NotificationRecord notification);

Fixed version (ground truth):
/** 
 * Called once per notification that is posted or updated.
 * @return null if the work is done, or a future if there is more to do. The{@link RankingReconsideration} will be run on a worker thread, and if notificationsare re-ordered by that execution, the  {@link NotificationManagerService} may send orderupdate events to the  {@link android.service.notification.NotificationListenerService}s.
 */
public RankingReconsideration process(NotificationRecord notification);
Program: 199233
Project: 199233
Buggy source:
public RankingFuture process(NotificationManagerService.NotificationRecord record){
  if (!mEnabled) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  if (record == null || record.getNotification() == null) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  return validatePeople(record);
}

Fixed version (ground truth):
public RankingReconsideration process(NotificationRecord record){
  if (!mEnabled) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  if (record == null || record.getNotification() == null) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  return validatePeople(record);
}
Program: 199234
Project: 199234
Buggy source:
@Override public void work(){
  if (INFO)   Slog.i(TAG,"String_Node_Str" + mRecord.sbn.getKey());
  float affinity=NONE;
  for (  final String handle : pendingLookups) {
    LookupResult lookupResult=null;
    final Uri uri=Uri.parse(handle);
    if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolvePhoneContact(uri.getSchemeSpecificPart());
    }
 else     if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolveEmailContact(uri.getSchemeSpecificPart());
    }
 else     if (handle.startsWith(Contacts.CONTENT_LOOKUP_URI.toString())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=searchContacts(uri);
    }
 else {
      lookupResult=new LookupResult();
      Slog.w(TAG,"String_Node_Str" + handle);
    }
    if (lookupResult != null) {
synchronized (mPeopleCache) {
        mPeopleCache.put(handle,lookupResult);
      }
      affinity=Math.max(affinity,lookupResult.getAffinity());
    }
  }
  float affinityBound=mRecord.getContactAffinity();
  affinity=Math.max(affinity,affinityBound);
  mRecord.setContactAffinity(affinity);
  if (INFO)   Slog.i(TAG,"String_Node_Str" + affinity);
}

Fixed version (ground truth):
@Override public void work(){
  if (INFO)   Slog.i(TAG,"String_Node_Str" + record.getKey());
  for (  final String handle : pendingLookups) {
    LookupResult lookupResult=null;
    final Uri uri=Uri.parse(handle);
    if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolvePhoneContact(uri.getSchemeSpecificPart());
    }
 else     if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolveEmailContact(uri.getSchemeSpecificPart());
    }
 else     if (handle.startsWith(Contacts.CONTENT_LOOKUP_URI.toString())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=searchContacts(uri);
    }
 else {
      lookupResult=new LookupResult();
      Slog.w(TAG,"String_Node_Str" + handle);
    }
    if (lookupResult != null) {
synchronized (mPeopleCache) {
        mPeopleCache.put(handle,lookupResult);
      }
      mContactAffinity=Math.max(mContactAffinity,lookupResult.getAffinity());
    }
  }
}
Program: 199236
Project: 199236
Buggy source:
/** 
 * Removes a user and all data directories created for that user. This method should be called after the user's processes have been terminated.
 * @param userHandle the user's id
 */
public boolean removeUser(int userHandle){
  checkManageUsersPermission("String_Node_Str");
  final UserInfo user;
synchronized (mPackagesLock) {
    user=mUsers.get(userHandle);
    if (userHandle == 0 || user == null) {
      return false;
    }
    mRemovingUserIds.put(userHandle,true);
    try {
      mAppOpsService.removeUser(userHandle);
    }
 catch (    RemoteException e) {
      Log.w(LOG_TAG,"String_Node_Str",e);
    }
    user.partial=true;
    user.flags|=UserInfo.FLAG_DISABLED;
    writeUserLocked(user);
  }
  if (user.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID && user.isManagedProfile()) {
    sendProfileRemovedBroadcast(user.profileGroupId,user.id);
  }
  if (DBG)   Slog.i(LOG_TAG,"String_Node_Str" + userHandle);
  int res;
  try {
    res=ActivityManagerNative.getDefault().stopUser(userHandle,new IStopUserCallback.Stub(){
      @Override public void userStopped(      int userId){
        finishRemoveUser(userId);
      }
      @Override public void userStopAborted(      int userId){
      }
    }
);
  }
 catch (  RemoteException e) {
    return false;
  }
  return res == ActivityManager.USER_OP_SUCCESS;
}

Fixed version (ground truth):
/** 
 * Removes a user and all data directories created for that user. This method should be called after the user's processes have been terminated.
 * @param userHandle the user's id
 */
public boolean removeUser(int userHandle){
  checkManageUsersPermission("String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    final UserInfo user;
synchronized (mPackagesLock) {
      user=mUsers.get(userHandle);
      if (userHandle == 0 || user == null) {
        return false;
      }
      mRemovingUserIds.put(userHandle,true);
      try {
        mAppOpsService.removeUser(userHandle);
      }
 catch (      RemoteException e) {
        Log.w(LOG_TAG,"String_Node_Str",e);
      }
      user.partial=true;
      user.flags|=UserInfo.FLAG_DISABLED;
      writeUserLocked(user);
    }
    if (user.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID && user.isManagedProfile()) {
      sendProfileRemovedBroadcast(user.profileGroupId,user.id);
    }
    if (DBG)     Slog.i(LOG_TAG,"String_Node_Str" + userHandle);
    int res;
    try {
      res=ActivityManagerNative.getDefault().stopUser(userHandle,new IStopUserCallback.Stub(){
        @Override public void userStopped(        int userId){
          finishRemoveUser(userId);
        }
        @Override public void userStopAborted(        int userId){
        }
      }
);
    }
 catch (    RemoteException e) {
      return false;
    }
    return res == ActivityManager.USER_OP_SUCCESS;
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199237
Project: 199237
Buggy source:
public RankingFuture process(NotificationRecord record){
  if (record == null || record.getNotification() == null) {
    if (DBG)     Slog.d(TAG,"String_Node_Str");
    return null;
  }
  final Notification notification=record.getNotification();
  if ((notification.defaults & Notification.DEFAULT_VIBRATE) != 0 || notification.vibrate != null || (notification.defaults & Notification.DEFAULT_SOUND) != 0 || notification.sound != null || notification.fullScreenIntent != null) {
    record.setRecentlyIntusive(true);
  }
  return new RankingFuture(record,HANG_TIME_MS){
    @Override public void work(){
      mRecord.setRecentlyIntusive(false);
    }
  }
;
}

Fixed version (ground truth):
public RankingReconsideration process(NotificationRecord record){
  if (record == null || record.getNotification() == null) {
    if (DBG)     Slog.d(TAG,"String_Node_Str");
    return null;
  }
  final Notification notification=record.getNotification();
  if ((notification.defaults & Notification.DEFAULT_VIBRATE) != 0 || notification.vibrate != null || (notification.defaults & Notification.DEFAULT_SOUND) != 0 || notification.sound != null || notification.fullScreenIntent != null) {
    record.setRecentlyIntusive(true);
  }
  return new RankingReconsideration(record.getKey(),HANG_TIME_MS){
    @Override public void work(){
    }
    @Override public void applyChangesLocked(    NotificationRecord record){
      record.setRecentlyIntusive(false);
    }
  }
;
}
Program: 199238
Project: 199238
Buggy source:
@Override public void work(){
  mRecord.setRecentlyIntusive(false);
}

Fixed version (ground truth):
@Override public void work(){
}
Program: 199239
Project: 199239
Buggy source:
private void handleRankingReconsideration(Message message){
  if (!(message.obj instanceof RankingFuture))   return;
  RankingFuture future=(RankingFuture)message.obj;
  future.run();
  try {
    NotificationRecord record=future.get();
synchronized (mNotificationList) {
      int before=mNotificationList.indexOf(record);
      if (before != -1) {
        Collections.sort(mNotificationList,mRankingComparator);
        int after=mNotificationList.indexOf(record);
        if (before != after) {
          scheduleSendRankingUpdate();
        }
      }
    }
  }
 catch (  InterruptedException e) {
  }
catch (  ExecutionException e) {
  }
}

Fixed version (ground truth):
private void handleRankingReconsideration(Message message){
  if (!(message.obj instanceof RankingReconsideration))   return;
  RankingReconsideration recon=(RankingReconsideration)message.obj;
  recon.run();
  boolean orderChanged;
synchronized (mNotificationList) {
    final NotificationRecord record=mNotificationsByKey.get(recon.getKey());
    if (record == null) {
      return;
    }
    int before=findNotificationRecordIndexLocked(record);
    recon.applyChangesLocked(record);
    Collections.sort(mNotificationList,mRankingComparator);
    int after=findNotificationRecordIndexLocked(record);
    orderChanged=before != after;
  }
  if (orderChanged) {
    scheduleSendRankingUpdate();
  }
}
Program: 199241
Project: 199241
Buggy source:
private void scheduleRankingReconsideration(RankingFuture future){
  if (future != null) {
    Message m=Message.obtain(mRankingHandler,MESSAGE_RECONSIDER_RANKING,future);
    long delay=future.getDelay(TimeUnit.MILLISECONDS);
    mRankingHandler.sendMessageDelayed(m,delay);
  }
}

Fixed version (ground truth):
private void scheduleRankingReconsideration(RankingReconsideration recon){
  if (recon != null) {
    Message m=Message.obtain(mRankingHandler,MESSAGE_RECONSIDER_RANKING,recon);
    long delay=recon.getDelay(TimeUnit.MILLISECONDS);
    mRankingHandler.sendMessageDelayed(m,delay);
  }
}
Program: 199242
Project: 199242
Buggy source:
/** 
 * Called once per notification that is posted or updated.
 * @return null if the work is done, or a future if there is more to do. The{@link RankingFuture} will be run on a worker thread, and if notifications are re-orderedby that execution, the  {@link NotificationManagerService} may send order updateevents to the  {@link android.service.notification.NotificationListenerService}s.
 */
public RankingFuture process(NotificationManagerService.NotificationRecord notification);

Fixed version (ground truth):
/** 
 * Called once per notification that is posted or updated.
 * @return null if the work is done, or a future if there is more to do. The{@link RankingReconsideration} will be run on a worker thread, and if notificationsare re-ordered by that execution, the  {@link NotificationManagerService} may send orderupdate events to the  {@link android.service.notification.NotificationListenerService}s.
 */
public RankingReconsideration process(NotificationRecord notification);
Program: 199243
Project: 199243
Buggy source:
public RankingFuture process(NotificationManagerService.NotificationRecord record){
  if (!mEnabled) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  if (record == null || record.getNotification() == null) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  return validatePeople(record);
}

Fixed version (ground truth):
public RankingReconsideration process(NotificationRecord record){
  if (!mEnabled) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  if (record == null || record.getNotification() == null) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  return validatePeople(record);
}
Program: 199244
Project: 199244
Buggy source:
@Override public void work(){
  if (INFO)   Slog.i(TAG,"String_Node_Str" + mRecord.sbn.getKey());
  float affinity=NONE;
  for (  final String handle : pendingLookups) {
    LookupResult lookupResult=null;
    final Uri uri=Uri.parse(handle);
    if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolvePhoneContact(uri.getSchemeSpecificPart());
    }
 else     if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolveEmailContact(uri.getSchemeSpecificPart());
    }
 else     if (handle.startsWith(Contacts.CONTENT_LOOKUP_URI.toString())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=searchContacts(uri);
    }
 else {
      lookupResult=new LookupResult();
      Slog.w(TAG,"String_Node_Str" + handle);
    }
    if (lookupResult != null) {
synchronized (mPeopleCache) {
        mPeopleCache.put(handle,lookupResult);
      }
      affinity=Math.max(affinity,lookupResult.getAffinity());
    }
  }
  float affinityBound=mRecord.getContactAffinity();
  affinity=Math.max(affinity,affinityBound);
  mRecord.setContactAffinity(affinity);
  if (INFO)   Slog.i(TAG,"String_Node_Str" + affinity);
}

Fixed version (ground truth):
@Override public void work(){
  if (INFO)   Slog.i(TAG,"String_Node_Str" + record.getKey());
  for (  final String handle : pendingLookups) {
    LookupResult lookupResult=null;
    final Uri uri=Uri.parse(handle);
    if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolvePhoneContact(uri.getSchemeSpecificPart());
    }
 else     if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolveEmailContact(uri.getSchemeSpecificPart());
    }
 else     if (handle.startsWith(Contacts.CONTENT_LOOKUP_URI.toString())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=searchContacts(uri);
    }
 else {
      lookupResult=new LookupResult();
      Slog.w(TAG,"String_Node_Str" + handle);
    }
    if (lookupResult != null) {
synchronized (mPeopleCache) {
        mPeopleCache.put(handle,lookupResult);
      }
      mContactAffinity=Math.max(mContactAffinity,lookupResult.getAffinity());
    }
  }
}
Program: 199246
Project: 199246
Buggy source:
public RankingFuture process(NotificationRecord record){
  if (record == null || record.getNotification() == null) {
    if (DBG)     Slog.d(TAG,"String_Node_Str");
    return null;
  }
  final Notification notification=record.getNotification();
  if ((notification.defaults & Notification.DEFAULT_VIBRATE) != 0 || notification.vibrate != null || (notification.defaults & Notification.DEFAULT_SOUND) != 0 || notification.sound != null || notification.fullScreenIntent != null) {
    record.setRecentlyIntusive(true);
  }
  return new RankingFuture(record,HANG_TIME_MS){
    @Override public void work(){
      mRecord.setRecentlyIntusive(false);
    }
  }
;
}

Fixed version (ground truth):
public RankingReconsideration process(NotificationRecord record){
  if (record == null || record.getNotification() == null) {
    if (DBG)     Slog.d(TAG,"String_Node_Str");
    return null;
  }
  final Notification notification=record.getNotification();
  if ((notification.defaults & Notification.DEFAULT_VIBRATE) != 0 || notification.vibrate != null || (notification.defaults & Notification.DEFAULT_SOUND) != 0 || notification.sound != null || notification.fullScreenIntent != null) {
    record.setRecentlyIntusive(true);
  }
  return new RankingReconsideration(record.getKey(),HANG_TIME_MS){
    @Override public void work(){
    }
    @Override public void applyChangesLocked(    NotificationRecord record){
      record.setRecentlyIntusive(false);
    }
  }
;
}
Program: 199247
Project: 199247
Buggy source:
@Override public void work(){
  mRecord.setRecentlyIntusive(false);
}

Fixed version (ground truth):
@Override public void work(){
}
Program: 199248
Project: 199248
Buggy source:
private void handleRankingReconsideration(Message message){
  if (!(message.obj instanceof RankingFuture))   return;
  RankingFuture future=(RankingFuture)message.obj;
  future.run();
  try {
    NotificationRecord record=future.get();
synchronized (mNotificationList) {
      int before=mNotificationList.indexOf(record);
      if (before != -1) {
        Collections.sort(mNotificationList,mRankingComparator);
        int after=mNotificationList.indexOf(record);
        if (before != after) {
          scheduleSendRankingUpdate();
        }
      }
    }
  }
 catch (  InterruptedException e) {
  }
catch (  ExecutionException e) {
  }
}

Fixed version (ground truth):
private void handleRankingReconsideration(Message message){
  if (!(message.obj instanceof RankingReconsideration))   return;
  RankingReconsideration recon=(RankingReconsideration)message.obj;
  recon.run();
  boolean orderChanged;
synchronized (mNotificationList) {
    final NotificationRecord record=mNotificationsByKey.get(recon.getKey());
    if (record == null) {
      return;
    }
    int before=findNotificationRecordIndexLocked(record);
    recon.applyChangesLocked(record);
    Collections.sort(mNotificationList,mRankingComparator);
    int after=findNotificationRecordIndexLocked(record);
    orderChanged=before != after;
  }
  if (orderChanged) {
    scheduleSendRankingUpdate();
  }
}
Program: 199250
Project: 199250
Buggy source:
private void scheduleRankingReconsideration(RankingFuture future){
  if (future != null) {
    Message m=Message.obtain(mRankingHandler,MESSAGE_RECONSIDER_RANKING,future);
    long delay=future.getDelay(TimeUnit.MILLISECONDS);
    mRankingHandler.sendMessageDelayed(m,delay);
  }
}

Fixed version (ground truth):
private void scheduleRankingReconsideration(RankingReconsideration recon){
  if (recon != null) {
    Message m=Message.obtain(mRankingHandler,MESSAGE_RECONSIDER_RANKING,recon);
    long delay=recon.getDelay(TimeUnit.MILLISECONDS);
    mRankingHandler.sendMessageDelayed(m,delay);
  }
}
Program: 199251
Project: 199251
Buggy source:
/** 
 * Called once per notification that is posted or updated.
 * @return null if the work is done, or a future if there is more to do. The{@link RankingFuture} will be run on a worker thread, and if notifications are re-orderedby that execution, the  {@link NotificationManagerService} may send order updateevents to the  {@link android.service.notification.NotificationListenerService}s.
 */
public RankingFuture process(NotificationManagerService.NotificationRecord notification);

Fixed version (ground truth):
/** 
 * Called once per notification that is posted or updated.
 * @return null if the work is done, or a future if there is more to do. The{@link RankingReconsideration} will be run on a worker thread, and if notificationsare re-ordered by that execution, the  {@link NotificationManagerService} may send orderupdate events to the  {@link android.service.notification.NotificationListenerService}s.
 */
public RankingReconsideration process(NotificationRecord notification);
Program: 199252
Project: 199252
Buggy source:
public RankingFuture process(NotificationManagerService.NotificationRecord record){
  if (!mEnabled) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  if (record == null || record.getNotification() == null) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  return validatePeople(record);
}

Fixed version (ground truth):
public RankingReconsideration process(NotificationRecord record){
  if (!mEnabled) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  if (record == null || record.getNotification() == null) {
    if (INFO)     Slog.i(TAG,"String_Node_Str");
    return null;
  }
  return validatePeople(record);
}
Program: 199253
Project: 199253
Buggy source:
@Override public void work(){
  if (INFO)   Slog.i(TAG,"String_Node_Str" + mRecord.sbn.getKey());
  float affinity=NONE;
  for (  final String handle : pendingLookups) {
    LookupResult lookupResult=null;
    final Uri uri=Uri.parse(handle);
    if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolvePhoneContact(uri.getSchemeSpecificPart());
    }
 else     if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolveEmailContact(uri.getSchemeSpecificPart());
    }
 else     if (handle.startsWith(Contacts.CONTENT_LOOKUP_URI.toString())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=searchContacts(uri);
    }
 else {
      lookupResult=new LookupResult();
      Slog.w(TAG,"String_Node_Str" + handle);
    }
    if (lookupResult != null) {
synchronized (mPeopleCache) {
        mPeopleCache.put(handle,lookupResult);
      }
      affinity=Math.max(affinity,lookupResult.getAffinity());
    }
  }
  float affinityBound=mRecord.getContactAffinity();
  affinity=Math.max(affinity,affinityBound);
  mRecord.setContactAffinity(affinity);
  if (INFO)   Slog.i(TAG,"String_Node_Str" + affinity);
}

Fixed version (ground truth):
@Override public void work(){
  if (INFO)   Slog.i(TAG,"String_Node_Str" + record.getKey());
  for (  final String handle : pendingLookups) {
    LookupResult lookupResult=null;
    final Uri uri=Uri.parse(handle);
    if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolvePhoneContact(uri.getSchemeSpecificPart());
    }
 else     if ("String_Node_Str".equals(uri.getScheme())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=resolveEmailContact(uri.getSchemeSpecificPart());
    }
 else     if (handle.startsWith(Contacts.CONTENT_LOOKUP_URI.toString())) {
      if (DEBUG)       Slog.d(TAG,"String_Node_Str" + handle);
      lookupResult=searchContacts(uri);
    }
 else {
      lookupResult=new LookupResult();
      Slog.w(TAG,"String_Node_Str" + handle);
    }
    if (lookupResult != null) {
synchronized (mPeopleCache) {
        mPeopleCache.put(handle,lookupResult);
      }
      mContactAffinity=Math.max(mContactAffinity,lookupResult.getAffinity());
    }
  }
}
Program: 199255
Project: 199255
Buggy source:
/** 
 * Removes a user and all data directories created for that user. This method should be called after the user's processes have been terminated.
 * @param userHandle the user's id
 */
public boolean removeUser(int userHandle){
  checkManageUsersPermission("String_Node_Str");
  final UserInfo user;
synchronized (mPackagesLock) {
    user=mUsers.get(userHandle);
    if (userHandle == 0 || user == null) {
      return false;
    }
    mRemovingUserIds.put(userHandle,true);
    try {
      mAppOpsService.removeUser(userHandle);
    }
 catch (    RemoteException e) {
      Log.w(LOG_TAG,"String_Node_Str",e);
    }
    user.partial=true;
    user.flags|=UserInfo.FLAG_DISABLED;
    writeUserLocked(user);
  }
  if (user.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID && user.isManagedProfile()) {
    sendProfileRemovedBroadcast(user.profileGroupId,user.id);
  }
  if (DBG)   Slog.i(LOG_TAG,"String_Node_Str" + userHandle);
  int res;
  try {
    res=ActivityManagerNative.getDefault().stopUser(userHandle,new IStopUserCallback.Stub(){
      @Override public void userStopped(      int userId){
        finishRemoveUser(userId);
      }
      @Override public void userStopAborted(      int userId){
      }
    }
);
  }
 catch (  RemoteException e) {
    return false;
  }
  return res == ActivityManager.USER_OP_SUCCESS;
}

Fixed version (ground truth):
/** 
 * Removes a user and all data directories created for that user. This method should be called after the user's processes have been terminated.
 * @param userHandle the user's id
 */
public boolean removeUser(int userHandle){
  checkManageUsersPermission("String_Node_Str");
  long ident=Binder.clearCallingIdentity();
  try {
    final UserInfo user;
synchronized (mPackagesLock) {
      user=mUsers.get(userHandle);
      if (userHandle == 0 || user == null) {
        return false;
      }
      mRemovingUserIds.put(userHandle,true);
      try {
        mAppOpsService.removeUser(userHandle);
      }
 catch (      RemoteException e) {
        Log.w(LOG_TAG,"String_Node_Str",e);
      }
      user.partial=true;
      user.flags|=UserInfo.FLAG_DISABLED;
      writeUserLocked(user);
    }
    if (user.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID && user.isManagedProfile()) {
      sendProfileRemovedBroadcast(user.profileGroupId,user.id);
    }
    if (DBG)     Slog.i(LOG_TAG,"String_Node_Str" + userHandle);
    int res;
    try {
      res=ActivityManagerNative.getDefault().stopUser(userHandle,new IStopUserCallback.Stub(){
        @Override public void userStopped(        int userId){
          finishRemoveUser(userId);
        }
        @Override public void userStopAborted(        int userId){
        }
      }
);
    }
 catch (    RemoteException e) {
      return false;
    }
    return res == ActivityManager.USER_OP_SUCCESS;
  }
  finally {
    Binder.restoreCallingIdentity(ident);
  }
}
Program: 199256
Project: 199256
Buggy source:
@Override protected void onFinishInflate(){
  super.onFinishInflate();
  mBackground=findViewById(R.id.background);
  mSystemIconsContainer=(ViewGroup)findViewById(R.id.system_icons_container);
  mDateTime=findViewById(R.id.datetime);
  mKeyguardCarrierText=findViewById(R.id.keyguard_carrier_text);
  mMultiUserSwitch=(MultiUserSwitch)findViewById(R.id.multi_user_switch);
  mDate=findViewById(R.id.date);
  mSettingsButton=findViewById(R.id.settings_button);
  mSettingsButton.setOnClickListener(this);
  mBrightnessContainer=findViewById(R.id.brightness_container);
  mBrightnessController=new BrightnessController(getContext(),(ImageView)findViewById(R.id.brightness_icon),(ToggleSlider)findViewById(R.id.brightness_slider));
  loadDimens();
  updateVisibilities();
}

Fixed version (ground truth):
@Override protected void onFinishInflate(){
  super.onFinishInflate();
  mBackground=findViewById(R.id.background);
  mSystemIconsContainer=(ViewGroup)findViewById(R.id.system_icons_container);
  mDateTime=findViewById(R.id.datetime);
  mKeyguardCarrierText=findViewById(R.id.keyguard_carrier_text);
  mMultiUserSwitch=(MultiUserSwitch)findViewById(R.id.multi_user_switch);
  mDate=findViewById(R.id.date);
  mSettingsButton=findViewById(R.id.settings_button);
  mSettingsButton.setOnClickListener(this);
  mBrightnessContainer=findViewById(R.id.brightness_container);
  mBrightnessController=new BrightnessController(getContext(),(ImageView)findViewById(R.id.brightness_icon),(ToggleSlider)findViewById(R.id.brightness_slider));
  loadDimens();
  updateVisibilities();
  addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
    @Override public void onLayoutChange(    View v,    int left,    int top,    int right,    int bottom,    int oldLeft,    int oldTop,    int oldRight,    int oldBottom){
      if ((right - left) != (oldRight - oldLeft)) {
        setClipping(getHeight());
      }
    }
  }
);
}