nus-yam/ex-repair huggingface dataset:
Program: 193982
Project: 193982
Buggy source:
/** 
 * Creates a new asynchronous task. This constructor must be invoked on the UI thread.
 */
public AsyncTask(){
  mWorker=new WorkerRunnable<Params,Result>(){
    public Result call() throws Exception {
      mTaskInvoked.set(true);
      Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
      return postResult(doInBackground(mParams));
    }
  }
;
  mFuture=new FutureTask<Result>(mWorker){
    @Override protected void done(){
      try {
        postResultIfNotInvoked(get());
      }
 catch (      InterruptedException e) {
        android.util.Log.w(LOG_TAG,e);
      }
catch (      ExecutionException e) {
        throw new RuntimeException("String_Node_Str",e.getCause());
      }
catch (      CancellationException e) {
        postResultIfNotInvoked(null);
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates a new asynchronous task. This constructor must be invoked on the UI thread.
 */
public AsyncTask(){
  mWorker=new WorkerRunnable<Params,Result>(){
    public Result call() throws Exception {
      mTaskInvoked.set(true);
      Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
      Result result=doInBackground(mParams);
      Binder.flushPendingCommands();
      return postResult(result);
    }
  }
;
  mFuture=new FutureTask<Result>(mWorker){
    @Override protected void done(){
      try {
        postResultIfNotInvoked(get());
      }
 catch (      InterruptedException e) {
        android.util.Log.w(LOG_TAG,e);
      }
catch (      ExecutionException e) {
        throw new RuntimeException("String_Node_Str",e.getCause());
      }
catch (      CancellationException e) {
        postResultIfNotInvoked(null);
      }
    }
  }
;
}
Program: 193983
Project: 193983
Buggy source:
public Result call() throws Exception {
  mTaskInvoked.set(true);
  Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
  return postResult(doInBackground(mParams));
}

Fixed version (ground truth):
public Result call() throws Exception {
  mTaskInvoked.set(true);
  Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
  Result result=doInBackground(mParams);
  Binder.flushPendingCommands();
  return postResult(result);
}
Program: 193984
Project: 193984
Buggy source:
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
}

Fixed version (ground truth):
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
  mScrimHandler=new Handler();
}
Program: 193985
Project: 193985
Buggy source:
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrim.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}

Fixed version (ground truth):
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrimHandler.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}
Program: 193986
Project: 193986
Buggy source:
public void hideScrim(){
  mScrim.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}

Fixed version (ground truth):
public void hideScrim(){
  mScrimHandler.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}
Program: 193987
Project: 193987
Buggy source:
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
}

Fixed version (ground truth):
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
  mScrimHandler=new Handler();
}
Program: 193988
Project: 193988
Buggy source:
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrim.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}

Fixed version (ground truth):
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrimHandler.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}
Program: 193989
Project: 193989
Buggy source:
public void hideScrim(){
  mScrim.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}

Fixed version (ground truth):
public void hideScrim(){
  mScrimHandler.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}
Program: 193990
Project: 193990
Buggy source:
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
}

Fixed version (ground truth):
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
  mScrimHandler=new Handler();
}
Program: 193991
Project: 193991
Buggy source:
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrim.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}

Fixed version (ground truth):
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrimHandler.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}
Program: 193992
Project: 193992
Buggy source:
public void hideScrim(){
  mScrim.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}

Fixed version (ground truth):
public void hideScrim(){
  mScrimHandler.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}
Program: 193993
Project: 193993
Buggy source:
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
}

Fixed version (ground truth):
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
  mScrimHandler=new Handler();
}
Program: 193994
Project: 193994
Buggy source:
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrim.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}

Fixed version (ground truth):
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrimHandler.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}
Program: 193995
Project: 193995
Buggy source:
public void hideScrim(){
  mScrim.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}

Fixed version (ground truth):
public void hideScrim(){
  mScrimHandler.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}
Program: 193996
Project: 193996
Buggy source:
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
}

Fixed version (ground truth):
public KeyguardServiceDelegate(Context context){
  mContext=context;
  mScrim=createScrim(context);
  mScrimHandler=new Handler();
}
Program: 193997
Project: 193997
Buggy source:
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrim.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}

Fixed version (ground truth):
public void showScrim(){
synchronized (mKeyguardState) {
    if (!mKeyguardState.deviceHasKeyguard)     return;
    mScrimHandler.post(new Runnable(){
      @Override public void run(){
        mScrim.setVisibility(View.VISIBLE);
      }
    }
);
  }
}
Program: 193998
Project: 193998
Buggy source:
public void hideScrim(){
  mScrim.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}

