nus-yam/ex-repair huggingface dataset:
Program: 191179
Project: 191179
Buggy source:
private void generateHeadsUpAnimationEvents(){
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    int type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER;
    boolean onBottom=false;
    boolean pinnedAndClosed=row.isPinned() && !mIsExpanded;
    if (!mIsExpanded && !isHeadsUp) {
      type=row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR;
    }
 else {
      StackViewState viewState=mCurrentStackScrollState.getViewStateForView(row);
      if (viewState == null) {
        continue;
      }
      if (isHeadsUp && (mAddedHeadsUpChildren.contains(row) || pinnedAndClosed)) {
        if (pinnedAndClosed || shouldHunAppearFromBottom(viewState)) {
          type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_APPEAR;
        }
 else {
          type=AnimationEvent.ANIMATION_TYPE_ADD;
        }
        onBottom=!pinnedAndClosed;
      }
    }
    AnimationEvent event=new AnimationEvent(row,type);
    event.headsUpFromBottom=onBottom;
    mAnimationEvents.add(event);
  }
  mHeadsUpChangeAnimations.clear();
  mAddedHeadsUpChildren.clear();
}

Fixed version (ground truth):
private void generateHeadsUpAnimationEvents(){
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    int type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER;
    boolean onBottom=false;
    boolean pinnedAndClosed=row.isPinned() && !mIsExpanded;
    if (!mIsExpanded && !isHeadsUp) {
      type=row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR;
      if (row.isChildInGroup()) {
        row.setHeadsupDisappearRunning(false);
      }
    }
 else {
      StackViewState viewState=mCurrentStackScrollState.getViewStateForView(row);
      if (viewState == null) {
        continue;
      }
      if (isHeadsUp && (mAddedHeadsUpChildren.contains(row) || pinnedAndClosed)) {
        if (pinnedAndClosed || shouldHunAppearFromBottom(viewState)) {
          type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_APPEAR;
        }
 else {
          type=AnimationEvent.ANIMATION_TYPE_ADD;
        }
        onBottom=!pinnedAndClosed;
      }
    }
    AnimationEvent event=new AnimationEvent(row,type);
    event.headsUpFromBottom=onBottom;
    mAnimationEvents.add(event);
  }
  mHeadsUpChangeAnimations.clear();
  mAddedHeadsUpChildren.clear();
}
Program: 191180
Project: 191180
Buggy source:
private void clearHeadsUpDisappearRunning(){
  for (int i=0; i < getChildCount(); i++) {
    View view=getChildAt(i);
    if (view instanceof ExpandableNotificationRow) {
      ((ExpandableNotificationRow)view).setHeadsupDisappearRunning(false);
    }
  }
}

Fixed version (ground truth):
private void clearHeadsUpDisappearRunning(){
  for (int i=0; i < getChildCount(); i++) {
    View view=getChildAt(i);
    if (view instanceof ExpandableNotificationRow) {
      ExpandableNotificationRow row=(ExpandableNotificationRow)view;
      row.setHeadsupDisappearRunning(false);
      if (row.isSummaryWithChildren()) {
        for (        ExpandableNotificationRow child : row.getNotificationChildren()) {
          child.setHeadsupDisappearRunning(false);
        }
      }
    }
  }
}
Program: 191181
Project: 191181
Buggy source:
@Override protected int getMaxPanelHeight(){
  int min=mStatusBarMinHeight;
  if (mStatusBar.getBarState() != StatusBarState.KEYGUARD && mNotificationStackScroller.getNotGoneChildCount() == 0) {
    int minHeight=(int)((mQsMinExpansionHeight + getOverExpansionAmount()) * HEADER_RUBBERBAND_FACTOR);
    min=Math.max(min,minHeight);
  }
  int maxHeight;
  if (mQsExpandImmediate || mQsExpanded || mIsExpanding && mQsExpandedWhenExpandingStarted) {
    maxHeight=calculatePanelHeightQsExpanded();
  }
 else {
    maxHeight=calculatePanelHeightShade();
  }
  maxHeight=Math.max(maxHeight,min);
  return maxHeight;
}

Fixed version (ground truth):
@Override protected int getMaxPanelHeight(){
  int min=mStatusBarMinHeight;
  if (mStatusBar.getBarState() != StatusBarState.KEYGUARD && mNotificationStackScroller.getNotGoneChildCount() == 0) {
    int minHeight=(int)(mQsMinExpansionHeight + getOverExpansionAmount());
    min=Math.max(min,minHeight);
  }
  int maxHeight;
  if (mQsExpandImmediate || mQsExpanded || mIsExpanding && mQsExpandedWhenExpandingStarted) {
    maxHeight=calculatePanelHeightQsExpanded();
  }
 else {
    maxHeight=calculatePanelHeightShade();
  }
  maxHeight=Math.max(maxHeight,min);
  return maxHeight;
}
Program: 191182
Project: 191182
Buggy source:
protected float getHeaderTranslation(){
  if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    return 0;
  }
  if (mNotificationStackScroller.getNotGoneChildCount() == 0) {
    return Math.min(0,mExpandedHeight / HEADER_RUBBERBAND_FACTOR - mQsMinExpansionHeight);
  }
  float stackTranslation=mNotificationStackScroller.getStackTranslation();
  float translation=stackTranslation / HEADER_RUBBERBAND_FACTOR;
  if (mHeadsUpManager.hasPinnedHeadsUp() || mIsExpansionFromHeadsUp) {
    translation=mNotificationStackScroller.getTopPadding() + stackTranslation - mQsMinExpansionHeight;
  }
  return Math.min(0,translation);
}

