nus-yam/ex-repair huggingface dataset:
Program: 198417
Project: 198417
Buggy source:
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isShowingLayoutLayouted();
  }
  return child == null || child.getWidth() != 0;
}

Fixed version (ground truth):
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isMaxExpandHeightInitialized();
  }
  return child == null || child.getWidth() != 0;
}
Program: 198418
Project: 198418
Buggy source:
/** 
 * Sets the root of the preference hierarchy that this fragment is showing.
 * @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
 */
public void setPreferenceScreen(PreferenceScreen preferenceScreen){
  if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) {
    mHavePrefs=true;
    if (mInitDone) {
      postBindPreferences();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the root of the preference hierarchy that this fragment is showing.
 * @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
 */
public void setPreferenceScreen(PreferenceScreen preferenceScreen){
  if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) {
    onUnbindPreferences();
    mHavePrefs=true;
    if (mInitDone) {
      postBindPreferences();
    }
  }
}
Program: 198419
Project: 198419
Buggy source:
/** 
 * Sets the root of the preference hierarchy that this fragment is showing.
 * @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
 */
public void setPreferenceScreen(PreferenceScreen preferenceScreen){
  if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) {
    mHavePrefs=true;
    if (mInitDone) {
      postBindPreferences();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the root of the preference hierarchy that this fragment is showing.
 * @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
 */
public void setPreferenceScreen(PreferenceScreen preferenceScreen){
  if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) {
    onUnbindPreferences();
    mHavePrefs=true;
    if (mInitDone) {
      postBindPreferences();
    }
  }
}
Program: 198420
Project: 198420
Buggy source:
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198421
Project: 198421
Buggy source:
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}

Fixed version (ground truth):
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  if (entry.row != null) {
    entry.row.resetHeight();
  }
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}
Program: 198422
Project: 198422
Buggy source:
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  final boolean wasExpanded=isExpanded();
  mExpansionDisabled=expansionDisabled;
  logExpansionEvent(false,wasExpanded);
  notifyHeightChanged();
}

Fixed version (ground truth):
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  if (expansionDisabled != mExpansionDisabled) {
    final boolean wasExpanded=isExpanded();
    mExpansionDisabled=expansionDisabled;
    logExpansionEvent(false,wasExpanded);
    if (wasExpanded != isExpanded()) {
      notifyHeightChanged();
    }
  }
}
Program: 198423
Project: 198423
Buggy source:
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  final boolean wasExpanded=isExpanded();
  mIsSystemExpanded=expand;
  notifyHeightChanged();
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  if (expand != mIsSystemExpanded) {
    final boolean wasExpanded=isExpanded();
    mIsSystemExpanded=expand;
    notifyHeightChanged();
    logExpansionEvent(false,wasExpanded);
  }
}
Program: 198424
Project: 198424
Buggy source:
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  mWasReset=true;
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  resetHeight();
  logExpansionEvent(false,wasExpanded);
}
Program: 198425
Project: 198425
Buggy source:
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}

Fixed version (ground truth):
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null && !mTouching) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}
Program: 198426
Project: 198426
Buggy source:
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected int getMaxPanelHeight(){
  mMaxPanelHeight=Math.max(mMaxPanelHeight,getHeight());
  return mMaxPanelHeight;
}

Fixed version (ground truth):
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected abstract int getMaxPanelHeight();
Program: 198428
Project: 198428
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (DEBUG)   logf("String_Node_Str",changed ? "String_Node_Str" : "String_Node_Str",bottom,(int)mExpandedHeight,mMaxPanelHeight);
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
  mHasLayoutedSinceDown=true;
  if (mUpdateFlingOnLayout) {
    abortAnimations();
    fling(mUpdateFlingVelocity,true);
    mUpdateFlingOnLayout=false;
  }
}
Program: 198429
Project: 198429
Buggy source:
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
  mMaxPanelHeight=-1;
}

Fixed version (ground truth):
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
}
Program: 198431
Project: 198431
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    mNotificationPanel.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}
Program: 198432
Project: 198432
Buggy source:
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
}

Fixed version (ground truth):
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
  mStackScrollAlgorithm.onReset(view);
}
Program: 198433
Project: 198433
Buggy source:
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      if (!isMaxSizeInitialized(mFirstChildWhileExpanding)) {
        mFirstChildWhileExpanding.addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
          @Override public void onLayoutChange(          View v,          int left,          int top,          int right,          int bottom,          int oldLeft,          int oldTop,          int oldRight,          int oldBottom){
            if (mFirstChildWhileExpanding != null) {
              mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
            }
 else {
              mFirstChildMaxHeight=0;
            }
            v.removeOnLayoutChangeListener(this);
          }
        }
);
      }
 else {
        mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
      }
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}

