nus-yam/ex-repair huggingface dataset:
Program: 191347
Project: 191347
Buggy source:
public void writeToParcel(Parcel out,int flags){
  out.writeInt(category);
  out.writeInt(id);
  out.writeInt(minTimeMs);
  out.writeInt(maxTimeMs);
  out.writeInt(averageTimeMs);
  out.writeLong(sampleCount);
  if (initialTimings == null) {
    out.writeInt(ABSENT);
  }
 else {
    out.writeInt(PRESENT);
    out.writeIntArray(initialTimings);
  }
  out.writeInt(bucketCount);
  out.writeIntArray(bucketEndPoints);
  out.writeIntArray(bucketCounters);
}

Fixed version (ground truth):
public void writeToParcel(Parcel out,int flags){
  out.writeInt(category);
  out.writeInt(id);
  out.writeInt(minTimeMs);
  out.writeInt(maxTimeMs);
  out.writeInt(averageTimeMs);
  out.writeInt(sampleCount);
  if (initialTimings == null) {
    out.writeInt(ABSENT);
  }
 else {
    out.writeInt(PRESENT);
    out.writeIntArray(initialTimings);
  }
  out.writeInt(bucketCount);
  out.writeIntArray(bucketEndPoints);
  out.writeIntArray(bucketCounters);
}
Program: 191348
Project: 191348
Buggy source:
public void writeToParcel(Parcel out,int flags){
  out.writeInt(category);
  out.writeInt(id);
  out.writeInt(minTimeMs);
  out.writeInt(maxTimeMs);
  out.writeInt(averageTimeMs);
  out.writeLong(sampleCount);
  if (initialTimings == null) {
    out.writeInt(ABSENT);
  }
 else {
    out.writeInt(PRESENT);
    out.writeIntArray(initialTimings);
  }
  out.writeInt(bucketCount);
  out.writeIntArray(bucketEndPoints);
  out.writeIntArray(bucketCounters);
}

Fixed version (ground truth):
public void writeToParcel(Parcel out,int flags){
  out.writeInt(category);
  out.writeInt(id);
  out.writeInt(minTimeMs);
  out.writeInt(maxTimeMs);
  out.writeInt(averageTimeMs);
  out.writeInt(sampleCount);
  if (initialTimings == null) {
    out.writeInt(ABSENT);
  }
 else {
    out.writeInt(PRESENT);
    out.writeIntArray(initialTimings);
  }
  out.writeInt(bucketCount);
  out.writeIntArray(bucketEndPoints);
  out.writeIntArray(bucketCounters);
}
Program: 191349
Project: 191349
Buggy source:
@Override public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfoInternal(info);
  final int scrollRange=getScrollRange();
  if (scrollRange > 0) {
    info.setScrollable(true);
    if (mScrollY > 0) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP);
    }
    if (mScrollY < scrollRange) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_DOWN);
    }
  }
}

Fixed version (ground truth):
@Override public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfoInternal(info);
  final int scrollRange=getScrollRange();
  if (scrollRange > 0) {
    info.setScrollable(true);
    if (mScrollY > 0) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP);
    }
    if (mScrollY < scrollRange) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_DOWN);
    }
  }
  info.setClassName(ScrollView.class.getName());
}
Program: 191358
Project: 191358
Buggy source:
@Override public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfoInternal(info);
  final int scrollRange=getScrollRange();
  if (scrollRange > 0) {
    info.setScrollable(true);
    if (mScrollY > 0) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP);
    }
    if (mScrollY < scrollRange) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_DOWN);
    }
  }
}

Fixed version (ground truth):
@Override public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfoInternal(info);
  final int scrollRange=getScrollRange();
  if (scrollRange > 0) {
    info.setScrollable(true);
    if (mScrollY > 0) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP);
    }
    if (mScrollY < scrollRange) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_DOWN);
    }
  }
  info.setClassName(ScrollView.class.getName());
}
Program: 191359
Project: 191359
Buggy source:
@Override public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfoInternal(info);
  final int scrollRange=getScrollRange();
  if (scrollRange > 0) {
    info.setScrollable(true);
    if (mScrollY > 0) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP);
    }
    if (mScrollY < scrollRange) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_DOWN);
    }
  }
}

Fixed version (ground truth):
@Override public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info){
  super.onInitializeAccessibilityNodeInfoInternal(info);
  final int scrollRange=getScrollRange();
  if (scrollRange > 0) {
    info.setScrollable(true);
    if (mScrollY > 0) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_BACKWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_UP);
    }
    if (mScrollY < scrollRange) {
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_FORWARD);
      info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SCROLL_DOWN);
    }
  }
  info.setClassName(ScrollView.class.getName());
}
Program: 191360
Project: 191360
Buggy source:
private void applyMacroBlockLimits(int maxHorizontalBlocks,int maxVerticalBlocks,int maxBlocks,long maxBlocksPerSecond,int blockWidth,int blockHeight,int widthAlignment,int heightAlignment){
  applyAlignment(widthAlignment,heightAlignment);
  applyBlockLimits(blockWidth,blockHeight,Range.create(1,maxBlocks),Range.create(1L,maxBlocksPerSecond),Range.create(new Rational(1,maxVerticalBlocks),new Rational(maxHorizontalBlocks,1)));
  mHorizontalBlockRange=mHorizontalBlockRange.intersect(1,maxHorizontalBlocks / (mBlockWidth / blockWidth));
  mVerticalBlockRange=mVerticalBlockRange.intersect(1,maxVerticalBlocks / (mBlockHeight / blockHeight));
}