Fixed version (ground truth):
protected float getHeaderTranslation(){
  if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    return 0;
  }
  float translation=NotificationUtils.interpolate(-mQsMinExpansionHeight,0,mNotificationStackScroller.getAppearFraction(mExpandedHeight));
  return Math.min(0,translation);
}
Program: 191183
Project: 191183
Buggy source:
@Override protected float getPeekHeight(){
  if (mNotificationStackScroller.getNotGoneChildCount() > 0) {
    return mNotificationStackScroller.getPeekHeight();
  }
 else {
    return mQsMinExpansionHeight * HEADER_RUBBERBAND_FACTOR;
  }
}

Fixed version (ground truth):
@Override protected float getPeekHeight(){
  if (mNotificationStackScroller.getNotGoneChildCount() > 0) {
    return mNotificationStackScroller.getPeekHeight();
  }
 else {
    return mQsMinExpansionHeight;
  }
}
Program: 191184
Project: 191184
Buggy source:
public int getLayoutMinHeight(){
  final ExpandableView firstChild=getFirstChildNotGone();
  int firstChildMinHeight=firstChild != null ? firstChild.getIntrinsicHeight() : mEmptyShadeView != null ? mEmptyShadeView.getMinHeight() : mCollapsedSize;
  if (mOwnScrollY > 0) {
    firstChildMinHeight=Math.max(firstChildMinHeight - mOwnScrollY,mCollapsedSize);
  }
  return Math.min(firstChildMinHeight + mBottomStackPeekSize + mBottomStackSlowDownHeight,mMaxLayoutHeight - mTopPadding);
}

Fixed version (ground truth):
public int getLayoutMinHeight(){
  int firstChildMinHeight=getFirstChildMinHeight();
  return Math.min(firstChildMinHeight + mBottomStackPeekSize + mBottomStackSlowDownHeight,mMaxLayoutHeight - mTopPadding);
}
Program: 191185
Project: 191185
Buggy source:
/** 
 * Update the height of the stack to a new height.
 * @param height the new height of the stack
 */
public void setStackHeight(float height){
  mLastSetStackHeight=height;
  setIsExpanded(height > 0.0f);
  int newStackHeight=(int)height;
  int minStackHeight=getLayoutMinHeight();
  int stackHeight;
  float paddingOffset;
  boolean trackingHeadsUp=mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp();
  int normalUnfoldPositionStart=trackingHeadsUp ? mHeadsUpManager.getTopHeadsUpPinnedHeight() : minStackHeight;
  if (newStackHeight - mTopPadding - mTopPaddingOverflow >= normalUnfoldPositionStart || getNotGoneChildCount() == 0) {
    paddingOffset=mTopPaddingOverflow;
    stackHeight=newStackHeight;
  }
 else {
    int translationY;
    translationY=newStackHeight - normalUnfoldPositionStart;
    paddingOffset=translationY - mTopPadding;
    stackHeight=(int)(height - (translationY - mTopPadding));
  }
  if (stackHeight != mCurrentStackHeight) {
    mCurrentStackHeight=stackHeight;
    updateAlgorithmHeightAndPadding();
    requestChildrenUpdate();
  }
  setStackTranslation(paddingOffset);
}

Fixed version (ground truth):
/** 
 * Update the height of the stack to a new height.
 * @param height the new height of the stack
 */
public void setStackHeight(float height){
  mLastSetStackHeight=height;
  setIsExpanded(height > 0.0f);
  int stackHeight;
  float translationY;
  float appearEndPosition=getAppearEndPosition();
  float appearStartPosition=getAppearStartPosition();
  if (height >= appearEndPosition) {
    translationY=mTopPaddingOverflow;
    stackHeight=(int)height;
  }
 else {
    float appearFraction=getAppearFraction(height);
    if (appearFraction >= 0) {
      translationY=NotificationUtils.interpolate(getExpandTranslationStart(),0,appearFraction);
    }
 else {
      translationY=height - appearStartPosition + getExpandTranslationStart();
    }
    stackHeight=(int)(height - translationY);
  }
  if (stackHeight != mCurrentStackHeight) {
    mCurrentStackHeight=stackHeight;
    updateAlgorithmHeightAndPadding();
    requestChildrenUpdate();
  }
  setStackTranslation(translationY);
}
Program: 191186
Project: 191186
Buggy source:
private void generateHeadsUpAnimationEvents(){
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    int type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER;
    boolean onBottom=false;
    boolean pinnedAndClosed=row.isPinned() && !mIsExpanded;
    if (!mIsExpanded && !isHeadsUp) {
      type=row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR;
    }
 else {
      StackViewState viewState=mCurrentStackScrollState.getViewStateForView(row);
      if (viewState == null) {
        continue;
      }
      if (isHeadsUp && (mAddedHeadsUpChildren.contains(row) || pinnedAndClosed)) {
        if (pinnedAndClosed || shouldHunAppearFromBottom(viewState)) {
          type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_APPEAR;
        }
 else {
          type=AnimationEvent.ANIMATION_TYPE_ADD;
        }
        onBottom=!pinnedAndClosed;
      }
    }
    AnimationEvent event=new AnimationEvent(row,type);
    event.headsUpFromBottom=onBottom;
    mAnimationEvents.add(event);
  }
  mHeadsUpChangeAnimations.clear();
  mAddedHeadsUpChildren.clear();
}