Fixed version (ground truth):
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      updateFirstChildMaxSizeToMaxHeight();
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}
Program: 198434
Project: 198434
Buggy source:
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isShowingLayoutLayouted();
  }
  return child == null || child.getWidth() != 0;
}

Fixed version (ground truth):
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isMaxExpandHeightInitialized();
  }
  return child == null || child.getWidth() != 0;
}
Program: 198435
Project: 198435
Buggy source:
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198436
Project: 198436
Buggy source:
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}

Fixed version (ground truth):
private void updateNotificationViews(NotificationData.Entry entry,StatusBarNotification notification,boolean isHeadsUp){
  final RemoteViews contentView=notification.getNotification().contentView;
  final RemoteViews bigContentView=isHeadsUp ? notification.getNotification().headsUpContentView : notification.getNotification().bigContentView;
  final Notification publicVersion=notification.getNotification().publicVersion;
  final RemoteViews publicContentView=publicVersion != null ? publicVersion.contentView : null;
  if (entry.row != null) {
    entry.row.resetHeight();
  }
  contentView.reapply(mContext,entry.expanded,mOnClickHandler);
  if (bigContentView != null && entry.getBigContentView() != null) {
    bigContentView.reapply(mContext,entry.getBigContentView(),mOnClickHandler);
  }
  if (publicContentView != null && entry.getPublicContentView() != null) {
    publicContentView.reapply(mContext,entry.getPublicContentView(),mOnClickHandler);
  }
  final PendingIntent contentIntent=notification.getNotification().contentIntent;
  if (contentIntent != null) {
    final View.OnClickListener listener=makeClicker(contentIntent,notification.getKey(),isHeadsUp);
    entry.row.setOnClickListener(listener);
  }
 else {
    entry.row.setOnClickListener(null);
  }
  entry.row.notifyContentUpdated();
}
Program: 198437
Project: 198437
Buggy source:
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  final boolean wasExpanded=isExpanded();
  mExpansionDisabled=expansionDisabled;
  logExpansionEvent(false,wasExpanded);
  notifyHeightChanged();
}

Fixed version (ground truth):
/** 
 * @param expansionDisabled whether to prevent notification expansion
 */
public void setExpansionDisabled(boolean expansionDisabled){
  if (expansionDisabled != mExpansionDisabled) {
    final boolean wasExpanded=isExpanded();
    mExpansionDisabled=expansionDisabled;
    logExpansionEvent(false,wasExpanded);
    if (wasExpanded != isExpanded()) {
      notifyHeightChanged();
    }
  }
}
Program: 198438
Project: 198438
Buggy source:
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  final boolean wasExpanded=isExpanded();
  mIsSystemExpanded=expand;
  notifyHeightChanged();
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Set this notification to be expanded by the system.
 * @param expand whether the system wants this notification to be expanded.
 */
public void setSystemExpanded(boolean expand){
  if (expand != mIsSystemExpanded) {
    final boolean wasExpanded=isExpanded();
    mIsSystemExpanded=expand;
    notifyHeightChanged();
    logExpansionEvent(false,wasExpanded);
  }
}
Program: 198439
Project: 198439
Buggy source:
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  mMaxExpandHeight=0;
  mWasReset=true;
  logExpansionEvent(false,wasExpanded);
}

Fixed version (ground truth):
/** 
 * Resets this view so it can be re-used for an updated notification.
 */
@Override public void reset(){
  super.reset();
  mRowMinHeight=0;
  final boolean wasExpanded=isExpanded();
  mRowMaxHeight=0;
  mExpandable=false;
  mHasUserChangedExpansion=false;
  mUserLocked=false;
  mShowingPublic=false;
  mSensitive=false;
  mShowingPublicInitialized=false;
  mIsSystemExpanded=false;
  mExpansionDisabled=false;
  mPublicLayout.reset();
  mPrivateLayout.reset();
  resetHeight();
  logExpansionEvent(false,wasExpanded);
}
Program: 198440
Project: 198440
Buggy source:
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}

Fixed version (ground truth):
protected void requestPanelHeightUpdate(){
  float currentMaxPanelHeight=getMaxPanelHeight();
  if ((!mTracking || isTrackingBlocked()) && mHeightAnimator == null && mExpandedHeight > 0 && currentMaxPanelHeight != mExpandedHeight && !mPeekPending && mPeekAnimator == null && !mTouching) {
    setExpandedHeight(currentMaxPanelHeight);
  }
}
Program: 198441
Project: 198441
Buggy source:
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected int getMaxPanelHeight(){
  mMaxPanelHeight=Math.max(mMaxPanelHeight,getHeight());
  return mMaxPanelHeight;
}