Fixed version (ground truth):
private void applyMacroBlockLimits(int minHorizontalBlocks,int minVerticalBlocks,int maxHorizontalBlocks,int maxVerticalBlocks,int maxBlocks,long maxBlocksPerSecond,int blockWidth,int blockHeight,int widthAlignment,int heightAlignment){
  applyAlignment(widthAlignment,heightAlignment);
  applyBlockLimits(blockWidth,blockHeight,Range.create(1,maxBlocks),Range.create(1L,maxBlocksPerSecond),Range.create(new Rational(1,maxVerticalBlocks),new Rational(maxHorizontalBlocks,1)));
  mHorizontalBlockRange=mHorizontalBlockRange.intersect(Utils.divUp(minHorizontalBlocks,(mBlockWidth / blockWidth)),maxHorizontalBlocks / (mBlockWidth / blockWidth));
  mVerticalBlockRange=mVerticalBlockRange.intersect(Utils.divUp(minVerticalBlocks,(mBlockHeight / blockHeight)),maxVerticalBlocks / (mBlockHeight / blockHeight));
}
Program: 191361
Project: 191361
Buggy source:
private boolean supportsProfileLevel(int profile,Integer level){
  for (  CodecProfileLevel pl : profileLevels) {
    if (pl.profile != profile) {
      continue;
    }
    if (level == null || mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_AUDIO_AAC)) {
      return true;
    }
    if (mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_H263)) {
      if (pl.level != level && pl.level == CodecProfileLevel.H263Level45 && level > CodecProfileLevel.H263Level10) {
        continue;
      }
    }
    if (pl.level >= level) {
      if (createFromProfileLevel(mMime,profile,pl.level) != null) {
        return createFromProfileLevel(mMime,profile,level) != null;
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean supportsProfileLevel(int profile,Integer level){
  for (  CodecProfileLevel pl : profileLevels) {
    if (pl.profile != profile) {
      continue;
    }
    if (level == null || mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_AUDIO_AAC)) {
      return true;
    }
    if (mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_H263)) {
      if (pl.level != level && pl.level == CodecProfileLevel.H263Level45 && level > CodecProfileLevel.H263Level10) {
        continue;
      }
    }
    if (mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_MPEG4)) {
      if (pl.level != level && pl.level == CodecProfileLevel.MPEG4Level1 && level > CodecProfileLevel.MPEG4Level0) {
        continue;
      }
    }
    if (mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_HEVC)) {
      boolean supportsHighTier=(pl.level & CodecProfileLevel.HEVCHighTierLevels) != 0;
      boolean checkingHighTier=(level & CodecProfileLevel.HEVCHighTierLevels) != 0;
      if (checkingHighTier && !supportsHighTier) {
        continue;
      }
    }
    if (pl.level >= level) {
      if (createFromProfileLevel(mMime,profile,pl.level) != null) {
        return createFromProfileLevel(mMime,profile,level) != null;
      }
      return true;
    }
  }
  return false;
}
Program: 191362
Project: 191362
Buggy source:
private void applyMacroBlockLimits(int maxHorizontalBlocks,int maxVerticalBlocks,int maxBlocks,long maxBlocksPerSecond,int blockWidth,int blockHeight,int widthAlignment,int heightAlignment){
  applyAlignment(widthAlignment,heightAlignment);
  applyBlockLimits(blockWidth,blockHeight,Range.create(1,maxBlocks),Range.create(1L,maxBlocksPerSecond),Range.create(new Rational(1,maxVerticalBlocks),new Rational(maxHorizontalBlocks,1)));
  mHorizontalBlockRange=mHorizontalBlockRange.intersect(1,maxHorizontalBlocks / (mBlockWidth / blockWidth));
  mVerticalBlockRange=mVerticalBlockRange.intersect(1,maxVerticalBlocks / (mBlockHeight / blockHeight));
}