Fixed version (ground truth):
private void generateHeadsUpAnimationEvents(){
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    int type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_OTHER;
    boolean onBottom=false;
    boolean pinnedAndClosed=row.isPinned() && !mIsExpanded;
    if (!mIsExpanded && !isHeadsUp) {
      type=row.wasJustClicked() ? AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR_CLICK : AnimationEvent.ANIMATION_TYPE_HEADS_UP_DISAPPEAR;
      if (row.isChildInGroup()) {
        row.setHeadsupDisappearRunning(false);
      }
    }
 else {
      StackViewState viewState=mCurrentStackScrollState.getViewStateForView(row);
      if (viewState == null) {
        continue;
      }
      if (isHeadsUp && (mAddedHeadsUpChildren.contains(row) || pinnedAndClosed)) {
        if (pinnedAndClosed || shouldHunAppearFromBottom(viewState)) {
          type=AnimationEvent.ANIMATION_TYPE_HEADS_UP_APPEAR;
        }
 else {
          type=AnimationEvent.ANIMATION_TYPE_ADD;
        }
        onBottom=!pinnedAndClosed;
      }
    }
    AnimationEvent event=new AnimationEvent(row,type);
    event.headsUpFromBottom=onBottom;
    mAnimationEvents.add(event);
  }
  mHeadsUpChangeAnimations.clear();
  mAddedHeadsUpChildren.clear();
}
Program: 191187
Project: 191187
Buggy source:
private void clearHeadsUpDisappearRunning(){
  for (int i=0; i < getChildCount(); i++) {
    View view=getChildAt(i);
    if (view instanceof ExpandableNotificationRow) {
      ((ExpandableNotificationRow)view).setHeadsupDisappearRunning(false);
    }
  }
}

Fixed version (ground truth):
private void clearHeadsUpDisappearRunning(){
  for (int i=0; i < getChildCount(); i++) {
    View view=getChildAt(i);
    if (view instanceof ExpandableNotificationRow) {
      ExpandableNotificationRow row=(ExpandableNotificationRow)view;
      row.setHeadsupDisappearRunning(false);
      if (row.isSummaryWithChildren()) {
        for (        ExpandableNotificationRow child : row.getNotificationChildren()) {
          child.setHeadsupDisappearRunning(false);
        }
      }
    }
  }
}
Program: 191188
Project: 191188
Buggy source:
@Override protected int getMaxPanelHeight(){
  int min=mStatusBarMinHeight;
  if (mStatusBar.getBarState() != StatusBarState.KEYGUARD && mNotificationStackScroller.getNotGoneChildCount() == 0) {
    int minHeight=(int)((mQsMinExpansionHeight + getOverExpansionAmount()) * HEADER_RUBBERBAND_FACTOR);
    min=Math.max(min,minHeight);
  }
  int maxHeight;
  if (mQsExpandImmediate || mQsExpanded || mIsExpanding && mQsExpandedWhenExpandingStarted) {
    maxHeight=calculatePanelHeightQsExpanded();
  }
 else {
    maxHeight=calculatePanelHeightShade();
  }
  maxHeight=Math.max(maxHeight,min);
  return maxHeight;
}

Fixed version (ground truth):
@Override protected int getMaxPanelHeight(){
  int min=mStatusBarMinHeight;
  if (mStatusBar.getBarState() != StatusBarState.KEYGUARD && mNotificationStackScroller.getNotGoneChildCount() == 0) {
    int minHeight=(int)(mQsMinExpansionHeight + getOverExpansionAmount());
    min=Math.max(min,minHeight);
  }
  int maxHeight;
  if (mQsExpandImmediate || mQsExpanded || mIsExpanding && mQsExpandedWhenExpandingStarted) {
    maxHeight=calculatePanelHeightQsExpanded();
  }
 else {
    maxHeight=calculatePanelHeightShade();
  }
  maxHeight=Math.max(maxHeight,min);
  return maxHeight;
}
Program: 191189
Project: 191189
Buggy source:
protected float getHeaderTranslation(){
  if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    return 0;
  }
  if (mNotificationStackScroller.getNotGoneChildCount() == 0) {
    return Math.min(0,mExpandedHeight / HEADER_RUBBERBAND_FACTOR - mQsMinExpansionHeight);
  }
  float stackTranslation=mNotificationStackScroller.getStackTranslation();
  float translation=stackTranslation / HEADER_RUBBERBAND_FACTOR;
  if (mHeadsUpManager.hasPinnedHeadsUp() || mIsExpansionFromHeadsUp) {
    translation=mNotificationStackScroller.getTopPadding() + stackTranslation - mQsMinExpansionHeight;
  }
  return Math.min(0,translation);
}

Fixed version (ground truth):
protected float getHeaderTranslation(){
  if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
    return 0;
  }
  float translation=NotificationUtils.interpolate(-mQsMinExpansionHeight,0,mNotificationStackScroller.getAppearFraction(mExpandedHeight));
  return Math.min(0,translation);
}
Program: 191190
Project: 191190
Buggy source:
@Override protected float getPeekHeight(){
  if (mNotificationStackScroller.getNotGoneChildCount() > 0) {
    return mNotificationStackScroller.getPeekHeight();
  }
 else {
    return mQsMinExpansionHeight * HEADER_RUBBERBAND_FACTOR;
  }
}

Fixed version (ground truth):
@Override protected float getPeekHeight(){
  if (mNotificationStackScroller.getNotGoneChildCount() > 0) {
    return mNotificationStackScroller.getPeekHeight();
  }
 else {
    return mQsMinExpansionHeight;
  }
}
Program: 191191
Project: 191191
Buggy source:
public int getLayoutMinHeight(){
  final ExpandableView firstChild=getFirstChildNotGone();
  int firstChildMinHeight=firstChild != null ? firstChild.getIntrinsicHeight() : mEmptyShadeView != null ? mEmptyShadeView.getMinHeight() : mCollapsedSize;
  if (mOwnScrollY > 0) {
    firstChildMinHeight=Math.max(firstChildMinHeight - mOwnScrollY,mCollapsedSize);
  }
  return Math.min(firstChildMinHeight + mBottomStackPeekSize + mBottomStackSlowDownHeight,mMaxLayoutHeight - mTopPadding);
}

Fixed version (ground truth):
public int getLayoutMinHeight(){
  int firstChildMinHeight=getFirstChildMinHeight();
  return Math.min(firstChildMinHeight + mBottomStackPeekSize + mBottomStackSlowDownHeight,mMaxLayoutHeight - mTopPadding);
}
Program: 191192
Project: 191192
Buggy source:
/** 
 * Update the height of the stack to a new height.
 * @param height the new height of the stack
 */
