nus-yam/ex-repair huggingface dataset:
Program: 199257
Project: 199257
Buggy source:
@Override protected void onFinishInflate(){
  super.onFinishInflate();
  mBackground=findViewById(R.id.background);
  mSystemIconsContainer=(ViewGroup)findViewById(R.id.system_icons_container);
  mDateTime=findViewById(R.id.datetime);
  mKeyguardCarrierText=findViewById(R.id.keyguard_carrier_text);
  mMultiUserSwitch=(MultiUserSwitch)findViewById(R.id.multi_user_switch);
  mDate=findViewById(R.id.date);
  mSettingsButton=findViewById(R.id.settings_button);
  mSettingsButton.setOnClickListener(this);
  mBrightnessContainer=findViewById(R.id.brightness_container);
  mBrightnessController=new BrightnessController(getContext(),(ImageView)findViewById(R.id.brightness_icon),(ToggleSlider)findViewById(R.id.brightness_slider));
  loadDimens();
  updateVisibilities();
}

Fixed version (ground truth):
@Override protected void onFinishInflate(){
  super.onFinishInflate();
  mBackground=findViewById(R.id.background);
  mSystemIconsContainer=(ViewGroup)findViewById(R.id.system_icons_container);
  mDateTime=findViewById(R.id.datetime);
  mKeyguardCarrierText=findViewById(R.id.keyguard_carrier_text);
  mMultiUserSwitch=(MultiUserSwitch)findViewById(R.id.multi_user_switch);
  mDate=findViewById(R.id.date);
  mSettingsButton=findViewById(R.id.settings_button);
  mSettingsButton.setOnClickListener(this);
  mBrightnessContainer=findViewById(R.id.brightness_container);
  mBrightnessController=new BrightnessController(getContext(),(ImageView)findViewById(R.id.brightness_icon),(ToggleSlider)findViewById(R.id.brightness_slider));
  loadDimens();
  updateVisibilities();
  addOnLayoutChangeListener(new View.OnLayoutChangeListener(){
    @Override public void onLayoutChange(    View v,    int left,    int top,    int right,    int bottom,    int oldLeft,    int oldTop,    int oldRight,    int oldBottom){
      if ((right - left) != (oldRight - oldLeft)) {
        setClipping(getHeight());
      }
    }
  }
);
}
Program: 199258
Project: 199258
Buggy source:
/** 
 * Creates a new AccessibilityAction. For adding a standard action without a specific label, use the static constants. You can also override the description for one the standard actions. Below is an example how to override the standard click action by adding a custom label: <pre> AccessibilityAction action = new AccessibilityAction( AccessibilityAction.ACTION_ACTION_CLICK, getLocalizedLabel()); node.addAction(action); </pre>
 * @param actionId The id for this action. This should either be one of thestandard actions or a specific action for your app. In that case it is required to use a resource identifier.
 * @param label The label for the new AccessibilityAction.
 */