Fixed version (ground truth):
private void applyMacroBlockLimits(int minHorizontalBlocks,int minVerticalBlocks,int maxHorizontalBlocks,int maxVerticalBlocks,int maxBlocks,long maxBlocksPerSecond,int blockWidth,int blockHeight,int widthAlignment,int heightAlignment){
  applyAlignment(widthAlignment,heightAlignment);
  applyBlockLimits(blockWidth,blockHeight,Range.create(1,maxBlocks),Range.create(1L,maxBlocksPerSecond),Range.create(new Rational(1,maxVerticalBlocks),new Rational(maxHorizontalBlocks,1)));
  mHorizontalBlockRange=mHorizontalBlockRange.intersect(Utils.divUp(minHorizontalBlocks,(mBlockWidth / blockWidth)),maxHorizontalBlocks / (mBlockWidth / blockWidth));
  mVerticalBlockRange=mVerticalBlockRange.intersect(Utils.divUp(minVerticalBlocks,(mBlockHeight / blockHeight)),maxVerticalBlocks / (mBlockHeight / blockHeight));
}
Program: 191363
Project: 191363
Buggy source:
private boolean supportsProfileLevel(int profile,Integer level){
  for (  CodecProfileLevel pl : profileLevels) {
    if (pl.profile != profile) {
      continue;
    }
    if (level == null || mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_AUDIO_AAC)) {
      return true;
    }
    if (mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_H263)) {
      if (pl.level != level && pl.level == CodecProfileLevel.H263Level45 && level > CodecProfileLevel.H263Level10) {
        continue;
      }
    }
    if (pl.level >= level) {
      if (createFromProfileLevel(mMime,profile,pl.level) != null) {
        return createFromProfileLevel(mMime,profile,level) != null;
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean supportsProfileLevel(int profile,Integer level){
  for (  CodecProfileLevel pl : profileLevels) {
    if (pl.profile != profile) {
      continue;
    }
    if (level == null || mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_AUDIO_AAC)) {
      return true;
    }
    if (mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_H263)) {
      if (pl.level != level && pl.level == CodecProfileLevel.H263Level45 && level > CodecProfileLevel.H263Level10) {
        continue;
      }
    }
    if (mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_MPEG4)) {
      if (pl.level != level && pl.level == CodecProfileLevel.MPEG4Level1 && level > CodecProfileLevel.MPEG4Level0) {
        continue;
      }
    }
    if (mMime.equalsIgnoreCase(MediaFormat.MIMETYPE_VIDEO_HEVC)) {
      boolean supportsHighTier=(pl.level & CodecProfileLevel.HEVCHighTierLevels) != 0;
      boolean checkingHighTier=(level & CodecProfileLevel.HEVCHighTierLevels) != 0;
      if (checkingHighTier && !supportsHighTier) {
        continue;
      }
    }
    if (pl.level >= level) {
      if (createFromProfileLevel(mMime,profile,pl.level) != null) {
        return createFromProfileLevel(mMime,profile,level) != null;
      }
      return true;
    }
  }
  return false;
}
Program: 191366
Project: 191366
Buggy source:
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput != null ? mExpandedRemoteInput.getPendingIntent() : null;
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput != null ? mHeadsUpRemoteInput.getPendingIntent() : null;
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}

Fixed version (ground truth):
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=null;
  if (mExpandedRemoteInput != null) {
    mExpandedRemoteInput.onNotificationUpdateOrReset();
    if (mExpandedRemoteInput.isActive()) {
      mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput.getPendingIntent();
    }
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=null;
  if (mHeadsUpRemoteInput != null) {
    mHeadsUpRemoteInput.onNotificationUpdateOrReset();
    if (mHeadsUpRemoteInput.isActive()) {
      mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput.getPendingIntent();
    }
  }
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}
Program: 191369
Project: 191369
Buggy source:
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput != null ? mExpandedRemoteInput.getPendingIntent() : null;
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput != null ? mHeadsUpRemoteInput.getPendingIntent() : null;
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}

Fixed version (ground truth):
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=null;
  if (mExpandedRemoteInput != null) {
    mExpandedRemoteInput.onNotificationUpdateOrReset();
    if (mExpandedRemoteInput.isActive()) {
      mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput.getPendingIntent();
    }
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=null;
  if (mHeadsUpRemoteInput != null) {
    mHeadsUpRemoteInput.onNotificationUpdateOrReset();
    if (mHeadsUpRemoteInput.isActive()) {
      mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput.getPendingIntent();
    }
  }
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}
Program: 191371
Project: 191371
Buggy source:
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput != null ? mExpandedRemoteInput.getPendingIntent() : null;
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput != null ? mHeadsUpRemoteInput.getPendingIntent() : null;
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}

Fixed version (ground truth):
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=null;
  if (mExpandedRemoteInput != null) {
    mExpandedRemoteInput.onNotificationUpdateOrReset();
    if (mExpandedRemoteInput.isActive()) {
      mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput.getPendingIntent();
    }
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=null;
  if (mHeadsUpRemoteInput != null) {
    mHeadsUpRemoteInput.onNotificationUpdateOrReset();
    if (mHeadsUpRemoteInput.isActive()) {
      mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput.getPendingIntent();
    }
  }
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}
Program: 191372
Project: 191372
Buggy source:
/** 
 * Add a new content: URI that will be monitored with a  {@link android.database.ContentObserver}, and will cause the job to execute if changed. If you have any trigger content URIs associated with a job, it will not execute until there has been a change report for one or more of them. <p>Note that trigger URIs can not be used in combination with  {@link #setPeriodic(long)} or {@link #setPersisted(boolean)}.  To continually monitor for content changes, you need to schedule a new JobInfo observing the same URIs before you finish execution of the JobService handling the most recent changes.</p> <p>Because because setting this property is not compatible with periodic or persisted jobs, doing so will throw an   {@link java.lang.IllegalArgumentException} when{@link android.app.job.JobInfo.Builder#build()} is called.</p>
 * @param uri The content: URI to monitor.
 */
public Builder addTriggerContentUri(@NonNull TriggerContentUri uri){
  if (mTriggerContentUris == null) {
    mTriggerContentUris=new ArrayList<>();
  }
  mTriggerContentUris.add(uri);
  return this;
}