public void setStackHeight(float height){
  mLastSetStackHeight=height;
  setIsExpanded(height > 0.0f);
  int newStackHeight=(int)height;
  int minStackHeight=getLayoutMinHeight();
  int stackHeight;
  float paddingOffset;
  boolean trackingHeadsUp=mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp();
  int normalUnfoldPositionStart=trackingHeadsUp ? mHeadsUpManager.getTopHeadsUpPinnedHeight() : minStackHeight;
  if (newStackHeight - mTopPadding - mTopPaddingOverflow >= normalUnfoldPositionStart || getNotGoneChildCount() == 0) {
    paddingOffset=mTopPaddingOverflow;
    stackHeight=newStackHeight;
  }
 else {
    int translationY;
    translationY=newStackHeight - normalUnfoldPositionStart;
    paddingOffset=translationY - mTopPadding;
    stackHeight=(int)(height - (translationY - mTopPadding));
  }
  if (stackHeight != mCurrentStackHeight) {
    mCurrentStackHeight=stackHeight;
    updateAlgorithmHeightAndPadding();
    requestChildrenUpdate();
  }
  setStackTranslation(paddingOffset);
}

Fixed version (ground truth):
/** 
 * Update the height of the stack to a new height.
 * @param height the new height of the stack
 */
public void setStackHeight(float height){
  mLastSetStackHeight=height;
  setIsExpanded(height > 0.0f);
  int stackHeight;
  float translationY;
  float appearEndPosition=getAppearEndPosition();
  float appearStartPosition=getAppearStartPosition();
  if (height >= appearEndPosition) {
    translationY=mTopPaddingOverflow;
    stackHeight=(int)height;
  }
 else {
    float appearFraction=getAppearFraction(height);
    if (appearFraction >= 0) {
      translationY=NotificationUtils.interpolate(getExpandTranslationStart(),0,appearFraction);
    }
 else {
      translationY=height - appearStartPosition + getExpandTranslationStart();
    }
    stackHeight=(int)(height - translationY);
  }
  if (stackHeight != mCurrentStackHeight) {
    mCurrentStackHeight=stackHeight;
    updateAlgorithmHeightAndPadding();
    requestChildrenUpdate();
  }
  setStackTranslation(translationY);
}
Program: 191193
Project: 191193
Buggy source:
/** 
 * Called for system navigation gestures. First action opens the panel, second opens settings. Down action closes the entire panel.
 */
@Override public void handleSystemNavigationKey(int key){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + key);
  if (!panelsEnabled()) {
    return;
  }
  if (!mUserSetup)   return;
  if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_UP == key) {
    mNotificationPanel.collapse(false,1.0f);
  }
 else   if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_DOWN == key) {
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.expand(true);
    }
 else     if (!mNotificationPanel.isInSettings() && !mNotificationPanel.isExpanding()) {
      mNotificationPanel.flingSettings(0,true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called for system navigation gestures. First action opens the panel, second opens settings. Down action closes the entire panel.
 */
@Override public void handleSystemNavigationKey(int key){
  if (SPEW)   Log.d(TAG,"String_Node_Str" + key);
  if (!panelsEnabled() || !mKeyguardMonitor.isDeviceInteractive()) {
    return;
  }
  if (!mUserSetup)   return;
  if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_UP == key) {
    mNotificationPanel.collapse(false,1.0f);
  }
 else   if (KeyEvent.KEYCODE_SYSTEM_NAVIGATION_DOWN == key) {
    if (mNotificationPanel.isFullyCollapsed()) {
      mNotificationPanel.expand(true);
    }
 else     if (!mNotificationPanel.isInSettings() && !mNotificationPanel.isExpanding()) {
      mNotificationPanel.flingSettings(0,true);
    }
  }
}
Program: 191194
Project: 191194
Buggy source:
/** 
 * Remove a removed child view from the heads up animations if it was just added there
 * @return whether any child was removed from the list to animate
 */
private boolean removeRemovedChildFromHeadsUpChangeAnimations(View child){
  boolean hasAddEvent=false;
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    if (child == row) {
      mTmpList.add(eventPair);
      hasAddEvent|=isHeadsUp;
    }
  }
  if (hasAddEvent) {
    mHeadsUpChangeAnimations.removeAll(mTmpList);
  }
  mTmpList.clear();
  return hasAddEvent;
}

Fixed version (ground truth):
/** 
 * Remove a removed child view from the heads up animations if it was just added there
 * @return whether any child was removed from the list to animate
 */
private boolean removeRemovedChildFromHeadsUpChangeAnimations(View child){
  boolean hasAddEvent=false;
  for (  Pair<ExpandableNotificationRow,Boolean> eventPair : mHeadsUpChangeAnimations) {
    ExpandableNotificationRow row=eventPair.first;
    boolean isHeadsUp=eventPair.second;
    if (child == row) {
      mTmpList.add(eventPair);
      hasAddEvent|=isHeadsUp;
    }
  }
  if (hasAddEvent) {
    mHeadsUpChangeAnimations.removeAll(mTmpList);
    ((ExpandableNotificationRow)child).setHeadsupDisappearRunning(false);
  }
  mTmpList.clear();
  return hasAddEvent;
}
Program: 191195
Project: 191195
Buggy source:
public void onChildAnimationFinished(){
  setAnimationRunning(false);
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
  clearViewOverlays();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  setAnimationRunning(false);
  requestChildrenUpdate();
  runAnimationFinishedRunnables();
  clearViewOverlays();
  clearHeadsUpDisappearRunning();
}
Program: 191196
Project: 191196
Buggy source:
/** 
 * @hide
 */