Fixed version (ground truth):
/** 
 * This returns the maximum height of the panel. Children should override this if their desired height is not the full height.
 * @return the default implementation simply returns the maximum height.
 */
protected abstract int getMaxPanelHeight();
Program: 198443
Project: 198443
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  if (DEBUG)   logf("String_Node_Str",changed ? "String_Node_Str" : "String_Node_Str",bottom,(int)mExpandedHeight,mMaxPanelHeight);
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  requestPanelHeightUpdate();
  mHasLayoutedSinceDown=true;
  if (mUpdateFlingOnLayout) {
    abortAnimations();
    fling(mUpdateFlingVelocity,true);
    mUpdateFlingOnLayout=false;
  }
}
Program: 198444
Project: 198444
Buggy source:
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
  mMaxPanelHeight=-1;
}

Fixed version (ground truth):
@Override protected void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  loadDimens();
}
Program: 198446
Project: 198446
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  boolean intercept=false;
  if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD && !mService.isBouncerShowing()) {
    intercept=mDragDownHelper.onInterceptTouchEvent(ev);
  }
  if (!intercept) {
    super.onInterceptTouchEvent(ev);
  }
  if (intercept) {
    MotionEvent cancellation=MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);
    mStackScrollLayout.onInterceptTouchEvent(cancellation);
    mNotificationPanel.onInterceptTouchEvent(cancellation);
    cancellation.recycle();
  }
  return intercept;
}
Program: 198447
Project: 198447
Buggy source:
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
}

Fixed version (ground truth):
@Override public void onReset(ExpandableView view){
  mRequestViewResizeAnimationOnLayout=true;
  mStackScrollAlgorithm.onReset(view);
}
Program: 198448
Project: 198448
Buggy source:
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      if (!isMaxSizeInitialized(mFirstChildWhileExpanding)) {
        mFirstChildWhileExpanding.addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
          @Override public void onLayoutChange(          View v,          int left,          int top,          int right,          int bottom,          int oldLeft,          int oldTop,          int oldRight,          int oldBottom){
            if (mFirstChildWhileExpanding != null) {
              mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
            }
 else {
              mFirstChildMaxHeight=0;
            }
            v.removeOnLayoutChangeListener(this);
          }
        }
);
      }
 else {
        mFirstChildMaxHeight=getMaxAllowedChildHeight(mFirstChildWhileExpanding);
      }
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}

Fixed version (ground truth):
private void updateFirstChildHeightWhileExpanding(ViewGroup hostView){
  mFirstChildWhileExpanding=(ExpandableView)findFirstVisibleChild(hostView);
  if (mFirstChildWhileExpanding != null) {
    if (mExpandedOnStart) {
      mFirstChildMaxHeight=mFirstChildWhileExpanding.getActualHeight();
    }
 else {
      updateFirstChildMaxSizeToMaxHeight();
    }
  }
 else {
    mFirstChildMaxHeight=0;
  }
}
Program: 198449
Project: 198449
Buggy source:
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isShowingLayoutLayouted();
  }
  return child == null || child.getWidth() != 0;
}

Fixed version (ground truth):
private boolean isMaxSizeInitialized(ExpandableView child){
  if (child instanceof ExpandableNotificationRow) {
    ExpandableNotificationRow row=(ExpandableNotificationRow)child;
    return row.isMaxExpandHeightInitialized();
  }
  return child == null || child.getWidth() != 0;
}
Program: 198450
Project: 198450
Buggy source:
@Override public void onStateChanged(Connection c,int state){
switch (state) {
case Connection.STATE_FAILED:
    Log.d(this,"String_Node_Str",request,c.getFailureCode(),c.getFailureMessage());
  Log.d(this,"String_Node_Str",callId);
mAdapter.handleCreateConnectionFailed(callId,request,c.getFailureCode(),c.getFailureMessage());
break;
case Connection.STATE_CANCELED:
Log.d(this,"String_Node_Str",callId);
mAdapter.handleCreateConnectionCancelled(callId,request);
break;
case Connection.STATE_INITIALIZING:
Log.d(this,"String_Node_Str");
return;
default :
Log.d(this,"String_Node_Str",Connection.stateToString(state));
connectionCreated(callId,request,createdConnection);
break;
}
c.removeConnectionListener(this);
}