Fixed version (ground truth):
/** 
 * Add a new content: URI that will be monitored with a  {@link android.database.ContentObserver}, and will cause the job to execute if changed. If you have any trigger content URIs associated with a job, it will not execute until there has been a change report for one or more of them. <p>Note that trigger URIs can not be used in combination with  {@link #setPeriodic(long)} or {@link #setPersisted(boolean)}.  To continually monitor for content changes, you need to schedule a new JobInfo observing the same URIs before you finish execution of the JobService handling the most recent changes.</p> <p>Because because setting this property is not compatible with periodic or persisted jobs, doing so will throw an   {@link java.lang.IllegalArgumentException} when{@link android.app.job.JobInfo.Builder#build()} is called.</p><p>The following example shows how this feature can be used to monitor for changes in the photos on a device.</p> {@sample development/samples/ApiDemos/src/com/example/android/apis/content/PhotosContentJob.javajob}
 * @param uri The content: URI to monitor.
 */
public Builder addTriggerContentUri(@NonNull TriggerContentUri uri){
  if (mTriggerContentUris == null) {
    mTriggerContentUris=new ArrayList<>();
  }
  mTriggerContentUris.add(uri);
  return this;
}
Program: 191373
Project: 191373
Buggy source:
/** 
 * Initializes the system service. <p> Subclasses must define a single argument constructor that accepts the context and passes it to super. </p>
 * @param context The system server context.
 */
public JobSchedulerService(Context context){
  super(context);
  mControllers=new ArrayList<StateController>();
  mControllers.add(ConnectivityController.get(this));
  mControllers.add(TimeController.get(this));
  mControllers.add(IdleController.get(this));
  mControllers.add(BatteryController.get(this));
  mControllers.add(AppIdleController.get(this));
  mControllers.add(ContentObserverController.get(this));
  mControllers.add(DeviceIdleJobsController.get(this));
  mHandler=new JobHandler(context.getMainLooper());
  mConstants=new Constants(mHandler);
  mJobSchedulerStub=new JobSchedulerStub();
  mJobs=JobStore.initAndGet(this);
}

Fixed version (ground truth):
/** 
 * Initializes the system service. <p> Subclasses must define a single argument constructor that accepts the context and passes it to super. </p>
 * @param context The system server context.
 */
public JobSchedulerService(Context context){
  super(context);
  mHandler=new JobHandler(context.getMainLooper());
  mConstants=new Constants(mHandler);
  mJobSchedulerStub=new JobSchedulerStub();
  mJobs=JobStore.initAndGet(this);
  mControllers=new ArrayList<StateController>();
  mControllers.add(ConnectivityController.get(this));
  mControllers.add(TimeController.get(this));
  mControllers.add(IdleController.get(this));
  mControllers.add(BatteryController.get(this));
  mControllers.add(AppIdleController.get(this));
  mControllers.add(ContentObserverController.get(this));
  mControllers.add(DeviceIdleJobsController.get(this));
}
Program: 191374
Project: 191374
Buggy source:
/** 
 * Add a new content: URI that will be monitored with a  {@link android.database.ContentObserver}, and will cause the job to execute if changed. If you have any trigger content URIs associated with a job, it will not execute until there has been a change report for one or more of them. <p>Note that trigger URIs can not be used in combination with  {@link #setPeriodic(long)} or {@link #setPersisted(boolean)}.  To continually monitor for content changes, you need to schedule a new JobInfo observing the same URIs before you finish execution of the JobService handling the most recent changes.</p> <p>Because because setting this property is not compatible with periodic or persisted jobs, doing so will throw an   {@link java.lang.IllegalArgumentException} when{@link android.app.job.JobInfo.Builder#build()} is called.</p>
 * @param uri The content: URI to monitor.
 */
public Builder addTriggerContentUri(@NonNull TriggerContentUri uri){
  if (mTriggerContentUris == null) {
    mTriggerContentUris=new ArrayList<>();
  }
  mTriggerContentUris.add(uri);
  return this;
}

Fixed version (ground truth):
/** 
 * Add a new content: URI that will be monitored with a  {@link android.database.ContentObserver}, and will cause the job to execute if changed. If you have any trigger content URIs associated with a job, it will not execute until there has been a change report for one or more of them. <p>Note that trigger URIs can not be used in combination with  {@link #setPeriodic(long)} or {@link #setPersisted(boolean)}.  To continually monitor for content changes, you need to schedule a new JobInfo observing the same URIs before you finish execution of the JobService handling the most recent changes.</p> <p>Because because setting this property is not compatible with periodic or persisted jobs, doing so will throw an   {@link java.lang.IllegalArgumentException} when{@link android.app.job.JobInfo.Builder#build()} is called.</p><p>The following example shows how this feature can be used to monitor for changes in the photos on a device.</p> {@sample development/samples/ApiDemos/src/com/example/android/apis/content/PhotosContentJob.javajob}
 * @param uri The content: URI to monitor.
 */
public Builder addTriggerContentUri(@NonNull TriggerContentUri uri){
  if (mTriggerContentUris == null) {
    mTriggerContentUris=new ArrayList<>();
  }
  mTriggerContentUris.add(uri);
  return this;
}
Program: 191375
Project: 191375
Buggy source:
/** 
 * Initializes the system service. <p> Subclasses must define a single argument constructor that accepts the context and passes it to super. </p>
 * @param context The system server context.
 */
public JobSchedulerService(Context context){
  super(context);
  mControllers=new ArrayList<StateController>();
  mControllers.add(ConnectivityController.get(this));
  mControllers.add(TimeController.get(this));
  mControllers.add(IdleController.get(this));
  mControllers.add(BatteryController.get(this));
  mControllers.add(AppIdleController.get(this));
  mControllers.add(ContentObserverController.get(this));
  mControllers.add(DeviceIdleJobsController.get(this));
  mHandler=new JobHandler(context.getMainLooper());
  mConstants=new Constants(mHandler);
  mJobSchedulerStub=new JobSchedulerStub();
  mJobs=JobStore.initAndGet(this);
}