@TestApi public GnssMeasurementsEvent(GnssClock clock,GnssMeasurement[] measurements){
  if (clock == null) {
    throw new InvalidParameterException("String_Node_Str");
  }
  if (measurements == null || measurements.length == 0) {
    throw new InvalidParameterException("String_Node_Str");
  }
  mClock=clock;
  Collection<GnssMeasurement> measurementCollection=Arrays.asList(measurements);
  mReadOnlyMeasurements=Collections.unmodifiableCollection(measurementCollection);
}

Fixed version (ground truth):
/** 
 * @hide
 */
@TestApi public GnssMeasurementsEvent(GnssClock clock,GnssMeasurement[] measurements){
  if (clock == null) {
    throw new InvalidParameterException("String_Node_Str");
  }
  if (measurements == null || measurements.length == 0) {
    mReadOnlyMeasurements=Collections.emptyList();
  }
 else {
    Collection<GnssMeasurement> measurementCollection=Arrays.asList(measurements);
    mReadOnlyMeasurements=Collections.unmodifiableCollection(measurementCollection);
  }
  mClock=clock;
}
Program: 191199
Project: 191199
Buggy source:
/** 
 * @hide
 */
@TestApi public GnssMeasurementsEvent(GnssClock clock,GnssMeasurement[] measurements){
  if (clock == null) {
    throw new InvalidParameterException("String_Node_Str");
  }
  if (measurements == null || measurements.length == 0) {
    throw new InvalidParameterException("String_Node_Str");
  }
  mClock=clock;
  Collection<GnssMeasurement> measurementCollection=Arrays.asList(measurements);
  mReadOnlyMeasurements=Collections.unmodifiableCollection(measurementCollection);
}

Fixed version (ground truth):
/** 
 * @hide
 */
@TestApi public GnssMeasurementsEvent(GnssClock clock,GnssMeasurement[] measurements){
  if (clock == null) {
    throw new InvalidParameterException("String_Node_Str");
  }
  if (measurements == null || measurements.length == 0) {
    mReadOnlyMeasurements=Collections.emptyList();
  }
 else {
    Collection<GnssMeasurement> measurementCollection=Arrays.asList(measurements);
    mReadOnlyMeasurements=Collections.unmodifiableCollection(measurementCollection);
  }
  mClock=clock;
}
Program: 191201
Project: 191201
Buggy source:
public int getCode(){
  return mEvent.getCode();
}

Fixed version (ground truth):
public int getCode(){
  return mEvent != null ? mEvent.getCode() : -1;
}
Program: 191202
Project: 191202
Buggy source:
public int getCode(){
  return mEvent.getCode();
}

Fixed version (ground truth):
public int getCode(){
  return mEvent != null ? mEvent.getCode() : -1;
}
Program: 191205
Project: 191205
Buggy source:
private boolean collectPackageServicesLocked(String packageName,Set<String> filterByClasses,boolean evenPersistent,boolean doit,boolean killProcess,ArrayMap<ComponentName,ServiceRecord> services){
  boolean didSomething=false;
  for (int i=services.size() - 1; i >= 0; i--) {
    ServiceRecord service=services.valueAt(i);
    final boolean sameComponent=packageName == null || (service.packageName.equals(packageName) && (filterByClasses == null || filterByClasses.contains(service.name.getClassName())));
    if (sameComponent && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=killProcess;
        if (!service.app.persistent) {
          service.app.services.remove(service);
        }
      }
      service.app=null;
      service.isolatedProc=null;
      if (mTmpCollectionResults == null) {
        mTmpCollectionResults=new ArrayList<>();
      }
      mTmpCollectionResults.add(service);
    }
  }
  return didSomething;
}

Fixed version (ground truth):
private boolean collectPackageServicesLocked(String packageName,Set<String> filterByClasses,boolean evenPersistent,boolean doit,boolean killProcess,ArrayMap<ComponentName,ServiceRecord> services){
  boolean didSomething=false;
  for (int i=services.size() - 1; i >= 0; i--) {
    ServiceRecord service=services.valueAt(i);
    final boolean sameComponent=packageName == null || (service.packageName.equals(packageName) && (filterByClasses == null || filterByClasses.contains(service.name.getClassName())));
    if (sameComponent && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=killProcess;
        if (!service.app.persistent) {
          service.app.services.remove(service);
          if (service.whitelistManager) {
            updateWhitelistManagerLocked(service.app);
          }
        }
      }
      service.app=null;
      service.isolatedProc=null;
      if (mTmpCollectionResults == null) {
        mTmpCollectionResults=new ArrayList<>();
      }
      mTmpCollectionResults.add(service);
    }
  }
  return didSomething;
}
Program: 191214
Project: 191214
Buggy source:
private boolean collectPackageServicesLocked(String packageName,Set<String> filterByClasses,boolean evenPersistent,boolean doit,boolean killProcess,ArrayMap<ComponentName,ServiceRecord> services){
  boolean didSomething=false;
  for (int i=services.size() - 1; i >= 0; i--) {
    ServiceRecord service=services.valueAt(i);
    final boolean sameComponent=packageName == null || (service.packageName.equals(packageName) && (filterByClasses == null || filterByClasses.contains(service.name.getClassName())));
    if (sameComponent && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=killProcess;
        if (!service.app.persistent) {
          service.app.services.remove(service);
        }
      }
      service.app=null;
      service.isolatedProc=null;
      if (mTmpCollectionResults == null) {
        mTmpCollectionResults=new ArrayList<>();
      }
      mTmpCollectionResults.add(service);
    }
  }
  return didSomething;
}