Fixed version (ground truth):
public void hideScrim(){
  mScrimHandler.post(new Runnable(){
    @Override public void run(){
      mScrim.setVisibility(View.GONE);
    }
  }
);
}
Program: 194000
Project: 194000
Buggy source:
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}

Fixed version (ground truth):
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old == proc && proc.persistent) {
    Slog.w(TAG,"String_Node_Str" + proc);
  }
 else   if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}
Program: 194001
Project: 194001
Buggy source:
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}

Fixed version (ground truth):
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null || data == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}
Program: 194004
Project: 194004
Buggy source:
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}

Fixed version (ground truth):
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old == proc && proc.persistent) {
    Slog.w(TAG,"String_Node_Str" + proc);
  }
 else   if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}
Program: 194005
Project: 194005
Buggy source:
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}

Fixed version (ground truth):
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old == proc && proc.persistent) {
    Slog.w(TAG,"String_Node_Str" + proc);
  }
 else   if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}
Program: 194006
Project: 194006
Buggy source:
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}

Fixed version (ground truth):
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null || data == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}
Program: 194010
Project: 194010
Buggy source:
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}

Fixed version (ground truth):
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old == proc && proc.persistent) {
    Slog.w(TAG,"String_Node_Str" + proc);
  }
 else   if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}
Program: 194011
Project: 194011
Buggy source:
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}

Fixed version (ground truth):
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old == proc && proc.persistent) {
    Slog.w(TAG,"String_Node_Str" + proc);
  }
 else   if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}
Program: 194012
Project: 194012
Buggy source:
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}

Fixed version (ground truth):
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null || data == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}
Program: 194015
Project: 194015
Buggy source:
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}

Fixed version (ground truth):
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null || data == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}
Program: 194017
Project: 194017
Buggy source:
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}

Fixed version (ground truth):
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null || data == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}
Program: 194019
Project: 194019
Buggy source:
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}

Fixed version (ground truth):
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old == proc && proc.persistent) {
    Slog.w(TAG,"String_Node_Str" + proc);
  }
 else   if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}
Program: 194021
Project: 194021
Buggy source:
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}

Fixed version (ground truth):
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old == proc && proc.persistent) {
    Slog.w(TAG,"String_Node_Str" + proc);
  }
 else   if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}
Program: 194022
Project: 194022
Buggy source:
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}

Fixed version (ground truth):
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null || data == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}
Program: 194024
Project: 194024
Buggy source:
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}

Fixed version (ground truth):
private final void addProcessNameLocked(ProcessRecord proc){
  ProcessRecord old=removeProcessNameLocked(proc.processName,proc.uid);
  if (old == proc && proc.persistent) {
    Slog.w(TAG,"String_Node_Str" + proc);
  }
 else   if (old != null) {
    Slog.wtf(TAG,"String_Node_Str" + old + "String_Node_Str"+ proc);
  }
  UidRecord uidRec=mActiveUids.get(proc.uid);
  if (uidRec == null) {
    uidRec=new UidRecord(proc.uid);
    if (DEBUG_UID_OBSERVERS)     Slog.i(TAG_UID_OBSERVERS,"String_Node_Str" + uidRec);
    mActiveUids.put(proc.uid,uidRec);
    enqueueUidChangeLocked(uidRec,false);
  }
  proc.uidRecord=uidRec;
  uidRec.numProcs++;
  mProcessNames.put(proc.processName,proc.uid,proc);
  if (proc.isolated) {
    mIsolatedProcesses.put(proc.uid,proc);
  }
}
Program: 194026
Project: 194026
Buggy source:
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}

Fixed version (ground truth):
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null || data == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}
Program: 194029
Project: 194029
Buggy source:
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}

Fixed version (ground truth):
/** 
 * Match this intent filter against the given Intent data.  This ignores the data scheme -- unlike   {@link #matchData}, the authority will match regardless of whether there is a matching scheme.
 * @param data The data whose authority is being looked for.
 * @return Returns either {@link #MATCH_CATEGORY_HOST},  {@link #MATCH_CATEGORY_PORT},   {@link #NO_MATCH_DATA}.
 */
public final int matchDataAuthority(Uri data){
  if (mDataAuthorities == null || data == null) {
    return NO_MATCH_DATA;
  }
  final int numDataAuthorities=mDataAuthorities.size();
  for (int i=0; i < numDataAuthorities; i++) {
    final AuthorityEntry ae=mDataAuthorities.get(i);
    int match=ae.match(data);
    if (match >= 0) {
      return match;
    }
  }
  return NO_MATCH_DATA;
}
Program: 194031
Project: 194031
Buggy source:
@Override public void onClick(View v){
  detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
}