public AccessibilityAction(int actionId,@Nullable CharSequence label){
  if ((actionId & ACTION_TYPE_MASK) == 0 && Integer.bitCount(actionId) > 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if ((actionId & STANDARD_NON_LEGACY_ACTION_MASK) != 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mActionId=actionId;
  mLabel=label;
}

Fixed version (ground truth):
/** 
 * Creates a new AccessibilityAction. For adding a standard action without a specific label, use the static constants. You can also override the description for one the standard actions. Below is an example how to override the standard click action by adding a custom label: <pre> AccessibilityAction action = new AccessibilityAction( AccessibilityAction.ACTION_ACTION_CLICK, getLocalizedLabel()); node.addAction(action); </pre>
 * @param actionId The id for this action. This should either be one of thestandard actions or a specific action for your app. In that case it is required to use a resource identifier.
 * @param label The label for the new AccessibilityAction.
 */
public AccessibilityAction(int actionId,@Nullable CharSequence label){
  if ((actionId & ACTION_TYPE_MASK) == 0 && Integer.bitCount(actionId) != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mActionId=actionId;
  mLabel=label;
}
Program: 199259
Project: 199259
Buggy source:
@Override public boolean performAccessibilityAction(int accessibilityWindowId,long accessibilityNodeId,int action,Bundle arguments,int interactionId,IAccessibilityInteractionConnectionCallback callback,long interrogatingTid) throws RemoteException {
  final int resolvedWindowId;
  IAccessibilityInteractionConnection connection=null;
synchronized (mLock) {
    final int resolvedUserId=mSecurityPolicy.resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.getCallingUserId());
    if (resolvedUserId != mCurrentUserId) {
      return false;
    }
    resolvedWindowId=resolveAccessibilityWindowIdLocked(accessibilityWindowId);
    final boolean permissionGranted=mSecurityPolicy.canPerformActionLocked(this,resolvedWindowId,action,arguments);
    if (!permissionGranted) {
      return false;
    }
 else {
      connection=getConnectionLocked(resolvedWindowId);
      if (connection == null) {
        return false;
      }
    }
  }
  final int interrogatingPid=Binder.getCallingPid();
  final long identityToken=Binder.clearCallingIdentity();
  try {
    connection.performAccessibilityAction(accessibilityNodeId,action,arguments,interactionId,callback,mFetchFlags,interrogatingPid,interrogatingTid);
  }
 catch (  RemoteException re) {
    if (DEBUG) {
      Slog.e(LOG_TAG,"String_Node_Str");
    }
  }
 finally {
    Binder.restoreCallingIdentity(identityToken);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performAccessibilityAction(int accessibilityWindowId,long accessibilityNodeId,int action,Bundle arguments,int interactionId,IAccessibilityInteractionConnectionCallback callback,long interrogatingTid) throws RemoteException {
  final int resolvedWindowId;
  IAccessibilityInteractionConnection connection=null;
synchronized (mLock) {
    final int resolvedUserId=mSecurityPolicy.resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.getCallingUserId());
    if (resolvedUserId != mCurrentUserId) {
      return false;
    }
    resolvedWindowId=resolveAccessibilityWindowIdLocked(accessibilityWindowId);
    final boolean permissionGranted=mSecurityPolicy.canGetAccessibilityNodeInfoLocked(this,resolvedWindowId);
    if (!permissionGranted) {
      return false;
    }
 else {
      connection=getConnectionLocked(resolvedWindowId);
      if (connection == null) {
        return false;
      }
    }
  }
  final int interrogatingPid=Binder.getCallingPid();
  final long identityToken=Binder.clearCallingIdentity();
  try {
    connection.performAccessibilityAction(accessibilityNodeId,action,arguments,interactionId,callback,mFetchFlags,interrogatingPid,interrogatingTid);
  }
 catch (  RemoteException re) {
    if (DEBUG) {
      Slog.e(LOG_TAG,"String_Node_Str");
    }
  }
 finally {
    Binder.restoreCallingIdentity(identityToken);
  }
  return true;
}
Program: 199260
Project: 199260
Buggy source:
/** 
 * Creates a new AccessibilityAction. For adding a standard action without a specific label, use the static constants. You can also override the description for one the standard actions. Below is an example how to override the standard click action by adding a custom label: <pre> AccessibilityAction action = new AccessibilityAction( AccessibilityAction.ACTION_ACTION_CLICK, getLocalizedLabel()); node.addAction(action); </pre>
 * @param actionId The id for this action. This should either be one of thestandard actions or a specific action for your app. In that case it is required to use a resource identifier.
 * @param label The label for the new AccessibilityAction.
 */
public AccessibilityAction(int actionId,@Nullable CharSequence label){
  if ((actionId & ACTION_TYPE_MASK) == 0 && Integer.bitCount(actionId) > 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if ((actionId & STANDARD_NON_LEGACY_ACTION_MASK) != 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mActionId=actionId;
  mLabel=label;
}

Fixed version (ground truth):
/** 
 * Creates a new AccessibilityAction. For adding a standard action without a specific label, use the static constants. You can also override the description for one the standard actions. Below is an example how to override the standard click action by adding a custom label: <pre> AccessibilityAction action = new AccessibilityAction( AccessibilityAction.ACTION_ACTION_CLICK, getLocalizedLabel()); node.addAction(action); </pre>
 * @param actionId The id for this action. This should either be one of thestandard actions or a specific action for your app. In that case it is required to use a resource identifier.
 * @param label The label for the new AccessibilityAction.
 */
public AccessibilityAction(int actionId,@Nullable CharSequence label){
  if ((actionId & ACTION_TYPE_MASK) == 0 && Integer.bitCount(actionId) != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mActionId=actionId;
  mLabel=label;
}
Program: 199261
Project: 199261
Buggy source:
@Override public boolean performAccessibilityAction(int accessibilityWindowId,long accessibilityNodeId,int action,Bundle arguments,int interactionId,IAccessibilityInteractionConnectionCallback callback,long interrogatingTid) throws RemoteException {
  final int resolvedWindowId;
  IAccessibilityInteractionConnection connection=null;
synchronized (mLock) {
    final int resolvedUserId=mSecurityPolicy.resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.getCallingUserId());
    if (resolvedUserId != mCurrentUserId) {
      return false;
    }
    resolvedWindowId=resolveAccessibilityWindowIdLocked(accessibilityWindowId);
    final boolean permissionGranted=mSecurityPolicy.canPerformActionLocked(this,resolvedWindowId,action,arguments);
    if (!permissionGranted) {
      return false;
    }
 else {
      connection=getConnectionLocked(resolvedWindowId);
      if (connection == null) {
        return false;
      }
    }
  }
  final int interrogatingPid=Binder.getCallingPid();
  final long identityToken=Binder.clearCallingIdentity();
  try {
    connection.performAccessibilityAction(accessibilityNodeId,action,arguments,interactionId,callback,mFetchFlags,interrogatingPid,interrogatingTid);
  }
 catch (  RemoteException re) {
    if (DEBUG) {
      Slog.e(LOG_TAG,"String_Node_Str");
    }
  }
 finally {
    Binder.restoreCallingIdentity(identityToken);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performAccessibilityAction(int accessibilityWindowId,long accessibilityNodeId,int action,Bundle arguments,int interactionId,IAccessibilityInteractionConnectionCallback callback,long interrogatingTid) throws RemoteException {
  final int resolvedWindowId;
  IAccessibilityInteractionConnection connection=null;
synchronized (mLock) {
    final int resolvedUserId=mSecurityPolicy.resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.getCallingUserId());
    if (resolvedUserId != mCurrentUserId) {
      return false;
    }
    resolvedWindowId=resolveAccessibilityWindowIdLocked(accessibilityWindowId);
    final boolean permissionGranted=mSecurityPolicy.canGetAccessibilityNodeInfoLocked(this,resolvedWindowId);
    if (!permissionGranted) {
      return false;
    }
 else {
      connection=getConnectionLocked(resolvedWindowId);
      if (connection == null) {
        return false;
      }
    }
  }
  final int interrogatingPid=Binder.getCallingPid();
  final long identityToken=Binder.clearCallingIdentity();
  try {
    connection.performAccessibilityAction(accessibilityNodeId,action,arguments,interactionId,callback,mFetchFlags,interrogatingPid,interrogatingTid);
  }
 catch (  RemoteException re) {
    if (DEBUG) {
      Slog.e(LOG_TAG,"String_Node_Str");
    }
  }
 finally {
    Binder.restoreCallingIdentity(identityToken);
  }
  return true;
}
Program: 199262
Project: 199262
Buggy source:
/** 
 * Creates a new AccessibilityAction. For adding a standard action without a specific label, use the static constants. You can also override the description for one the standard actions. Below is an example how to override the standard click action by adding a custom label: <pre> AccessibilityAction action = new AccessibilityAction( AccessibilityAction.ACTION_ACTION_CLICK, getLocalizedLabel()); node.addAction(action); </pre>
 * @param actionId The id for this action. This should either be one of thestandard actions or a specific action for your app. In that case it is required to use a resource identifier.
 * @param label The label for the new AccessibilityAction.
 */
public AccessibilityAction(int actionId,@Nullable CharSequence label){
  if ((actionId & ACTION_TYPE_MASK) == 0 && Integer.bitCount(actionId) > 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if ((actionId & STANDARD_NON_LEGACY_ACTION_MASK) != 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mActionId=actionId;
  mLabel=label;
}

Fixed version (ground truth):
/** 
 * Creates a new AccessibilityAction. For adding a standard action without a specific label, use the static constants. You can also override the description for one the standard actions. Below is an example how to override the standard click action by adding a custom label: <pre> AccessibilityAction action = new AccessibilityAction( AccessibilityAction.ACTION_ACTION_CLICK, getLocalizedLabel()); node.addAction(action); </pre>
 * @param actionId The id for this action. This should either be one of thestandard actions or a specific action for your app. In that case it is required to use a resource identifier.
 * @param label The label for the new AccessibilityAction.
 */
public AccessibilityAction(int actionId,@Nullable CharSequence label){
  if ((actionId & ACTION_TYPE_MASK) == 0 && Integer.bitCount(actionId) != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  mActionId=actionId;
  mLabel=label;
}
Program: 199263
Project: 199263
Buggy source:
@Override public boolean performAccessibilityAction(int accessibilityWindowId,long accessibilityNodeId,int action,Bundle arguments,int interactionId,IAccessibilityInteractionConnectionCallback callback,long interrogatingTid) throws RemoteException {
  final int resolvedWindowId;
  IAccessibilityInteractionConnection connection=null;
synchronized (mLock) {
    final int resolvedUserId=mSecurityPolicy.resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.getCallingUserId());
    if (resolvedUserId != mCurrentUserId) {
      return false;
    }
    resolvedWindowId=resolveAccessibilityWindowIdLocked(accessibilityWindowId);
    final boolean permissionGranted=mSecurityPolicy.canPerformActionLocked(this,resolvedWindowId,action,arguments);
    if (!permissionGranted) {
      return false;
    }
 else {
      connection=getConnectionLocked(resolvedWindowId);
      if (connection == null) {
        return false;
      }
    }
  }
  final int interrogatingPid=Binder.getCallingPid();
  final long identityToken=Binder.clearCallingIdentity();
  try {
    connection.performAccessibilityAction(accessibilityNodeId,action,arguments,interactionId,callback,mFetchFlags,interrogatingPid,interrogatingTid);
  }
 catch (  RemoteException re) {
    if (DEBUG) {
      Slog.e(LOG_TAG,"String_Node_Str");
    }
  }
 finally {
    Binder.restoreCallingIdentity(identityToken);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performAccessibilityAction(int accessibilityWindowId,long accessibilityNodeId,int action,Bundle arguments,int interactionId,IAccessibilityInteractionConnectionCallback callback,long interrogatingTid) throws RemoteException {
  final int resolvedWindowId;
  IAccessibilityInteractionConnection connection=null;
synchronized (mLock) {
    final int resolvedUserId=mSecurityPolicy.resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.getCallingUserId());
    if (resolvedUserId != mCurrentUserId) {
      return false;
    }
    resolvedWindowId=resolveAccessibilityWindowIdLocked(accessibilityWindowId);
    final boolean permissionGranted=mSecurityPolicy.canGetAccessibilityNodeInfoLocked(this,resolvedWindowId);
    if (!permissionGranted) {
      return false;
    }
 else {
      connection=getConnectionLocked(resolvedWindowId);
      if (connection == null) {
        return false;
      }
    }
  }
  final int interrogatingPid=Binder.getCallingPid();
  final long identityToken=Binder.clearCallingIdentity();
  try {
    connection.performAccessibilityAction(accessibilityNodeId,action,arguments,interactionId,callback,mFetchFlags,interrogatingPid,interrogatingTid);
  }
 catch (  RemoteException re) {
    if (DEBUG) {
      Slog.e(LOG_TAG,"String_Node_Str");
    }
  }
 finally {
    Binder.restoreCallingIdentity(identityToken);
  }
  return true;
}
Program: 199264
Project: 199264
Buggy source:
protected void verifyPasswordAndUnlock(){
  String entry=mPasswordEntry.getText().toString();
  if (mLockPatternUtils.checkPassword(entry)) {
    mCallback.reportUnlockAttempt(true);
    mCallback.dismiss(true);
  }
 else   if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) {
    mCallback.reportUnlockAttempt(false);
    int attempts=KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();
    if (0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
      long deadline=mLockPatternUtils.setLockoutAttemptDeadline();
      handleAttemptLockout(deadline);
    }
    mSecurityMessageDisplay.setMessage(getWrongPasswordStringId(),true);
  }
  mPasswordEntry.setText("String_Node_Str");
}

Fixed version (ground truth):
protected void verifyPasswordAndUnlock(){
  String entry=mPasswordEntry.getText().toString();
  if (mLockPatternUtils.checkPassword(entry)) {
    mCallback.reportUnlockAttempt(true);
    mCallback.dismiss(true);
  }
 else {
    if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) {
      mCallback.reportUnlockAttempt(false);
      int attempts=KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();
      if (0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
        long deadline=mLockPatternUtils.setLockoutAttemptDeadline();
        handleAttemptLockout(deadline);
      }
    }
    mSecurityMessageDisplay.setMessage(getWrongPasswordStringId(),true);
  }
  mPasswordEntry.setText("String_Node_Str");
}
Program: 199265
Project: 199265
Buggy source:
/** 
 * Fling the scroll view
 * @param velocityY The initial velocity in the Y direction. Positivenumbers mean that the finger/cursor is moving down the screen, which means we want to scroll towards the top.
 */
private void fling(int velocityY){
  if (getChildCount() > 0) {
    int height=(int)getLayoutHeight();
    int bottom=getContentHeight();
    float topAmount=getCurrentOverScrollAmount(true);
    float bottomAmount=getCurrentOverScrollAmount(false);
    if (velocityY < 0 && topAmount > 0) {
      mOwnScrollY-=(int)topAmount;
      setOverScrollAmount(0,true,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * RUBBER_BAND_FACTOR * mOverflingDistance + topAmount;
    }
 else     if (velocityY > 0 && bottomAmount > 0) {
      mOwnScrollY+=bottomAmount;
      setOverScrollAmount(0,false,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * RUBBER_BAND_FACTOR * mOverflingDistance + bottomAmount;
    }
 else {
      mMaxOverScroll=0.0f;
    }
    mScroller.fling(mScrollX,mOwnScrollY,1,velocityY,0,0,0,Math.max(0,bottom - height),0,height / 2);
    postInvalidateOnAnimation();
  }
}

Fixed version (ground truth):
/** 
 * Fling the scroll view
 * @param velocityY The initial velocity in the Y direction. Positivenumbers mean that the finger/cursor is moving down the screen, which means we want to scroll towards the top.
 */
private void fling(int velocityY){
  if (getChildCount() > 0) {
    int scrollRange=getScrollRange();
    float topAmount=getCurrentOverScrollAmount(true);
    float bottomAmount=getCurrentOverScrollAmount(false);
    if (velocityY < 0 && topAmount > 0) {
      mOwnScrollY-=(int)topAmount;
      setOverScrollAmount(0,true,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * RUBBER_BAND_FACTOR * mOverflingDistance + topAmount;
    }
 else     if (velocityY > 0 && bottomAmount > 0) {
      mOwnScrollY+=bottomAmount;
      setOverScrollAmount(0,false,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * RUBBER_BAND_FACTOR * mOverflingDistance + bottomAmount;
    }
 else {
      mMaxOverScroll=0.0f;
    }
    mScroller.fling(mScrollX,mOwnScrollY,1,velocityY,0,0,0,Math.max(0,scrollRange),0,Integer.MAX_VALUE / 2);
    postInvalidateOnAnimation();
  }
}
Program: 199266
Project: 199266
Buggy source:
/** 
 * Fling the scroll view
 * @param velocityY The initial velocity in the Y direction. Positivenumbers mean that the finger/cursor is moving down the screen, which means we want to scroll towards the top.
 */
private void fling(int velocityY){
  if (getChildCount() > 0) {
    int height=(int)getLayoutHeight();
    int bottom=getContentHeight();
    float topAmount=getCurrentOverScrollAmount(true);
    float bottomAmount=getCurrentOverScrollAmount(false);
    if (velocityY < 0 && topAmount > 0) {
      mOwnScrollY-=(int)topAmount;
      setOverScrollAmount(0,true,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * RUBBER_BAND_FACTOR * mOverflingDistance + topAmount;
    }
 else     if (velocityY > 0 && bottomAmount > 0) {
      mOwnScrollY+=bottomAmount;
      setOverScrollAmount(0,false,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * RUBBER_BAND_FACTOR * mOverflingDistance + bottomAmount;
    }
 else {
      mMaxOverScroll=0.0f;
    }
    mScroller.fling(mScrollX,mOwnScrollY,1,velocityY,0,0,0,Math.max(0,bottom - height),0,height / 2);
    postInvalidateOnAnimation();
  }
}

Fixed version (ground truth):
/** 
 * Fling the scroll view
 * @param velocityY The initial velocity in the Y direction. Positivenumbers mean that the finger/cursor is moving down the screen, which means we want to scroll towards the top.
 */
private void fling(int velocityY){
  if (getChildCount() > 0) {
    int scrollRange=getScrollRange();
    float topAmount=getCurrentOverScrollAmount(true);
    float bottomAmount=getCurrentOverScrollAmount(false);
    if (velocityY < 0 && topAmount > 0) {
      mOwnScrollY-=(int)topAmount;
      setOverScrollAmount(0,true,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * RUBBER_BAND_FACTOR * mOverflingDistance + topAmount;
    }
 else     if (velocityY > 0 && bottomAmount > 0) {
      mOwnScrollY+=bottomAmount;
      setOverScrollAmount(0,false,false);
      mMaxOverScroll=Math.abs(velocityY) / 1000f * RUBBER_BAND_FACTOR * mOverflingDistance + bottomAmount;
    }
 else {
      mMaxOverScroll=0.0f;
    }
    mScroller.fling(mScrollX,mOwnScrollY,1,velocityY,0,0,0,Math.max(0,scrollRange),0,Integer.MAX_VALUE / 2);
    postInvalidateOnAnimation();
  }
}
Program: 199267
Project: 199267
Buggy source:
protected void verifyPasswordAndUnlock(){
  String entry=mPasswordEntry.getText().toString();
  if (mLockPatternUtils.checkPassword(entry)) {
    mCallback.reportUnlockAttempt(true);
    mCallback.dismiss(true);
  }
 else   if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) {
    mCallback.reportUnlockAttempt(false);
    int attempts=KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();
    if (0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
      long deadline=mLockPatternUtils.setLockoutAttemptDeadline();
      handleAttemptLockout(deadline);
    }
    mSecurityMessageDisplay.setMessage(getWrongPasswordStringId(),true);
  }
  mPasswordEntry.setText("String_Node_Str");
}

Fixed version (ground truth):
protected void verifyPasswordAndUnlock(){
  String entry=mPasswordEntry.getText().toString();
  if (mLockPatternUtils.checkPassword(entry)) {
    mCallback.reportUnlockAttempt(true);
    mCallback.dismiss(true);
  }
 else {
    if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) {
      mCallback.reportUnlockAttempt(false);
      int attempts=KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();
      if (0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
        long deadline=mLockPatternUtils.setLockoutAttemptDeadline();
        handleAttemptLockout(deadline);
      }
    }
    mSecurityMessageDisplay.setMessage(getWrongPasswordStringId(),true);
  }
  mPasswordEntry.setText("String_Node_Str");
}
Program: 199268
Project: 199268
Buggy source:
/** 
 * Returns "true" if the UID belongs to a bound location provider.
 * @param uid the uid
 * @return true if uid belongs to a bound location provider
 */
private boolean isUidALocationProvider(int uid){
  if (uid == Process.SYSTEM_UID) {
    return true;
  }
  if (mGeocodeProvider != null) {
    if (doesPackageHaveUid(uid,mGeocodeProvider.getConnectedPackageName()))     return true;
  }
  for (  LocationProviderProxy proxy : mProxyProviders) {
    if (doesPackageHaveUid(uid,proxy.getConnectedPackageName()))     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns "true" if the UID belongs to a bound location provider.
 * @param uid the uid
 * @return true if uid belongs to a bound location provider
 */
private boolean isUidALocationProvider(int uid){
  if (uid == Process.SYSTEM_UID) {
    return true;
  }
  if (mGeocodeProvider != null) {
    if (doesUidHavePackage(uid,mGeocodeProvider.getConnectedPackageName()))     return true;
  }
  for (  LocationProviderProxy proxy : mProxyProviders) {
    if (doesUidHavePackage(uid,proxy.getConnectedPackageName()))     return true;
  }
  return false;
}
Program: 199269
Project: 199269
Buggy source:
/** 
 * Returns "true" if the UID belongs to a bound location provider.
 * @param uid the uid
 * @return true if uid belongs to a bound location provider
 */
private boolean isUidALocationProvider(int uid){
  if (uid == Process.SYSTEM_UID) {
    return true;
  }
  if (mGeocodeProvider != null) {
    if (doesPackageHaveUid(uid,mGeocodeProvider.getConnectedPackageName()))     return true;
  }
  for (  LocationProviderProxy proxy : mProxyProviders) {
    if (doesPackageHaveUid(uid,proxy.getConnectedPackageName()))     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns "true" if the UID belongs to a bound location provider.
 * @param uid the uid
 * @return true if uid belongs to a bound location provider
 */
private boolean isUidALocationProvider(int uid){
  if (uid == Process.SYSTEM_UID) {
    return true;
  }
  if (mGeocodeProvider != null) {
    if (doesUidHavePackage(uid,mGeocodeProvider.getConnectedPackageName()))     return true;
  }
  for (  LocationProviderProxy proxy : mProxyProviders) {
    if (doesUidHavePackage(uid,proxy.getConnectedPackageName()))     return true;
  }
  return false;
}
Program: 199270
Project: 199270
Buggy source:
public void updatePowerState(DisplayManagerInternal.DisplayPowerRequest request){
  if (setScreenAutoBrightnessAdjustment(request.screenAutoBrightnessAdjustment) || setLightSensorEnabled(request.wantLightSensorEnabled())) {
    updateAutoBrightness(false);
  }
}

Fixed version (ground truth):
public void updatePowerState(DisplayManagerInternal.DisplayPowerRequest request){
  if (setScreenAutoBrightnessAdjustment(request.screenAutoBrightnessAdjustment) | setLightSensorEnabled(request.wantLightSensorEnabled())) {
    updateAutoBrightness(false);
  }
}
Program: 199272
Project: 199272
Buggy source:
public void updatePowerState(DisplayManagerInternal.DisplayPowerRequest request){
  if (setScreenAutoBrightnessAdjustment(request.screenAutoBrightnessAdjustment) || setLightSensorEnabled(request.wantLightSensorEnabled())) {
    updateAutoBrightness(false);
  }
}

Fixed version (ground truth):
public void updatePowerState(DisplayManagerInternal.DisplayPowerRequest request){
  if (setScreenAutoBrightnessAdjustment(request.screenAutoBrightnessAdjustment) | setLightSensorEnabled(request.wantLightSensorEnabled())) {
    updateAutoBrightness(false);
  }
}
Program: 199278
Project: 199278
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199279
Project: 199279
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199280
Project: 199280
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199282
Project: 199282
Buggy source:
/** 
 * Callback method to be invoked while the list view or grid view is being scrolled. If the view is being scrolled, this method will be called before the next frame of the scroll is rendered. In particular, it will be called before any calls to  {@link Adapter#getView(int,View,ViewGroup)}.
 * @param view The view whose scroll state is being reported
 * @param scrollState The current scroll state. One of {@link #SCROLL_STATE_TOUCH_SCROLL} or {@link #SCROLL_STATE_IDLE}.
 */
public void onScrollStateChanged(AbsListView view,int scrollState);

Fixed version (ground truth):
/** 
 * Callback method to be invoked while the list view or grid view is being scrolled. If the view is being scrolled, this method will be called before the next frame of the scroll is rendered. In particular, it will be called before any calls to  {@link Adapter#getView(int,View,ViewGroup)}.
 * @param view The view whose scroll state is being reported
 * @param scrollState The current scroll state. One of{@link #SCROLL_STATE_TOUCH_SCROLL} or {@link #SCROLL_STATE_IDLE}.
 */
public void onScrollStateChanged(AbsListView view,int scrollState);
Program: 199284
Project: 199284
Buggy source:
/** 
 * Callback method to be invoked while the list view or grid view is being scrolled. If the view is being scrolled, this method will be called before the next frame of the scroll is rendered. In particular, it will be called before any calls to  {@link Adapter#getView(int,View,ViewGroup)}.
 * @param view The view whose scroll state is being reported
 * @param scrollState The current scroll state. One of {@link #SCROLL_STATE_TOUCH_SCROLL} or {@link #SCROLL_STATE_IDLE}.
 */
public void onScrollStateChanged(AbsListView view,int scrollState);

Fixed version (ground truth):
/** 
 * Callback method to be invoked while the list view or grid view is being scrolled. If the view is being scrolled, this method will be called before the next frame of the scroll is rendered. In particular, it will be called before any calls to  {@link Adapter#getView(int,View,ViewGroup)}.
 * @param view The view whose scroll state is being reported
 * @param scrollState The current scroll state. One of{@link #SCROLL_STATE_TOUCH_SCROLL} or {@link #SCROLL_STATE_IDLE}.
 */
public void onScrollStateChanged(AbsListView view,int scrollState);
Program: 199286
Project: 199286
Buggy source:
/** 
 * Callback method to be invoked while the list view or grid view is being scrolled. If the view is being scrolled, this method will be called before the next frame of the scroll is rendered. In particular, it will be called before any calls to  {@link Adapter#getView(int,View,ViewGroup)}.
 * @param view The view whose scroll state is being reported
 * @param scrollState The current scroll state. One of {@link #SCROLL_STATE_TOUCH_SCROLL} or {@link #SCROLL_STATE_IDLE}.
 */
public void onScrollStateChanged(AbsListView view,int scrollState);

Fixed version (ground truth):
/** 
 * Callback method to be invoked while the list view or grid view is being scrolled. If the view is being scrolled, this method will be called before the next frame of the scroll is rendered. In particular, it will be called before any calls to  {@link Adapter#getView(int,View,ViewGroup)}.
 * @param view The view whose scroll state is being reported
 * @param scrollState The current scroll state. One of{@link #SCROLL_STATE_TOUCH_SCROLL} or {@link #SCROLL_STATE_IDLE}.
 */
public void onScrollStateChanged(AbsListView view,int scrollState);
Program: 199287
Project: 199287
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199296
Project: 199296
Buggy source:
public int getActionBarHideOffset(){
  return -((int)mActionBarTop.getTranslationY());
}

Fixed version (ground truth):
public int getActionBarHideOffset(){
  return mActionBarTop != null ? -((int)mActionBarTop.getTranslationY()) : 0;
}
Program: 199298
Project: 199298
Buggy source:
public int getActionBarHideOffset(){
  return -((int)mActionBarTop.getTranslationY());
}

Fixed version (ground truth):
public int getActionBarHideOffset(){
  return mActionBarTop != null ? -((int)mActionBarTop.getTranslationY()) : 0;
}
Program: 199299
Project: 199299
Buggy source:
public int getActionBarHideOffset(){
  return -((int)mActionBarTop.getTranslationY());
}

Fixed version (ground truth):
public int getActionBarHideOffset(){
  return mActionBarTop != null ? -((int)mActionBarTop.getTranslationY()) : 0;
}
Program: 199300
Project: 199300
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199301
Project: 199301
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199302
Project: 199302
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199303
Project: 199303
Buggy source:
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.width(),loc.height(),bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}

Fixed version (ground truth):
@LayoutlibDelegate static void nativeDraw(int canvas_instance,Rect loc,int bitmap_instance,byte[] c,int paint_instance_or_null,int destDensity,int srcDensity){
  draw(canvas_instance,loc.left,loc.top,loc.right,loc.bottom,bitmap_instance,c,paint_instance_or_null,destDensity,srcDensity);
}
Program: 199304
Project: 199304
Buggy source:
@Override protected void onViewRemoved(View child){
  super.onViewRemoved(child);
  ((ExpandableView)child).setOnHeightChangedListener(null);
  mCurrentStackScrollState.removeViewStateForView(child);
  mStackScrollAlgorithm.notifyChildrenChanged(this);
  updateScrollStateForRemovedChild(child);
  if (mIsExpanded) {
    mChildrenToRemoveAnimated.add(child);
    mChildHierarchyDirty=true;
  }
}

Fixed version (ground truth):
@Override protected void onViewRemoved(View child){
  super.onViewRemoved(child);
  ((ExpandableView)child).setOnHeightChangedListener(null);
  mCurrentStackScrollState.removeViewStateForView(child);
  mStackScrollAlgorithm.notifyChildrenChanged(this);
  updateScrollStateForRemovedChild(child);
  if (mIsExpanded) {
    if (!mChildrenToAddAnimated.contains(child)) {
      mChildrenToRemoveAnimated.add(child);
      mChildHierarchyDirty=true;
    }
 else {
      mChildrenToAddAnimated.remove(child);
    }
  }
}
Program: 199305
Project: 199305
Buggy source:
/** 
 * Updates the children views according to the stack scroll algorithm. Call this whenever modifications to   {@link #mOwnScrollY} are performed to reflect it in the view layout.
 */
private void updateChildren(){
  mCurrentStackScrollState.setScrollY(mOwnScrollY);
  mStackScrollAlgorithm.getStackScrollState(mCurrentStackScrollState);
  if (!isCurrentlyAnimating() && !mChildHierarchyDirty) {
    applyCurrentState();
    if (mListener != null) {
      mListener.onChildLocationsChanged(this);
    }
  }
 else {
    startAnimationToState(mCurrentStackScrollState);
  }
}

Fixed version (ground truth):
/** 
 * Updates the children views according to the stack scroll algorithm. Call this whenever modifications to   {@link #mOwnScrollY} are performed to reflect it in the view layout.
 */
private void updateChildren(){
  mCurrentStackScrollState.setScrollY(mOwnScrollY);
  mStackScrollAlgorithm.getStackScrollState(mCurrentStackScrollState);
  if (!isCurrentlyAnimating() && !mChildHierarchyDirty) {
    applyCurrentState();
  }
 else {
    startAnimationToState();
  }
}
Program: 199306
Project: 199306
Buggy source:
private void startAnimationToState(StackScrollState finalState){
  if (mChildHierarchyDirty) {
    generateChildHierarchyEvents();
    mChildHierarchyDirty=false;
  }
  mStateAnimator.startAnimationForEvents(mAnimationEvents,finalState);
}

Fixed version (ground truth):
private void startAnimationToState(){
  if (mChildHierarchyDirty) {
    generateChildHierarchyEvents();
    mChildHierarchyDirty=false;
  }
  if (!mAnimationEvents.isEmpty()) {
    mStateAnimator.startAnimationForEvents(mAnimationEvents,mCurrentStackScrollState);
  }
 else {
    applyCurrentState();
  }
}
Program: 199307
Project: 199307
Buggy source:
private void applyCurrentState(){
  mListenForHeightChanges=false;
  mCurrentStackScrollState.apply();
  mListenForHeightChanges=true;
}

Fixed version (ground truth):
private void applyCurrentState(){
  mListenForHeightChanges=false;
  mCurrentStackScrollState.apply();
  mListenForHeightChanges=true;
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
}
Program: 199308
Project: 199308
Buggy source:
public void onChildAnimationFinished(){
  applyCurrentState();
  mAnimationEvents.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  updateChildren();
  mAnimationEvents.clear();
}
Program: 199309
Project: 199309
Buggy source:
public void onChildAnimationFinished(){
  applyCurrentState();
  mAnimationEvents.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  updateChildren();
  mAnimationEvents.clear();
}
Program: 199310
Project: 199310
Buggy source:
@Override protected void onViewRemoved(View child){
  super.onViewRemoved(child);
  ((ExpandableView)child).setOnHeightChangedListener(null);
  mCurrentStackScrollState.removeViewStateForView(child);
  mStackScrollAlgorithm.notifyChildrenChanged(this);
  updateScrollStateForRemovedChild(child);
  if (mIsExpanded) {
    mChildrenToRemoveAnimated.add(child);
    mChildHierarchyDirty=true;
  }
}

Fixed version (ground truth):
@Override protected void onViewRemoved(View child){
  super.onViewRemoved(child);
  ((ExpandableView)child).setOnHeightChangedListener(null);
  mCurrentStackScrollState.removeViewStateForView(child);
  mStackScrollAlgorithm.notifyChildrenChanged(this);
  updateScrollStateForRemovedChild(child);
  if (mIsExpanded) {
    if (!mChildrenToAddAnimated.contains(child)) {
      mChildrenToRemoveAnimated.add(child);
      mChildHierarchyDirty=true;
    }
 else {
      mChildrenToAddAnimated.remove(child);
    }
  }
}
Program: 199311
Project: 199311
Buggy source:
/** 
 * Updates the children views according to the stack scroll algorithm. Call this whenever modifications to   {@link #mOwnScrollY} are performed to reflect it in the view layout.
 */
private void updateChildren(){
  mCurrentStackScrollState.setScrollY(mOwnScrollY);
  mStackScrollAlgorithm.getStackScrollState(mCurrentStackScrollState);
  if (!isCurrentlyAnimating() && !mChildHierarchyDirty) {
    applyCurrentState();
    if (mListener != null) {
      mListener.onChildLocationsChanged(this);
    }
  }
 else {
    startAnimationToState(mCurrentStackScrollState);
  }
}

Fixed version (ground truth):
/** 
 * Updates the children views according to the stack scroll algorithm. Call this whenever modifications to   {@link #mOwnScrollY} are performed to reflect it in the view layout.
 */
private void updateChildren(){
  mCurrentStackScrollState.setScrollY(mOwnScrollY);
  mStackScrollAlgorithm.getStackScrollState(mCurrentStackScrollState);
  if (!isCurrentlyAnimating() && !mChildHierarchyDirty) {
    applyCurrentState();
  }
 else {
    startAnimationToState();
  }
}
Program: 199312
Project: 199312
Buggy source:
private void startAnimationToState(StackScrollState finalState){
  if (mChildHierarchyDirty) {
    generateChildHierarchyEvents();
    mChildHierarchyDirty=false;
  }
  mStateAnimator.startAnimationForEvents(mAnimationEvents,finalState);
}

Fixed version (ground truth):
private void startAnimationToState(){
  if (mChildHierarchyDirty) {
    generateChildHierarchyEvents();
    mChildHierarchyDirty=false;
  }
  if (!mAnimationEvents.isEmpty()) {
    mStateAnimator.startAnimationForEvents(mAnimationEvents,mCurrentStackScrollState);
  }
 else {
    applyCurrentState();
  }
}
Program: 199313
Project: 199313
Buggy source:
private void applyCurrentState(){
  mListenForHeightChanges=false;
  mCurrentStackScrollState.apply();
  mListenForHeightChanges=true;
}

Fixed version (ground truth):
private void applyCurrentState(){
  mListenForHeightChanges=false;
  mCurrentStackScrollState.apply();
  mListenForHeightChanges=true;
  if (mListener != null) {
    mListener.onChildLocationsChanged(this);
  }
}
Program: 199314
Project: 199314
Buggy source:
public void onChildAnimationFinished(){
  applyCurrentState();
  mAnimationEvents.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  updateChildren();
  mAnimationEvents.clear();
}
Program: 199315
Project: 199315
Buggy source:
public void onChildAnimationFinished(){
  applyCurrentState();
  mAnimationEvents.clear();
}

Fixed version (ground truth):
public void onChildAnimationFinished(){
  updateChildren();
  mAnimationEvents.clear();
}
Program: 199316
Project: 199316
Buggy source:
private int getScrollRange(){
  int scrollRange=0;
  ExpandableView firstChild=(ExpandableView)getFirstChildNotGone();
  if (firstChild != null) {
    int contentHeight=getContentHeight();
    int firstChildMaxExpandHeight=getMaxExpandHeight(firstChild);
    scrollRange=Math.max(0,contentHeight - mMaxLayoutHeight + mBottomStackPeekSize);
    if (scrollRange > 0 && getChildCount() > 0) {
      scrollRange=Math.max(scrollRange,firstChildMaxExpandHeight - mCollapsedSize);
    }
  }
  return scrollRange;
}

Fixed version (ground truth):
private int getScrollRange(){
  int scrollRange=0;
  ExpandableView firstChild=(ExpandableView)getFirstChildNotGone();
  if (firstChild != null) {
    int contentHeight=getContentHeight();
    int firstChildMaxExpandHeight=getMaxExpandHeight(firstChild);
    scrollRange=Math.max(0,contentHeight - mMaxLayoutHeight + mBottomStackPeekSize);
    if (scrollRange > 0) {
      View lastChild=getLastChildNotGone();
      if (isViewExpanded(lastChild)) {
        scrollRange+=mCollapsedSize + mPaddingBetweenElements;
      }
      scrollRange=Math.max(scrollRange,firstChildMaxExpandHeight - mCollapsedSize);
    }
  }
  return scrollRange;
}
Program: 199317
Project: 199317
Buggy source:
public int getEmptyBottomMargin(){
  return Math.max(getHeight() - mContentHeight,0);
}

Fixed version (ground truth):
public int getEmptyBottomMargin(){
  int emptyMargin=mMaxLayoutHeight - mContentHeight;
  if (needsHeightAdaption()) {
    emptyMargin=emptyMargin - mCollapsedSize - mBottomStackPeekSize;
  }
  return Math.max(emptyMargin,0);
}
Program: 199319
Project: 199319
Buggy source:
private int getScrollRange(){
  int scrollRange=0;
  ExpandableView firstChild=(ExpandableView)getFirstChildNotGone();
  if (firstChild != null) {
    int contentHeight=getContentHeight();
    int firstChildMaxExpandHeight=getMaxExpandHeight(firstChild);
    scrollRange=Math.max(0,contentHeight - mMaxLayoutHeight + mBottomStackPeekSize);
    if (scrollRange > 0 && getChildCount() > 0) {
      scrollRange=Math.max(scrollRange,firstChildMaxExpandHeight - mCollapsedSize);
    }
  }
  return scrollRange;
}

Fixed version (ground truth):
private int getScrollRange(){
  int scrollRange=0;
  ExpandableView firstChild=(ExpandableView)getFirstChildNotGone();
  if (firstChild != null) {
    int contentHeight=getContentHeight();
    int firstChildMaxExpandHeight=getMaxExpandHeight(firstChild);
    scrollRange=Math.max(0,contentHeight - mMaxLayoutHeight + mBottomStackPeekSize);
    if (scrollRange > 0) {
      View lastChild=getLastChildNotGone();
      if (isViewExpanded(lastChild)) {
        scrollRange+=mCollapsedSize + mPaddingBetweenElements;
      }
      scrollRange=Math.max(scrollRange,firstChildMaxExpandHeight - mCollapsedSize);
    }
  }
  return scrollRange;
}
Program: 199320
Project: 199320
Buggy source:
public int getEmptyBottomMargin(){
  return Math.max(getHeight() - mContentHeight,0);
}

Fixed version (ground truth):
public int getEmptyBottomMargin(){
  int emptyMargin=mMaxLayoutHeight - mContentHeight;
  if (needsHeightAdaption()) {
    emptyMargin=emptyMargin - mCollapsedSize - mBottomStackPeekSize;
  }
  return Math.max(emptyMargin,0);
}