Fixed version (ground truth):
private boolean collectPackageServicesLocked(String packageName,Set<String> filterByClasses,boolean evenPersistent,boolean doit,boolean killProcess,ArrayMap<ComponentName,ServiceRecord> services){
  boolean didSomething=false;
  for (int i=services.size() - 1; i >= 0; i--) {
    ServiceRecord service=services.valueAt(i);
    final boolean sameComponent=packageName == null || (service.packageName.equals(packageName) && (filterByClasses == null || filterByClasses.contains(service.name.getClassName())));
    if (sameComponent && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=killProcess;
        if (!service.app.persistent) {
          service.app.services.remove(service);
          if (service.whitelistManager) {
            updateWhitelistManagerLocked(service.app);
          }
        }
      }
      service.app=null;
      service.isolatedProc=null;
      if (mTmpCollectionResults == null) {
        mTmpCollectionResults=new ArrayList<>();
      }
      mTmpCollectionResults.add(service);
    }
  }
  return didSomething;
}
Program: 191223
Project: 191223
Buggy source:
private boolean collectPackageServicesLocked(String packageName,Set<String> filterByClasses,boolean evenPersistent,boolean doit,boolean killProcess,ArrayMap<ComponentName,ServiceRecord> services){
  boolean didSomething=false;
  for (int i=services.size() - 1; i >= 0; i--) {
    ServiceRecord service=services.valueAt(i);
    final boolean sameComponent=packageName == null || (service.packageName.equals(packageName) && (filterByClasses == null || filterByClasses.contains(service.name.getClassName())));
    if (sameComponent && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=killProcess;
        if (!service.app.persistent) {
          service.app.services.remove(service);
        }
      }
      service.app=null;
      service.isolatedProc=null;
      if (mTmpCollectionResults == null) {
        mTmpCollectionResults=new ArrayList<>();
      }
      mTmpCollectionResults.add(service);
    }
  }
  return didSomething;
}

Fixed version (ground truth):
private boolean collectPackageServicesLocked(String packageName,Set<String> filterByClasses,boolean evenPersistent,boolean doit,boolean killProcess,ArrayMap<ComponentName,ServiceRecord> services){
  boolean didSomething=false;
  for (int i=services.size() - 1; i >= 0; i--) {
    ServiceRecord service=services.valueAt(i);
    final boolean sameComponent=packageName == null || (service.packageName.equals(packageName) && (filterByClasses == null || filterByClasses.contains(service.name.getClassName())));
    if (sameComponent && (service.app == null || evenPersistent || !service.app.persistent)) {
      if (!doit) {
        return true;
      }
      didSomething=true;
      Slog.i(TAG,"String_Node_Str" + service);
      if (service.app != null) {
        service.app.removed=killProcess;
        if (!service.app.persistent) {
          service.app.services.remove(service);
          if (service.whitelistManager) {
            updateWhitelistManagerLocked(service.app);
          }
        }
      }
      service.app=null;
      service.isolatedProc=null;
      if (mTmpCollectionResults == null) {
        mTmpCollectionResults=new ArrayList<>();
      }
      mTmpCollectionResults.add(service);
    }
  }
  return didSomething;
}
Program: 191235
Project: 191235
Buggy source:
@Override public IBinder onBind(Intent intent){
  mService=IQSService.Stub.asInterface(intent.getIBinderExtra(EXTRA_SERVICE));
  try {
    mTile=mService.getTile(new ComponentName(getPackageName(),getClass().getName()));
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  if (mTile != null) {
    mTile.setService(mService);
    mHandler.sendEmptyMessage(H.MSG_START_SUCCESS);
  }
  return new IQSTileService.Stub(){
    @Override public void onTileRemoved() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_REMOVED);
    }
    @Override public void onTileAdded() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_ADDED);
    }
    @Override public void onStopListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_STOP_LISTENING);
    }
    @Override public void onStartListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_START_LISTENING);
    }
    @Override public void onClick(    IBinder wtoken) throws RemoteException {
      mHandler.obtainMessage(H.MSG_TILE_CLICKED,wtoken).sendToTarget();
    }
    @Override public void onUnlockComplete() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_UNLOCK_COMPLETE);
    }
  }
;
}

Fixed version (ground truth):
@Override public IBinder onBind(Intent intent){
  mService=IQSService.Stub.asInterface(intent.getIBinderExtra(EXTRA_SERVICE));
  try {
    ComponentName component=intent.getParcelableExtra(EXTRA_COMPONENT);
    mTile=mService.getTile(component);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  if (mTile != null) {
    mTile.setService(mService);
    mHandler.sendEmptyMessage(H.MSG_START_SUCCESS);
  }
  return new IQSTileService.Stub(){
    @Override public void onTileRemoved() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_REMOVED);
    }
    @Override public void onTileAdded() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_ADDED);
    }
    @Override public void onStopListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_STOP_LISTENING);
    }
    @Override public void onStartListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_START_LISTENING);
    }
    @Override public void onClick(    IBinder wtoken) throws RemoteException {
      mHandler.obtainMessage(H.MSG_TILE_CLICKED,wtoken).sendToTarget();
    }
    @Override public void onUnlockComplete() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_UNLOCK_COMPLETE);
    }
  }
;
}
Program: 191236
Project: 191236
Buggy source:
public TileLifecycleManager(Handler handler,Context context,IQSService service,Tile tile,Intent intent,UserHandle user){
  mContext=context;
  mHandler=handler;
  mIntent=intent;
  mIntent.putExtra(TileService.EXTRA_SERVICE,service.asBinder());
  mUser=user;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mIntent + "String_Node_Str"+ mUser);
}