Fixed version (ground truth):
@Override public void onStateChanged(Connection c,int state){
switch (state) {
case Connection.STATE_FAILED:
    Log.d(this,"String_Node_Str",request,c.getFailureCode(),c.getFailureMessage());
  Log.d(this,"String_Node_Str",callId);
mAdapter.handleCreateConnectionFailed(callId,request,c.getFailureCode(),c.getFailureMessage());
break;
case Connection.STATE_CANCELED:
Log.d(this,"String_Node_Str",callId);
mAdapter.handleCreateConnectionCancelled(callId,request);
break;
case Connection.STATE_INITIALIZING:
Log.d(this,"String_Node_Str");
return;
}
c.removeConnectionListener(this);
}
Program: 198452
Project: 198452
Buggy source:
/** 
 * Sets the root of the preference hierarchy that this fragment is showing.
 * @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
 */
public void setPreferenceScreen(PreferenceScreen preferenceScreen){
  if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) {
    mHavePrefs=true;
    if (mInitDone) {
      postBindPreferences();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the root of the preference hierarchy that this fragment is showing.
 * @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
 */
public void setPreferenceScreen(PreferenceScreen preferenceScreen){
  if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) {
    onUnbindPreferences();
    mHavePrefs=true;
    if (mInitDone) {
      postBindPreferences();
    }
  }
}
Program: 198453
Project: 198453
Buggy source:
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    String key=readString();
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}
Program: 198454
Project: 198454
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    Object key=readValue(loader);
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    String key=readString();
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
  outVal.validate();
}
Program: 198455
Project: 198455
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeString(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}
Program: 198456
Project: 198456
Buggy source:
/** 
 * Sets the root of the preference hierarchy that this fragment is showing.
 * @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
 */
public void setPreferenceScreen(PreferenceScreen preferenceScreen){
  if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) {
    mHavePrefs=true;
    if (mInitDone) {
      postBindPreferences();
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the root of the preference hierarchy that this fragment is showing.
 * @param preferenceScreen The root {@link PreferenceScreen} of the preference hierarchy.
 */
public void setPreferenceScreen(PreferenceScreen preferenceScreen){
  if (mPreferenceManager.setPreferences(preferenceScreen) && preferenceScreen != null) {
    onUnbindPreferences();
    mHavePrefs=true;
    if (mInitDone) {
      postBindPreferences();
    }
  }
}
Program: 198457
Project: 198457
Buggy source:
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    String key=readString();
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}
Program: 198458
Project: 198458
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    Object key=readValue(loader);
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    String key=readString();
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
  outVal.validate();
}
Program: 198459
Project: 198459
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeString(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}
Program: 198460
Project: 198460
Buggy source:
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    String key=readString();
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}
Program: 198461
Project: 198461
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    Object key=readValue(loader);
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    String key=readString();
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
  outVal.validate();
}
Program: 198462
Project: 198462
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeString(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}
Program: 198463
Project: 198463
Buggy source:
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    String key=readString();
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}
Program: 198464
Project: 198464
Buggy source:
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    Object key=readValue(loader);
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  while (N > 0) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    String key=readString();
    Object value=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString((key != null ? key.hashCode() : 0))+ "String_Node_Str"+ key);
    outVal.append(key,value);
    N--;
  }
  outVal.validate();
}
Program: 198465
Project: 198465
Buggy source:
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeValue(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Flatten an ArrayMap into the parcel at the current dataPosition(), growing dataCapacity() if needed.  The Map keys must be String objects.
 */
void writeArrayMapInternal(ArrayMap<String,Object> val){
  if (val == null) {
    writeInt(-1);
    return;
  }
  final int N=val.size();
  writeInt(N);
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  int startPos;
  for (int i=0; i < N; i++) {
    if (DEBUG_ARRAY_MAP)     startPos=dataPosition();
    writeString(val.keyAt(i));
    writeValue(val.valueAt(i));
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ (dataPosition() - startPos)+ "String_Node_Str"+ Integer.toHexString(val.keyAt(i) != null ? val.keyAt(i).hashCode() : 0)+ "String_Node_Str"+ val.keyAt(i));
  }
}
Program: 198466
Project: 198466
Buggy source:
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    Object key=readValue(loader);
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}

Fixed version (ground truth):
void readArrayMapSafelyInternal(ArrayMap outVal,int N,ClassLoader loader){
  if (DEBUG_ARRAY_MAP) {
    RuntimeException here=new RuntimeException("String_Node_Str");
    here.fillInStackTrace();
    Log.d(TAG,"String_Node_Str" + N + "String_Node_Str",here);
  }
  while (N > 0) {
    String key=readString();
    if (DEBUG_ARRAY_MAP)     Log.d(TAG,"String_Node_Str" + (N - 1) + "String_Node_Str"+ (key != null ? key.hashCode() : 0)+ "String_Node_Str"+ key);
    Object value=readValue(loader);
    outVal.put(key,value);
    N--;
  }
}