Fixed version (ground truth):
/** 
 * Initializes the system service. <p> Subclasses must define a single argument constructor that accepts the context and passes it to super. </p>
 * @param context The system server context.
 */
public JobSchedulerService(Context context){
  super(context);
  mHandler=new JobHandler(context.getMainLooper());
  mConstants=new Constants(mHandler);
  mJobSchedulerStub=new JobSchedulerStub();
  mJobs=JobStore.initAndGet(this);
  mControllers=new ArrayList<StateController>();
  mControllers.add(ConnectivityController.get(this));
  mControllers.add(TimeController.get(this));
  mControllers.add(IdleController.get(this));
  mControllers.add(BatteryController.get(this));
  mControllers.add(AppIdleController.get(this));
  mControllers.add(ContentObserverController.get(this));
  mControllers.add(DeviceIdleJobsController.get(this));
}
Program: 191377
Project: 191377
Buggy source:
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput != null ? mExpandedRemoteInput.getPendingIntent() : null;
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput != null ? mHeadsUpRemoteInput.getPendingIntent() : null;
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}

Fixed version (ground truth):
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=null;
  if (mExpandedRemoteInput != null) {
    mExpandedRemoteInput.onNotificationUpdateOrReset();
    if (mExpandedRemoteInput.isActive()) {
      mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput.getPendingIntent();
    }
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=null;
  if (mHeadsUpRemoteInput != null) {
    mHeadsUpRemoteInput.onNotificationUpdateOrReset();
    if (mHeadsUpRemoteInput.isActive()) {
      mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput.getPendingIntent();
    }
  }
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}
Program: 191379
Project: 191379
Buggy source:
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput != null ? mExpandedRemoteInput.getPendingIntent() : null;
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput != null ? mHeadsUpRemoteInput.getPendingIntent() : null;
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}

Fixed version (ground truth):
public void reset(){
  if (mContractedChild != null) {
    mContractedChild.animate().cancel();
    removeView(mContractedChild);
  }
  mPreviousExpandedRemoteInputIntent=null;
  if (mExpandedRemoteInput != null) {
    mExpandedRemoteInput.onNotificationUpdateOrReset();
    if (mExpandedRemoteInput.isActive()) {
      mPreviousExpandedRemoteInputIntent=mExpandedRemoteInput.getPendingIntent();
    }
  }
  if (mExpandedChild != null) {
    mExpandedChild.animate().cancel();
    removeView(mExpandedChild);
    mExpandedRemoteInput=null;
  }
  mPreviousHeadsUpRemoteInputIntent=null;
  if (mHeadsUpRemoteInput != null) {
    mHeadsUpRemoteInput.onNotificationUpdateOrReset();
    if (mHeadsUpRemoteInput.isActive()) {
      mPreviousHeadsUpRemoteInputIntent=mHeadsUpRemoteInput.getPendingIntent();
    }
  }
  if (mHeadsUpChild != null) {
    mHeadsUpChild.animate().cancel();
    removeView(mHeadsUpChild);
    mHeadsUpRemoteInput=null;
  }
  mContractedChild=null;
  mExpandedChild=null;
  mHeadsUpChild=null;
}
Program: 191380
Project: 191380
Buggy source:
/** 
 * Add a new content: URI that will be monitored with a  {@link android.database.ContentObserver}, and will cause the job to execute if changed. If you have any trigger content URIs associated with a job, it will not execute until there has been a change report for one or more of them. <p>Note that trigger URIs can not be used in combination with  {@link #setPeriodic(long)} or {@link #setPersisted(boolean)}.  To continually monitor for content changes, you need to schedule a new JobInfo observing the same URIs before you finish execution of the JobService handling the most recent changes.</p> <p>Because because setting this property is not compatible with periodic or persisted jobs, doing so will throw an   {@link java.lang.IllegalArgumentException} when{@link android.app.job.JobInfo.Builder#build()} is called.</p>
 * @param uri The content: URI to monitor.
 */
public Builder addTriggerContentUri(@NonNull TriggerContentUri uri){
  if (mTriggerContentUris == null) {
    mTriggerContentUris=new ArrayList<>();
  }
  mTriggerContentUris.add(uri);
  return this;
}

Fixed version (ground truth):
/** 
 * Add a new content: URI that will be monitored with a  {@link android.database.ContentObserver}, and will cause the job to execute if changed. If you have any trigger content URIs associated with a job, it will not execute until there has been a change report for one or more of them. <p>Note that trigger URIs can not be used in combination with  {@link #setPeriodic(long)} or {@link #setPersisted(boolean)}.  To continually monitor for content changes, you need to schedule a new JobInfo observing the same URIs before you finish execution of the JobService handling the most recent changes.</p> <p>Because because setting this property is not compatible with periodic or persisted jobs, doing so will throw an   {@link java.lang.IllegalArgumentException} when{@link android.app.job.JobInfo.Builder#build()} is called.</p><p>The following example shows how this feature can be used to monitor for changes in the photos on a device.</p> {@sample development/samples/ApiDemos/src/com/example/android/apis/content/PhotosContentJob.javajob}
 * @param uri The content: URI to monitor.
 */