Fixed version (ground truth):
public TileLifecycleManager(Handler handler,Context context,IQSService service,Tile tile,Intent intent,UserHandle user){
  mContext=context;
  mHandler=handler;
  mIntent=intent;
  mIntent.putExtra(TileService.EXTRA_SERVICE,service.asBinder());
  mIntent.putExtra(TileService.EXTRA_COMPONENT,intent.getComponent());
  mUser=user;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mIntent + "String_Node_Str"+ mUser);
}
Program: 191237
Project: 191237
Buggy source:
@Override public IBinder onBind(Intent intent){
  mService=IQSService.Stub.asInterface(intent.getIBinderExtra(EXTRA_SERVICE));
  try {
    mTile=mService.getTile(new ComponentName(getPackageName(),getClass().getName()));
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  if (mTile != null) {
    mTile.setService(mService);
    mHandler.sendEmptyMessage(H.MSG_START_SUCCESS);
  }
  return new IQSTileService.Stub(){
    @Override public void onTileRemoved() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_REMOVED);
    }
    @Override public void onTileAdded() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_ADDED);
    }
    @Override public void onStopListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_STOP_LISTENING);
    }
    @Override public void onStartListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_START_LISTENING);
    }
    @Override public void onClick(    IBinder wtoken) throws RemoteException {
      mHandler.obtainMessage(H.MSG_TILE_CLICKED,wtoken).sendToTarget();
    }
    @Override public void onUnlockComplete() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_UNLOCK_COMPLETE);
    }
  }
;
}

Fixed version (ground truth):
@Override public IBinder onBind(Intent intent){
  mService=IQSService.Stub.asInterface(intent.getIBinderExtra(EXTRA_SERVICE));
  try {
    ComponentName component=intent.getParcelableExtra(EXTRA_COMPONENT);
    mTile=mService.getTile(component);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  if (mTile != null) {
    mTile.setService(mService);
    mHandler.sendEmptyMessage(H.MSG_START_SUCCESS);
  }
  return new IQSTileService.Stub(){
    @Override public void onTileRemoved() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_REMOVED);
    }
    @Override public void onTileAdded() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_ADDED);
    }
    @Override public void onStopListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_STOP_LISTENING);
    }
    @Override public void onStartListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_START_LISTENING);
    }
    @Override public void onClick(    IBinder wtoken) throws RemoteException {
      mHandler.obtainMessage(H.MSG_TILE_CLICKED,wtoken).sendToTarget();
    }
    @Override public void onUnlockComplete() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_UNLOCK_COMPLETE);
    }
  }
;
}
Program: 191238
Project: 191238
Buggy source:
public TileLifecycleManager(Handler handler,Context context,IQSService service,Tile tile,Intent intent,UserHandle user){
  mContext=context;
  mHandler=handler;
  mIntent=intent;
  mIntent.putExtra(TileService.EXTRA_SERVICE,service.asBinder());
  mUser=user;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mIntent + "String_Node_Str"+ mUser);
}

Fixed version (ground truth):
public TileLifecycleManager(Handler handler,Context context,IQSService service,Tile tile,Intent intent,UserHandle user){
  mContext=context;
  mHandler=handler;
  mIntent=intent;
  mIntent.putExtra(TileService.EXTRA_SERVICE,service.asBinder());
  mIntent.putExtra(TileService.EXTRA_COMPONENT,intent.getComponent());
  mUser=user;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mIntent + "String_Node_Str"+ mUser);
}
Program: 191239
Project: 191239
Buggy source:
@Override public IBinder onBind(Intent intent){
  mService=IQSService.Stub.asInterface(intent.getIBinderExtra(EXTRA_SERVICE));
  try {
    mTile=mService.getTile(new ComponentName(getPackageName(),getClass().getName()));
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  if (mTile != null) {
    mTile.setService(mService);
    mHandler.sendEmptyMessage(H.MSG_START_SUCCESS);
  }
  return new IQSTileService.Stub(){
    @Override public void onTileRemoved() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_REMOVED);
    }
    @Override public void onTileAdded() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_ADDED);
    }
    @Override public void onStopListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_STOP_LISTENING);
    }
    @Override public void onStartListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_START_LISTENING);
    }
    @Override public void onClick(    IBinder wtoken) throws RemoteException {
      mHandler.obtainMessage(H.MSG_TILE_CLICKED,wtoken).sendToTarget();
    }
    @Override public void onUnlockComplete() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_UNLOCK_COMPLETE);
    }
  }
;
}

Fixed version (ground truth):
@Override public IBinder onBind(Intent intent){
  mService=IQSService.Stub.asInterface(intent.getIBinderExtra(EXTRA_SERVICE));
  try {
    ComponentName component=intent.getParcelableExtra(EXTRA_COMPONENT);
    mTile=mService.getTile(component);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  if (mTile != null) {
    mTile.setService(mService);
    mHandler.sendEmptyMessage(H.MSG_START_SUCCESS);
  }
  return new IQSTileService.Stub(){
    @Override public void onTileRemoved() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_REMOVED);
    }
    @Override public void onTileAdded() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_ADDED);
    }
    @Override public void onStopListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_STOP_LISTENING);
    }
    @Override public void onStartListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_START_LISTENING);
    }
    @Override public void onClick(    IBinder wtoken) throws RemoteException {
      mHandler.obtainMessage(H.MSG_TILE_CLICKED,wtoken).sendToTarget();
    }
    @Override public void onUnlockComplete() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_UNLOCK_COMPLETE);
    }
  }
;
}
Program: 191240
Project: 191240
Buggy source:
public TileLifecycleManager(Handler handler,Context context,IQSService service,Tile tile,Intent intent,UserHandle user){
  mContext=context;
  mHandler=handler;
  mIntent=intent;
  mIntent.putExtra(TileService.EXTRA_SERVICE,service.asBinder());
  mUser=user;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mIntent + "String_Node_Str"+ mUser);
}