Fixed version (ground truth):
@Override public void onClick(View v){
  boolean checked=!mQsDetailHeaderSwitch.isChecked();
  mQsDetailHeaderSwitch.setChecked(checked);
  detail.setToggleState(checked);
}
Program: 194032
Project: 194032
Buggy source:
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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);
  }
}

Fixed version (ground truth):
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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){
          boolean checked=!mQsDetailHeaderSwitch.isChecked();
          mQsDetailHeaderSwitch.setChecked(checked);
          detail.setToggleState(checked);
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}
Program: 194033
Project: 194033
Buggy source:
@Override public void onClick(View v){
  detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
}

Fixed version (ground truth):
@Override public void onClick(View v){
  boolean checked=!mQsDetailHeaderSwitch.isChecked();
  mQsDetailHeaderSwitch.setChecked(checked);
  detail.setToggleState(checked);
}
Program: 194034
Project: 194034
Buggy source:
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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);
  }
}

Fixed version (ground truth):
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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){
          boolean checked=!mQsDetailHeaderSwitch.isChecked();
          mQsDetailHeaderSwitch.setChecked(checked);
          detail.setToggleState(checked);
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}
Program: 194035
Project: 194035
Buggy source:
@Override public void onClick(View v){
  detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
}

Fixed version (ground truth):
@Override public void onClick(View v){
  boolean checked=!mQsDetailHeaderSwitch.isChecked();
  mQsDetailHeaderSwitch.setChecked(checked);
  detail.setToggleState(checked);
}
Program: 194036
Project: 194036
Buggy source:
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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);
  }
}

Fixed version (ground truth):
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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){
          boolean checked=!mQsDetailHeaderSwitch.isChecked();
          mQsDetailHeaderSwitch.setChecked(checked);
          detail.setToggleState(checked);
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}
Program: 194037
Project: 194037
Buggy source:
@Override public void onClick(View v){
  detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
}

Fixed version (ground truth):
@Override public void onClick(View v){
  boolean checked=!mQsDetailHeaderSwitch.isChecked();
  mQsDetailHeaderSwitch.setChecked(checked);
  detail.setToggleState(checked);
}
Program: 194038
Project: 194038
Buggy source:
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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);
  }
}

Fixed version (ground truth):
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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){
          boolean checked=!mQsDetailHeaderSwitch.isChecked();
          mQsDetailHeaderSwitch.setChecked(checked);
          detail.setToggleState(checked);
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}
Program: 194039
Project: 194039
Buggy source:
@Override public void onClick(View v){
  detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
}

Fixed version (ground truth):
@Override public void onClick(View v){
  boolean checked=!mQsDetailHeaderSwitch.isChecked();
  mQsDetailHeaderSwitch.setChecked(checked);
  detail.setToggleState(checked);
}
Program: 194040
Project: 194040
Buggy source:
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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);
  }
}

Fixed version (ground truth):
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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){
          boolean checked=!mQsDetailHeaderSwitch.isChecked();
          mQsDetailHeaderSwitch.setChecked(checked);
          detail.setToggleState(checked);
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}
Program: 194041
Project: 194041
Buggy source:
@Override public void onClick(View v){
  detail.setToggleState(!mQsDetailHeaderSwitch.isChecked());
}

Fixed version (ground truth):
@Override public void onClick(View v){
  boolean checked=!mQsDetailHeaderSwitch.isChecked();
  mQsDetailHeaderSwitch.setChecked(checked);
  detail.setToggleState(checked);
}
Program: 194042
Project: 194042
Buggy source:
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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);
  }
}

Fixed version (ground truth):
private void handleShowingDetail(final QSTile.DetailAdapter detail){
  final boolean showingDetail=detail != null;
  transition(mClock,!showingDetail);
  transition(mDateGroup,!showingDetail);
  if (mAlarmShowing) {
    transition(mAlarmStatus,!showingDetail);
  }
  transition(mQsDetailHeader,showingDetail);
  mShowingDetail=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){
          boolean checked=!mQsDetailHeaderSwitch.isChecked();
          mQsDetailHeaderSwitch.setChecked(checked);
          detail.setToggleState(checked);
        }
      }
);
    }
  }
 else {
    mQsDetailHeader.setClickable(false);
  }
}