public Builder addTriggerContentUri(@NonNull TriggerContentUri uri){
  if (mTriggerContentUris == null) {
    mTriggerContentUris=new ArrayList<>();
  }
  mTriggerContentUris.add(uri);
  return this;
}
Program: 191381
Project: 191381
Buggy source:
/** 
 * Initializes the system service. <p> Subclasses must define a single argument constructor that accepts the context and passes it to super. </p>
 * @param context The system server context.
 */
public JobSchedulerService(Context context){
  super(context);
  mControllers=new ArrayList<StateController>();
  mControllers.add(ConnectivityController.get(this));
  mControllers.add(TimeController.get(this));
  mControllers.add(IdleController.get(this));
  mControllers.add(BatteryController.get(this));
  mControllers.add(AppIdleController.get(this));
  mControllers.add(ContentObserverController.get(this));
  mControllers.add(DeviceIdleJobsController.get(this));
  mHandler=new JobHandler(context.getMainLooper());
  mConstants=new Constants(mHandler);
  mJobSchedulerStub=new JobSchedulerStub();
  mJobs=JobStore.initAndGet(this);
}

Fixed version (ground truth):
/** 
 * Initializes the system service. <p> Subclasses must define a single argument constructor that accepts the context and passes it to super. </p>
 * @param context The system server context.
 */
public JobSchedulerService(Context context){
  super(context);
  mHandler=new JobHandler(context.getMainLooper());
  mConstants=new Constants(mHandler);
  mJobSchedulerStub=new JobSchedulerStub();
  mJobs=JobStore.initAndGet(this);
  mControllers=new ArrayList<StateController>();
  mControllers.add(ConnectivityController.get(this));
  mControllers.add(TimeController.get(this));
  mControllers.add(IdleController.get(this));
  mControllers.add(BatteryController.get(this));
  mControllers.add(AppIdleController.get(this));
  mControllers.add(ContentObserverController.get(this));
  mControllers.add(DeviceIdleJobsController.get(this));
}
Program: 191382
Project: 191382
Buggy source:
@Override public void setOnClickListener(@Nullable OnClickListener l){
  mExpandClickListener=l;
  setOnTouchListener(mExpandClickListener != null ? mTouchListener : null);
  updateTouchListener();
}

Fixed version (ground truth):
@Override public void setOnClickListener(@Nullable OnClickListener l){
  mExpandClickListener=l;
  setOnTouchListener(mExpandClickListener != null ? mTouchListener : null);
  setFocusable(l != null);
  updateTouchListener();
}
Program: 191383
Project: 191383
Buggy source:
@Override public void setOnClickListener(@Nullable OnClickListener l){
  mExpandClickListener=l;
  setOnTouchListener(mExpandClickListener != null ? mTouchListener : null);
  updateTouchListener();
}