Fixed version (ground truth):
public TileLifecycleManager(Handler handler,Context context,IQSService service,Tile tile,Intent intent,UserHandle user){
  mContext=context;
  mHandler=handler;
  mIntent=intent;
  mIntent.putExtra(TileService.EXTRA_SERVICE,service.asBinder());
  mIntent.putExtra(TileService.EXTRA_COMPONENT,intent.getComponent());
  mUser=user;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mIntent + "String_Node_Str"+ mUser);
}
Program: 191241
Project: 191241
Buggy source:
@Override public IBinder onBind(Intent intent){
  mService=IQSService.Stub.asInterface(intent.getIBinderExtra(EXTRA_SERVICE));
  try {
    mTile=mService.getTile(new ComponentName(getPackageName(),getClass().getName()));
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  if (mTile != null) {
    mTile.setService(mService);
    mHandler.sendEmptyMessage(H.MSG_START_SUCCESS);
  }
  return new IQSTileService.Stub(){
    @Override public void onTileRemoved() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_REMOVED);
    }
    @Override public void onTileAdded() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_ADDED);
    }
    @Override public void onStopListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_STOP_LISTENING);
    }
    @Override public void onStartListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_START_LISTENING);
    }
    @Override public void onClick(    IBinder wtoken) throws RemoteException {
      mHandler.obtainMessage(H.MSG_TILE_CLICKED,wtoken).sendToTarget();
    }
    @Override public void onUnlockComplete() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_UNLOCK_COMPLETE);
    }
  }
;
}

Fixed version (ground truth):
@Override public IBinder onBind(Intent intent){
  mService=IQSService.Stub.asInterface(intent.getIBinderExtra(EXTRA_SERVICE));
  try {
    ComponentName component=intent.getParcelableExtra(EXTRA_COMPONENT);
    mTile=mService.getTile(component);
  }
 catch (  RemoteException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  if (mTile != null) {
    mTile.setService(mService);
    mHandler.sendEmptyMessage(H.MSG_START_SUCCESS);
  }
  return new IQSTileService.Stub(){
    @Override public void onTileRemoved() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_REMOVED);
    }
    @Override public void onTileAdded() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_TILE_ADDED);
    }
    @Override public void onStopListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_STOP_LISTENING);
    }
    @Override public void onStartListening() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_START_LISTENING);
    }
    @Override public void onClick(    IBinder wtoken) throws RemoteException {
      mHandler.obtainMessage(H.MSG_TILE_CLICKED,wtoken).sendToTarget();
    }
    @Override public void onUnlockComplete() throws RemoteException {
      mHandler.sendEmptyMessage(H.MSG_UNLOCK_COMPLETE);
    }
  }
;
}
Program: 191242
Project: 191242
Buggy source:
public TileLifecycleManager(Handler handler,Context context,IQSService service,Tile tile,Intent intent,UserHandle user){
  mContext=context;
  mHandler=handler;
  mIntent=intent;
  mIntent.putExtra(TileService.EXTRA_SERVICE,service.asBinder());
  mUser=user;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mIntent + "String_Node_Str"+ mUser);
}

Fixed version (ground truth):
public TileLifecycleManager(Handler handler,Context context,IQSService service,Tile tile,Intent intent,UserHandle user){
  mContext=context;
  mHandler=handler;
  mIntent=intent;
  mIntent.putExtra(TileService.EXTRA_SERVICE,service.asBinder());
  mIntent.putExtra(TileService.EXTRA_COMPONENT,intent.getComponent());
  mUser=user;
  if (DEBUG)   Log.d(TAG,"String_Node_Str" + mIntent + "String_Node_Str"+ mUser);
}
Program: 191243
Project: 191243
Buggy source:
JobInstance(JobStatus jobStatus){
  mJobStatus=jobStatus;
  mExecuteRunner=new TriggerRunnable(this);
  mTimeoutRunner=new TriggerRunnable(this);
  final JobInfo.TriggerContentUri[] uris=jobStatus.getJob().getTriggerContentUris();
  if (uris != null) {
    for (    JobInfo.TriggerContentUri uri : uris) {
      ObserverInstance obs=mObservers.get(uri.getUri());
      if (obs == null) {
        obs=new ObserverInstance(mHandler,uri.getUri());
        mObservers.put(uri.getUri(),obs);
        mContext.getContentResolver().registerContentObserver(uri.getUri(),(uri.getFlags() & JobInfo.TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS) != 0,obs);
      }
      obs.mJobs.add(this);
      mMyObservers.add(obs);
    }
  }
}

Fixed version (ground truth):
JobInstance(JobStatus jobStatus){
  mJobStatus=jobStatus;
  mExecuteRunner=new TriggerRunnable(this);
  mTimeoutRunner=new TriggerRunnable(this);
  final JobInfo.TriggerContentUri[] uris=jobStatus.getJob().getTriggerContentUris();
  if (uris != null) {
    for (    JobInfo.TriggerContentUri uri : uris) {
      ObserverInstance obs=mObservers.get(uri);
      if (obs == null) {
        obs=new ObserverInstance(mHandler,uri.getUri());
        mObservers.put(uri,obs);
        mContext.getContentResolver().registerContentObserver(uri.getUri(),(uri.getFlags() & JobInfo.TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS) != 0,obs);
      }
      obs.mJobs.add(this);
      mMyObservers.add(obs);
    }
  }
}
Program: 191245
Project: 191245
Buggy source:
void detachLocked(){
  final int N=mMyObservers.size();
  for (int i=0; i < N; i++) {
    final ObserverInstance obs=mMyObservers.get(i);
    obs.mJobs.remove(this);
    if (obs.mJobs.size() == 0) {
      mContext.getContentResolver().unregisterContentObserver(obs);
      mObservers.remove(obs.mUri);
    }
  }
}

Fixed version (ground truth):
void detachLocked(){
  final int N=mMyObservers.size();
  for (int i=0; i < N; i++) {
    final ObserverInstance obs=mMyObservers.get(i);
    obs.mJobs.remove(this);
    if (obs.mJobs.size() == 0) {
      mContext.getContentResolver().unregisterContentObserver(obs);
      mObservers.remove(obs);
    }
  }
}