Fixed version (ground truth):
@Override public void setOnClickListener(@Nullable OnClickListener l){
  mExpandClickListener=l;
  setOnTouchListener(mExpandClickListener != null ? mTouchListener : null);
  setFocusable(l != null);
  updateTouchListener();
}
Program: 191384
Project: 191384
Buggy source:
void disconnect(Context context){
  try {
    if (mBound) {
      mBound=false;
      context.unbindService(this);
    }
  }
 catch (  RuntimeException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
void disconnect(Context context){
  try {
    if (mBound) {
      mBound=false;
      context.unbindService(this);
      if (DBG)       Log.d(TAG,"String_Node_Str");
    }
  }
 catch (  RuntimeException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 191385
Project: 191385
Buggy source:
@Override public void onServiceDisconnected(ComponentName name){
  if (DBG)   Log.d(TAG,"String_Node_Str" + name.flattenToString());
}

Fixed version (ground truth):
@Override public void onServiceDisconnected(ComponentName name){
  if (DBG) {
    Log.d(TAG,"String_Node_Str" + name.flattenToString());
  }
  mConnected=false;
}
Program: 191386
Project: 191386
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DBG)   Log.d(TAG,"String_Node_Str" + name.flattenToString());
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DBG)   Log.d(TAG,"String_Node_Str" + name.flattenToString());
  mConnected=true;
}
Program: 191387
Project: 191387
Buggy source:
/** 
 * Called when the system is ready to run third-party code but before it actually does so. 
 */
void systemReady(){
  if (DBG)   Log.d(TAG,"String_Node_Str");
  ContentResolver cr=mContext.getContentResolver();
  if (Settings.Global.getInt(cr,Settings.Global.NETWORK_SCORING_PROVISIONED,0) == 0) {
    String defaultPackage=mContext.getResources().getString(R.string.config_defaultNetworkScorerPackageName);
    if (!TextUtils.isEmpty(defaultPackage)) {
      NetworkScorerAppManager.setActiveScorer(mContext,defaultPackage);
    }
    Settings.Global.putInt(cr,Settings.Global.NETWORK_SCORING_PROVISIONED,1);
  }
  registerPackageReceiverIfNeeded();
}

Fixed version (ground truth):
/** 
 * Called when the system is ready to run third-party code but before it actually does so. 
 */
void systemReady(){
  if (DBG)   Log.d(TAG,"String_Node_Str");
  ContentResolver cr=mContext.getContentResolver();
  if (Settings.Global.getInt(cr,Settings.Global.NETWORK_SCORING_PROVISIONED,0) == 0) {
    String defaultPackage=mContext.getResources().getString(R.string.config_defaultNetworkScorerPackageName);
    if (!TextUtils.isEmpty(defaultPackage)) {
      NetworkScorerAppManager.setActiveScorer(mContext,defaultPackage);
    }
    Settings.Global.putInt(cr,Settings.Global.NETWORK_SCORING_PROVISIONED,1);
  }
  registerPackageMonitorIfNeeded();
}
Program: 191388
Project: 191388
Buggy source:
/** 
 * Set the active scorer. Callers are responsible for checking permissions as appropriate. 
 */
private boolean setScorerInternal(String packageName){
  if (DBG)   Log.d(TAG,"String_Node_Str" + packageName + "String_Node_Str");
  long token=Binder.clearCallingIdentity();
  try {
    unbindFromScoringServiceIfNeeded();
    clearInternal();
    NetworkScorerAppData prevScorer=NetworkScorerAppManager.getActiveScorer(mContext);
    boolean result=NetworkScorerAppManager.setActiveScorer(mContext,packageName);
    bindToScoringServiceIfNeeded();
    if (result) {
      registerPackageReceiverIfNeeded();
      Intent intent=new Intent(NetworkScoreManager.ACTION_SCORER_CHANGED);
      if (prevScorer != null) {
        intent.setPackage(prevScorer.mPackageName);
        mContext.sendBroadcastAsUser(intent,UserHandle.SYSTEM);
      }
      if (packageName != null) {
        intent.putExtra(NetworkScoreManager.EXTRA_NEW_SCORER,packageName);
        intent.setPackage(packageName);
        mContext.sendBroadcastAsUser(intent,UserHandle.SYSTEM);
      }
    }
    return result;
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}

Fixed version (ground truth):
/** 
 * Set the active scorer. Callers are responsible for checking permissions as appropriate. 
 */
private boolean setScorerInternal(String packageName){
  if (DBG)   Log.d(TAG,"String_Node_Str" + packageName + "String_Node_Str");
  long token=Binder.clearCallingIdentity();
  try {
    unbindFromScoringServiceIfNeeded();
    clearInternal();
    NetworkScorerAppData prevScorer=NetworkScorerAppManager.getActiveScorer(mContext);
    boolean result=NetworkScorerAppManager.setActiveScorer(mContext,packageName);
    bindToScoringServiceIfNeeded();
    if (result) {
      registerPackageMonitorIfNeeded();
      Intent intent=new Intent(NetworkScoreManager.ACTION_SCORER_CHANGED);
      if (prevScorer != null) {
        intent.setPackage(prevScorer.mPackageName);
        mContext.sendBroadcastAsUser(intent,UserHandle.SYSTEM);
      }
      if (packageName != null) {
        intent.putExtra(NetworkScoreManager.EXTRA_NEW_SCORER,packageName);
        intent.setPackage(packageName);
        mContext.sendBroadcastAsUser(intent,UserHandle.SYSTEM);
      }
    }
    return result;
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}
Program: 191389
Project: 191389
Buggy source:
public void dump(FileDescriptor fd,PrintWriter writer,String[] args){
  writer.println("String_Node_Str" + mComponentName + "String_Node_Str"+ mBound);
}

Fixed version (ground truth):
public void dump(FileDescriptor fd,PrintWriter writer,String[] args){
  writer.println("String_Node_Str" + mComponentName + "String_Node_Str"+ mBound+ "String_Node_Str"+ mConnected);
}
Program: 191390
Project: 191390
Buggy source:
void connect(Context context){
  disconnect(context);
  Intent service=new Intent();
  service.setComponent(mComponentName);
  mBound=context.bindServiceAsUser(service,this,Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE,UserHandle.SYSTEM);
  if (!mBound) {
    Log.w(TAG,"String_Node_Str" + service);
  }
}

Fixed version (ground truth):
void connect(Context context){
  if (!mBound) {
    Intent service=new Intent();
    service.setComponent(mComponentName);
    mBound=context.bindServiceAsUser(service,this,Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE,UserHandle.SYSTEM);
    if (!mBound) {
      Log.w(TAG,"String_Node_Str" + service);
    }
 else {
      if (DBG)       Log.d(TAG,"String_Node_Str");
    }
  }
}
Program: 191391
Project: 191391
Buggy source:
@Override public void setOnClickListener(@Nullable OnClickListener l){
  mExpandClickListener=l;
  setOnTouchListener(mExpandClickListener != null ? mTouchListener : null);
  updateTouchListener();
}

Fixed version (ground truth):
@Override public void setOnClickListener(@Nullable OnClickListener l){
  mExpandClickListener=l;
  setOnTouchListener(mExpandClickListener != null ? mTouchListener : null);
  setFocusable(l != null);
  updateTouchListener();
}
Program: 191392
Project: 191392
Buggy source:
void disconnect(Context context){
  try {
    if (mBound) {
      mBound=false;
      context.unbindService(this);
    }
  }
 catch (  RuntimeException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
void disconnect(Context context){
  try {
    if (mBound) {
      mBound=false;
      context.unbindService(this);
      if (DBG)       Log.d(TAG,"String_Node_Str");
    }
  }
 catch (  RuntimeException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 191393
Project: 191393
Buggy source:
@Override public void onServiceDisconnected(ComponentName name){
  if (DBG)   Log.d(TAG,"String_Node_Str" + name.flattenToString());
}

Fixed version (ground truth):
@Override public void onServiceDisconnected(ComponentName name){
  if (DBG) {
    Log.d(TAG,"String_Node_Str" + name.flattenToString());
  }
  mConnected=false;
}
Program: 191394
Project: 191394
Buggy source:
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DBG)   Log.d(TAG,"String_Node_Str" + name.flattenToString());
}

Fixed version (ground truth):
@Override public void onServiceConnected(ComponentName name,IBinder service){
  if (DBG)   Log.d(TAG,"String_Node_Str" + name.flattenToString());
  mConnected=true;
}
Program: 191395
Project: 191395
Buggy source:
/** 
 * Called when the system is ready to run third-party code but before it actually does so. 
 */
void systemReady(){
  if (DBG)   Log.d(TAG,"String_Node_Str");
  ContentResolver cr=mContext.getContentResolver();
  if (Settings.Global.getInt(cr,Settings.Global.NETWORK_SCORING_PROVISIONED,0) == 0) {
    String defaultPackage=mContext.getResources().getString(R.string.config_defaultNetworkScorerPackageName);
    if (!TextUtils.isEmpty(defaultPackage)) {
      NetworkScorerAppManager.setActiveScorer(mContext,defaultPackage);
    }
    Settings.Global.putInt(cr,Settings.Global.NETWORK_SCORING_PROVISIONED,1);
  }
  registerPackageReceiverIfNeeded();
}

Fixed version (ground truth):
/** 
 * Called when the system is ready to run third-party code but before it actually does so. 
 */
void systemReady(){
  if (DBG)   Log.d(TAG,"String_Node_Str");
  ContentResolver cr=mContext.getContentResolver();
  if (Settings.Global.getInt(cr,Settings.Global.NETWORK_SCORING_PROVISIONED,0) == 0) {
    String defaultPackage=mContext.getResources().getString(R.string.config_defaultNetworkScorerPackageName);
    if (!TextUtils.isEmpty(defaultPackage)) {
      NetworkScorerAppManager.setActiveScorer(mContext,defaultPackage);
    }
    Settings.Global.putInt(cr,Settings.Global.NETWORK_SCORING_PROVISIONED,1);
  }
  registerPackageMonitorIfNeeded();
}
Program: 191396
Project: 191396
Buggy source:
/** 
 * Set the active scorer. Callers are responsible for checking permissions as appropriate. 
 */
private boolean setScorerInternal(String packageName){
  if (DBG)   Log.d(TAG,"String_Node_Str" + packageName + "String_Node_Str");
  long token=Binder.clearCallingIdentity();
  try {
    unbindFromScoringServiceIfNeeded();
    clearInternal();
    NetworkScorerAppData prevScorer=NetworkScorerAppManager.getActiveScorer(mContext);
    boolean result=NetworkScorerAppManager.setActiveScorer(mContext,packageName);
    bindToScoringServiceIfNeeded();
    if (result) {
      registerPackageReceiverIfNeeded();
      Intent intent=new Intent(NetworkScoreManager.ACTION_SCORER_CHANGED);
      if (prevScorer != null) {
        intent.setPackage(prevScorer.mPackageName);
        mContext.sendBroadcastAsUser(intent,UserHandle.SYSTEM);
      }
      if (packageName != null) {
        intent.putExtra(NetworkScoreManager.EXTRA_NEW_SCORER,packageName);
        intent.setPackage(packageName);
        mContext.sendBroadcastAsUser(intent,UserHandle.SYSTEM);
      }
    }
    return result;
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}

Fixed version (ground truth):
/** 
 * Set the active scorer. Callers are responsible for checking permissions as appropriate. 
 */
private boolean setScorerInternal(String packageName){
  if (DBG)   Log.d(TAG,"String_Node_Str" + packageName + "String_Node_Str");
  long token=Binder.clearCallingIdentity();
  try {
    unbindFromScoringServiceIfNeeded();
    clearInternal();
    NetworkScorerAppData prevScorer=NetworkScorerAppManager.getActiveScorer(mContext);
    boolean result=NetworkScorerAppManager.setActiveScorer(mContext,packageName);
    bindToScoringServiceIfNeeded();
    if (result) {
      registerPackageMonitorIfNeeded();
      Intent intent=new Intent(NetworkScoreManager.ACTION_SCORER_CHANGED);
      if (prevScorer != null) {
        intent.setPackage(prevScorer.mPackageName);
        mContext.sendBroadcastAsUser(intent,UserHandle.SYSTEM);
      }
      if (packageName != null) {
        intent.putExtra(NetworkScoreManager.EXTRA_NEW_SCORER,packageName);
        intent.setPackage(packageName);
        mContext.sendBroadcastAsUser(intent,UserHandle.SYSTEM);
      }
    }
    return result;
  }
  finally {
    Binder.restoreCallingIdentity(token);
  }
}
Program: 191397
Project: 191397
Buggy source:
public void dump(FileDescriptor fd,PrintWriter writer,String[] args){
  writer.println("String_Node_Str" + mComponentName + "String_Node_Str"+ mBound);
}

Fixed version (ground truth):
public void dump(FileDescriptor fd,PrintWriter writer,String[] args){
  writer.println("String_Node_Str" + mComponentName + "String_Node_Str"+ mBound+ "String_Node_Str"+ mConnected);
}