nus-yam/ex-repair huggingface dataset:
Program: 198503
Project: 198503
Buggy source:
@ServiceThreadOnly void doManualPortSwitching(int portId,IHdmiControlCallback callback){
  assertRunOnServiceThread();
  if (!mService.isValidPortId(portId)) {
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  if (portId == getActivePortId()) {
    invokeCallback(callback,HdmiControlManager.RESULT_SUCCESS);
    return;
  }
  mActiveSource.invalidate();
  if (!mService.isControlEnabled()) {
    setActivePortId(portId);
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  int oldPath=mService.portIdToPath(getActivePortId());
  int newPath=mService.portIdToPath(portId);
  HdmiCecMessage routingChange=HdmiCecMessageBuilder.buildRoutingChange(mAddress,oldPath,newPath);
  mService.sendCecCommand(routingChange);
  removeAction(RoutingControlAction.class);
  addAndStartAction(new RoutingControlAction(this,newPath,false,callback));
}

Fixed version (ground truth):
@ServiceThreadOnly void doManualPortSwitching(int portId,IHdmiControlCallback callback){
  assertRunOnServiceThread();
  if (!mService.isValidPortId(portId)) {
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  if (portId == getActivePortId()) {
    invokeCallback(callback,HdmiControlManager.RESULT_SUCCESS);
    return;
  }
  mActiveSource.invalidate();
  if (!mService.isControlEnabled()) {
    setActivePortId(portId);
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  int oldPath=getActivePortId() != Constants.INVALID_PORT_ID ? mService.portIdToPath(getActivePortId()) : getDeviceInfo().getPhysicalAddress();
  int newPath=mService.portIdToPath(portId);
  HdmiCecMessage routingChange=HdmiCecMessageBuilder.buildRoutingChange(mAddress,oldPath,newPath);
  mService.sendCecCommand(routingChange);
  removeAction(RoutingControlAction.class);
  addAndStartAction(new RoutingControlAction(this,newPath,false,callback));
}
Program: 198504
Project: 198504
Buggy source:
/** 
 * Sends key to a target CEC device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
@Override @ServiceThreadOnly protected void sendKeyEvent(int keyCode,boolean isPressed){
  assertRunOnServiceThread();
  List<SendKeyAction> action=getActions(SendKeyAction.class);
  if (!action.isEmpty()) {
    action.get(0).processKeyEvent(keyCode,isPressed);
  }
 else {
    if (isPressed) {
      int logicalAddress=getActiveSource().logicalAddress;
      addAndStartAction(new SendKeyAction(this,logicalAddress,keyCode));
    }
 else {
      Slog.w(TAG,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Sends key to a target CEC device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
@Override @ServiceThreadOnly protected void sendKeyEvent(int keyCode,boolean isPressed){
  assertRunOnServiceThread();
  List<SendKeyAction> action=getActions(SendKeyAction.class);
  if (!action.isEmpty()) {
    action.get(0).processKeyEvent(keyCode,isPressed);
  }
 else {
    if (isPressed && getActiveSource().isValid()) {
      int logicalAddress=getActiveSource().logicalAddress;
      addAndStartAction(new SendKeyAction(this,logicalAddress,keyCode));
    }
 else {
      Slog.w(TAG,"String_Node_Str" + keyCode + "String_Node_Str"+ isPressed);
    }
  }
}
Program: 198505
Project: 198505
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  mKeyguardStatusView.setPivotX(getWidth() / 2);
  mKeyguardStatusView.setPivotY((FONT_HEIGHT - CAP_HEIGHT) / 2048f * mClockView.getTextSize());
  mQsMinExpansionHeight=mKeyguardShowing ? 0 : mHeader.getCollapsedHeight() + mQsPeekHeight;
  mQsMaxExpansionHeight=mHeader.getExpandedHeight() + mQsContainer.getHeight();
  if (mQsExpanded) {
    if (mQsFullyExpanded) {
      mQsExpansionHeight=mQsMaxExpansionHeight;
      requestScrollerTopPaddingUpdate(false);
    }
  }
 else {
    if (!mStackScrollerOverscrolling) {
      setQsExpansion(mQsMinExpansionHeight);
    }
    positionClockAndNotifications();
    mNotificationStackScroller.setStackHeight(getExpandedHeight());
  }
}

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);
  mKeyguardStatusView.setPivotX(getWidth() / 2);
  mKeyguardStatusView.setPivotY((FONT_HEIGHT - CAP_HEIGHT) / 2048f * mClockView.getTextSize());
  mQsMinExpansionHeight=mKeyguardShowing ? 0 : mHeader.getCollapsedHeight() + mQsPeekHeight;
  mQsMaxExpansionHeight=mHeader.getExpandedHeight() + mQsContainer.getHeight();
  if (mQsExpanded) {
    if (mQsFullyExpanded) {
      mQsExpansionHeight=mQsMaxExpansionHeight;
      requestScrollerTopPaddingUpdate(false);
    }
  }
 else {
    if (!mStackScrollerOverscrolling) {
      setQsExpansion(mQsMinExpansionHeight);
    }
    positionClockAndNotifications();
    mNotificationStackScroller.setStackHeight(getExpandedHeight());
  }
  mNotificationStackScroller.updateIsSmallScreen(mHeader.getCollapsedHeight() + mQsPeekHeight);
}
Program: 198507
Project: 198507
Buggy source:
private void updateStateForChildTransitioningInBottom(StackScrollAlgorithmState algorithmState,float transitioningPositionStart,float bottomPeakStart,float currentYPosition,StackScrollState.ViewState childViewState,int childHeight){
  algorithmState.partialInBottom=1.0f - ((transitioningPositionStart - currentYPosition) / (childHeight + mPaddingBetweenElements));
  float offset=mBottomStackIndentationFunctor.getValue(algorithmState.partialInBottom);
  algorithmState.itemsInBottomStack+=algorithmState.partialInBottom;
  childViewState.yTranslation=transitioningPositionStart + offset - childHeight - mPaddingBetweenElements;
  clampPositionToTopStackEnd(childViewState,childHeight);
  childViewState.location=StackScrollState.ViewState.LOCATION_MAIN_AREA;
}

Fixed version (ground truth):
private void updateStateForChildTransitioningInBottom(StackScrollAlgorithmState algorithmState,float transitioningPositionStart,float bottomPeakStart,float currentYPosition,StackScrollState.ViewState childViewState,int childHeight){
  algorithmState.partialInBottom=1.0f - ((transitioningPositionStart - currentYPosition) / (childHeight + mPaddingBetweenElements));
  float offset=mBottomStackIndentationFunctor.getValue(algorithmState.partialInBottom);
  algorithmState.itemsInBottomStack+=algorithmState.partialInBottom;
  int newHeight=childHeight;
  if (childHeight > mCollapsedSize && mIsSmallScreen) {
    newHeight=(int)Math.max(Math.min(transitioningPositionStart + offset - mPaddingBetweenElements - currentYPosition,childHeight),mCollapsedSize);
    childViewState.height=newHeight;
  }
  childViewState.yTranslation=transitioningPositionStart + offset - newHeight - mPaddingBetweenElements;
  clampPositionToTopStackEnd(childViewState,newHeight);
  childViewState.location=StackScrollState.ViewState.LOCATION_MAIN_AREA;
}
Program: 198508
Project: 198508
Buggy source:
private void initConstants(Context context){
  mPaddingBetweenElementsDimmed=context.getResources().getDimensionPixelSize(R.dimen.notification_padding_dimmed);
  mPaddingBetweenElementsNormal=context.getResources().getDimensionPixelSize(R.dimen.notification_padding);
  mCollapsedSize=context.getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mTopStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.top_stack_peek_amount);
  mBottomStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
  mZDistanceBetweenElements=context.getResources().getDimensionPixelSize(R.dimen.z_distance_between_notifications);
  mZBasicHeight=(MAX_ITEMS_IN_BOTTOM_STACK + 1) * mZDistanceBetweenElements;
  mBottomStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_slow_down_length);
  mTopStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.top_stack_slow_down_length);
  mRoundedRectCornerRadius=context.getResources().getDimensionPixelSize(R.dimen.notification_material_rounded_rect_radius);
  mCollapseSecondCardPadding=context.getResources().getDimensionPixelSize(R.dimen.notification_collapse_second_card_padding);
}

Fixed version (ground truth):
private void initConstants(Context context){
  mPaddingBetweenElementsDimmed=context.getResources().getDimensionPixelSize(R.dimen.notification_padding_dimmed);
  mPaddingBetweenElementsNormal=context.getResources().getDimensionPixelSize(R.dimen.notification_padding);
  mCollapsedSize=context.getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mMaxNotificationHeight=context.getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mTopStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.top_stack_peek_amount);
  mBottomStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
  mZDistanceBetweenElements=context.getResources().getDimensionPixelSize(R.dimen.z_distance_between_notifications);
  mZBasicHeight=(MAX_ITEMS_IN_BOTTOM_STACK + 1) * mZDistanceBetweenElements;
  mBottomStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_slow_down_length);
  mTopStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.top_stack_slow_down_length);
  mRoundedRectCornerRadius=context.getResources().getDimensionPixelSize(R.dimen.notification_material_rounded_rect_radius);
  mCollapseSecondCardPadding=context.getResources().getDimensionPixelSize(R.dimen.notification_collapse_second_card_padding);
}
Program: 198509
Project: 198509
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  mKeyguardStatusView.setPivotX(getWidth() / 2);
  mKeyguardStatusView.setPivotY((FONT_HEIGHT - CAP_HEIGHT) / 2048f * mClockView.getTextSize());
  mQsMinExpansionHeight=mKeyguardShowing ? 0 : mHeader.getCollapsedHeight() + mQsPeekHeight;
  mQsMaxExpansionHeight=mHeader.getExpandedHeight() + mQsContainer.getHeight();
  if (mQsExpanded) {
    if (mQsFullyExpanded) {
      mQsExpansionHeight=mQsMaxExpansionHeight;
      requestScrollerTopPaddingUpdate(false);
    }
  }
 else {
    if (!mStackScrollerOverscrolling) {
      setQsExpansion(mQsMinExpansionHeight);
    }
    positionClockAndNotifications();
    mNotificationStackScroller.setStackHeight(getExpandedHeight());
  }
}

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);
  mKeyguardStatusView.setPivotX(getWidth() / 2);
  mKeyguardStatusView.setPivotY((FONT_HEIGHT - CAP_HEIGHT) / 2048f * mClockView.getTextSize());
  mQsMinExpansionHeight=mKeyguardShowing ? 0 : mHeader.getCollapsedHeight() + mQsPeekHeight;
  mQsMaxExpansionHeight=mHeader.getExpandedHeight() + mQsContainer.getHeight();
  if (mQsExpanded) {
    if (mQsFullyExpanded) {
      mQsExpansionHeight=mQsMaxExpansionHeight;
      requestScrollerTopPaddingUpdate(false);
    }
  }
 else {
    if (!mStackScrollerOverscrolling) {
      setQsExpansion(mQsMinExpansionHeight);
    }
    positionClockAndNotifications();
    mNotificationStackScroller.setStackHeight(getExpandedHeight());
  }
  mNotificationStackScroller.updateIsSmallScreen(mHeader.getCollapsedHeight() + mQsPeekHeight);
}
Program: 198511
Project: 198511
Buggy source:
private void updateStateForChildTransitioningInBottom(StackScrollAlgorithmState algorithmState,float transitioningPositionStart,float bottomPeakStart,float currentYPosition,StackScrollState.ViewState childViewState,int childHeight){
  algorithmState.partialInBottom=1.0f - ((transitioningPositionStart - currentYPosition) / (childHeight + mPaddingBetweenElements));
  float offset=mBottomStackIndentationFunctor.getValue(algorithmState.partialInBottom);
  algorithmState.itemsInBottomStack+=algorithmState.partialInBottom;
  childViewState.yTranslation=transitioningPositionStart + offset - childHeight - mPaddingBetweenElements;
  clampPositionToTopStackEnd(childViewState,childHeight);
  childViewState.location=StackScrollState.ViewState.LOCATION_MAIN_AREA;
}

Fixed version (ground truth):
private void updateStateForChildTransitioningInBottom(StackScrollAlgorithmState algorithmState,float transitioningPositionStart,float bottomPeakStart,float currentYPosition,StackScrollState.ViewState childViewState,int childHeight){
  algorithmState.partialInBottom=1.0f - ((transitioningPositionStart - currentYPosition) / (childHeight + mPaddingBetweenElements));
  float offset=mBottomStackIndentationFunctor.getValue(algorithmState.partialInBottom);
  algorithmState.itemsInBottomStack+=algorithmState.partialInBottom;
  int newHeight=childHeight;
  if (childHeight > mCollapsedSize && mIsSmallScreen) {
    newHeight=(int)Math.max(Math.min(transitioningPositionStart + offset - mPaddingBetweenElements - currentYPosition,childHeight),mCollapsedSize);
    childViewState.height=newHeight;
  }
  childViewState.yTranslation=transitioningPositionStart + offset - newHeight - mPaddingBetweenElements;
  clampPositionToTopStackEnd(childViewState,newHeight);
  childViewState.location=StackScrollState.ViewState.LOCATION_MAIN_AREA;
}
Program: 198512
Project: 198512
Buggy source:
private void initConstants(Context context){
  mPaddingBetweenElementsDimmed=context.getResources().getDimensionPixelSize(R.dimen.notification_padding_dimmed);
  mPaddingBetweenElementsNormal=context.getResources().getDimensionPixelSize(R.dimen.notification_padding);
  mCollapsedSize=context.getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mTopStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.top_stack_peek_amount);
  mBottomStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
  mZDistanceBetweenElements=context.getResources().getDimensionPixelSize(R.dimen.z_distance_between_notifications);
  mZBasicHeight=(MAX_ITEMS_IN_BOTTOM_STACK + 1) * mZDistanceBetweenElements;
  mBottomStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_slow_down_length);
  mTopStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.top_stack_slow_down_length);
  mRoundedRectCornerRadius=context.getResources().getDimensionPixelSize(R.dimen.notification_material_rounded_rect_radius);
  mCollapseSecondCardPadding=context.getResources().getDimensionPixelSize(R.dimen.notification_collapse_second_card_padding);
}

Fixed version (ground truth):
private void initConstants(Context context){
  mPaddingBetweenElementsDimmed=context.getResources().getDimensionPixelSize(R.dimen.notification_padding_dimmed);
  mPaddingBetweenElementsNormal=context.getResources().getDimensionPixelSize(R.dimen.notification_padding);
  mCollapsedSize=context.getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mMaxNotificationHeight=context.getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mTopStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.top_stack_peek_amount);
  mBottomStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
  mZDistanceBetweenElements=context.getResources().getDimensionPixelSize(R.dimen.z_distance_between_notifications);
  mZBasicHeight=(MAX_ITEMS_IN_BOTTOM_STACK + 1) * mZDistanceBetweenElements;
  mBottomStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_slow_down_length);
  mTopStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.top_stack_slow_down_length);
  mRoundedRectCornerRadius=context.getResources().getDimensionPixelSize(R.dimen.notification_material_rounded_rect_radius);
  mCollapseSecondCardPadding=context.getResources().getDimensionPixelSize(R.dimen.notification_collapse_second_card_padding);
}
Program: 198513
Project: 198513
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  mKeyguardStatusView.setPivotX(getWidth() / 2);
  mKeyguardStatusView.setPivotY((FONT_HEIGHT - CAP_HEIGHT) / 2048f * mClockView.getTextSize());
  mQsMinExpansionHeight=mKeyguardShowing ? 0 : mHeader.getCollapsedHeight() + mQsPeekHeight;
  mQsMaxExpansionHeight=mHeader.getExpandedHeight() + mQsContainer.getHeight();
  if (mQsExpanded) {
    if (mQsFullyExpanded) {
      mQsExpansionHeight=mQsMaxExpansionHeight;
      requestScrollerTopPaddingUpdate(false);
    }
  }
 else {
    if (!mStackScrollerOverscrolling) {
      setQsExpansion(mQsMinExpansionHeight);
    }
    positionClockAndNotifications();
    mNotificationStackScroller.setStackHeight(getExpandedHeight());
  }
}

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);
  mKeyguardStatusView.setPivotX(getWidth() / 2);
  mKeyguardStatusView.setPivotY((FONT_HEIGHT - CAP_HEIGHT) / 2048f * mClockView.getTextSize());
  mQsMinExpansionHeight=mKeyguardShowing ? 0 : mHeader.getCollapsedHeight() + mQsPeekHeight;
  mQsMaxExpansionHeight=mHeader.getExpandedHeight() + mQsContainer.getHeight();
  if (mQsExpanded) {
    if (mQsFullyExpanded) {
      mQsExpansionHeight=mQsMaxExpansionHeight;
      requestScrollerTopPaddingUpdate(false);
    }
  }
 else {
    if (!mStackScrollerOverscrolling) {
      setQsExpansion(mQsMinExpansionHeight);
    }
    positionClockAndNotifications();
    mNotificationStackScroller.setStackHeight(getExpandedHeight());
  }
  mNotificationStackScroller.updateIsSmallScreen(mHeader.getCollapsedHeight() + mQsPeekHeight);
}
Program: 198515
Project: 198515
Buggy source:
private void updateStateForChildTransitioningInBottom(StackScrollAlgorithmState algorithmState,float transitioningPositionStart,float bottomPeakStart,float currentYPosition,StackScrollState.ViewState childViewState,int childHeight){
  algorithmState.partialInBottom=1.0f - ((transitioningPositionStart - currentYPosition) / (childHeight + mPaddingBetweenElements));
  float offset=mBottomStackIndentationFunctor.getValue(algorithmState.partialInBottom);
  algorithmState.itemsInBottomStack+=algorithmState.partialInBottom;
  childViewState.yTranslation=transitioningPositionStart + offset - childHeight - mPaddingBetweenElements;
  clampPositionToTopStackEnd(childViewState,childHeight);
  childViewState.location=StackScrollState.ViewState.LOCATION_MAIN_AREA;
}

Fixed version (ground truth):
private void updateStateForChildTransitioningInBottom(StackScrollAlgorithmState algorithmState,float transitioningPositionStart,float bottomPeakStart,float currentYPosition,StackScrollState.ViewState childViewState,int childHeight){
  algorithmState.partialInBottom=1.0f - ((transitioningPositionStart - currentYPosition) / (childHeight + mPaddingBetweenElements));
  float offset=mBottomStackIndentationFunctor.getValue(algorithmState.partialInBottom);
  algorithmState.itemsInBottomStack+=algorithmState.partialInBottom;
  int newHeight=childHeight;
  if (childHeight > mCollapsedSize && mIsSmallScreen) {
    newHeight=(int)Math.max(Math.min(transitioningPositionStart + offset - mPaddingBetweenElements - currentYPosition,childHeight),mCollapsedSize);
    childViewState.height=newHeight;
  }
  childViewState.yTranslation=transitioningPositionStart + offset - newHeight - mPaddingBetweenElements;
  clampPositionToTopStackEnd(childViewState,newHeight);
  childViewState.location=StackScrollState.ViewState.LOCATION_MAIN_AREA;
}
Program: 198516
Project: 198516
Buggy source:
private void initConstants(Context context){
  mPaddingBetweenElementsDimmed=context.getResources().getDimensionPixelSize(R.dimen.notification_padding_dimmed);
  mPaddingBetweenElementsNormal=context.getResources().getDimensionPixelSize(R.dimen.notification_padding);
  mCollapsedSize=context.getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mTopStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.top_stack_peek_amount);
  mBottomStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
  mZDistanceBetweenElements=context.getResources().getDimensionPixelSize(R.dimen.z_distance_between_notifications);
  mZBasicHeight=(MAX_ITEMS_IN_BOTTOM_STACK + 1) * mZDistanceBetweenElements;
  mBottomStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_slow_down_length);
  mTopStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.top_stack_slow_down_length);
  mRoundedRectCornerRadius=context.getResources().getDimensionPixelSize(R.dimen.notification_material_rounded_rect_radius);
  mCollapseSecondCardPadding=context.getResources().getDimensionPixelSize(R.dimen.notification_collapse_second_card_padding);
}

Fixed version (ground truth):
private void initConstants(Context context){
  mPaddingBetweenElementsDimmed=context.getResources().getDimensionPixelSize(R.dimen.notification_padding_dimmed);
  mPaddingBetweenElementsNormal=context.getResources().getDimensionPixelSize(R.dimen.notification_padding);
  mCollapsedSize=context.getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mMaxNotificationHeight=context.getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mTopStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.top_stack_peek_amount);
  mBottomStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
  mZDistanceBetweenElements=context.getResources().getDimensionPixelSize(R.dimen.z_distance_between_notifications);
  mZBasicHeight=(MAX_ITEMS_IN_BOTTOM_STACK + 1) * mZDistanceBetweenElements;
  mBottomStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_slow_down_length);
  mTopStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.top_stack_slow_down_length);
  mRoundedRectCornerRadius=context.getResources().getDimensionPixelSize(R.dimen.notification_material_rounded_rect_radius);
  mCollapseSecondCardPadding=context.getResources().getDimensionPixelSize(R.dimen.notification_collapse_second_card_padding);
}
Program: 198517
Project: 198517
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  mKeyguardStatusView.setPivotX(getWidth() / 2);
  mKeyguardStatusView.setPivotY((FONT_HEIGHT - CAP_HEIGHT) / 2048f * mClockView.getTextSize());
  mQsMinExpansionHeight=mKeyguardShowing ? 0 : mHeader.getCollapsedHeight() + mQsPeekHeight;
  mQsMaxExpansionHeight=mHeader.getExpandedHeight() + mQsContainer.getHeight();
  if (mQsExpanded) {
    if (mQsFullyExpanded) {
      mQsExpansionHeight=mQsMaxExpansionHeight;
      requestScrollerTopPaddingUpdate(false);
    }
  }
 else {
    if (!mStackScrollerOverscrolling) {
      setQsExpansion(mQsMinExpansionHeight);
    }
    positionClockAndNotifications();
    mNotificationStackScroller.setStackHeight(getExpandedHeight());
  }
}

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);
  mKeyguardStatusView.setPivotX(getWidth() / 2);
  mKeyguardStatusView.setPivotY((FONT_HEIGHT - CAP_HEIGHT) / 2048f * mClockView.getTextSize());
  mQsMinExpansionHeight=mKeyguardShowing ? 0 : mHeader.getCollapsedHeight() + mQsPeekHeight;
  mQsMaxExpansionHeight=mHeader.getExpandedHeight() + mQsContainer.getHeight();
  if (mQsExpanded) {
    if (mQsFullyExpanded) {
      mQsExpansionHeight=mQsMaxExpansionHeight;
      requestScrollerTopPaddingUpdate(false);
    }
  }
 else {
    if (!mStackScrollerOverscrolling) {
      setQsExpansion(mQsMinExpansionHeight);
    }
    positionClockAndNotifications();
    mNotificationStackScroller.setStackHeight(getExpandedHeight());
  }
  mNotificationStackScroller.updateIsSmallScreen(mHeader.getCollapsedHeight() + mQsPeekHeight);
}
Program: 198519
Project: 198519
Buggy source:
private void updateStateForChildTransitioningInBottom(StackScrollAlgorithmState algorithmState,float transitioningPositionStart,float bottomPeakStart,float currentYPosition,StackScrollState.ViewState childViewState,int childHeight){
  algorithmState.partialInBottom=1.0f - ((transitioningPositionStart - currentYPosition) / (childHeight + mPaddingBetweenElements));
  float offset=mBottomStackIndentationFunctor.getValue(algorithmState.partialInBottom);
  algorithmState.itemsInBottomStack+=algorithmState.partialInBottom;
  childViewState.yTranslation=transitioningPositionStart + offset - childHeight - mPaddingBetweenElements;
  clampPositionToTopStackEnd(childViewState,childHeight);
  childViewState.location=StackScrollState.ViewState.LOCATION_MAIN_AREA;
}

Fixed version (ground truth):
private void updateStateForChildTransitioningInBottom(StackScrollAlgorithmState algorithmState,float transitioningPositionStart,float bottomPeakStart,float currentYPosition,StackScrollState.ViewState childViewState,int childHeight){
  algorithmState.partialInBottom=1.0f - ((transitioningPositionStart - currentYPosition) / (childHeight + mPaddingBetweenElements));
  float offset=mBottomStackIndentationFunctor.getValue(algorithmState.partialInBottom);
  algorithmState.itemsInBottomStack+=algorithmState.partialInBottom;
  int newHeight=childHeight;
  if (childHeight > mCollapsedSize && mIsSmallScreen) {
    newHeight=(int)Math.max(Math.min(transitioningPositionStart + offset - mPaddingBetweenElements - currentYPosition,childHeight),mCollapsedSize);
    childViewState.height=newHeight;
  }
  childViewState.yTranslation=transitioningPositionStart + offset - newHeight - mPaddingBetweenElements;
  clampPositionToTopStackEnd(childViewState,newHeight);
  childViewState.location=StackScrollState.ViewState.LOCATION_MAIN_AREA;
}
Program: 198520
Project: 198520
Buggy source:
private void initConstants(Context context){
  mPaddingBetweenElementsDimmed=context.getResources().getDimensionPixelSize(R.dimen.notification_padding_dimmed);
  mPaddingBetweenElementsNormal=context.getResources().getDimensionPixelSize(R.dimen.notification_padding);
  mCollapsedSize=context.getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mTopStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.top_stack_peek_amount);
  mBottomStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
  mZDistanceBetweenElements=context.getResources().getDimensionPixelSize(R.dimen.z_distance_between_notifications);
  mZBasicHeight=(MAX_ITEMS_IN_BOTTOM_STACK + 1) * mZDistanceBetweenElements;
  mBottomStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_slow_down_length);
  mTopStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.top_stack_slow_down_length);
  mRoundedRectCornerRadius=context.getResources().getDimensionPixelSize(R.dimen.notification_material_rounded_rect_radius);
  mCollapseSecondCardPadding=context.getResources().getDimensionPixelSize(R.dimen.notification_collapse_second_card_padding);
}

Fixed version (ground truth):
private void initConstants(Context context){
  mPaddingBetweenElementsDimmed=context.getResources().getDimensionPixelSize(R.dimen.notification_padding_dimmed);
  mPaddingBetweenElementsNormal=context.getResources().getDimensionPixelSize(R.dimen.notification_padding);
  mCollapsedSize=context.getResources().getDimensionPixelSize(R.dimen.notification_min_height);
  mMaxNotificationHeight=context.getResources().getDimensionPixelSize(R.dimen.notification_max_height);
  mTopStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.top_stack_peek_amount);
  mBottomStackPeekSize=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_peek_amount);
  mZDistanceBetweenElements=context.getResources().getDimensionPixelSize(R.dimen.z_distance_between_notifications);
  mZBasicHeight=(MAX_ITEMS_IN_BOTTOM_STACK + 1) * mZDistanceBetweenElements;
  mBottomStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.bottom_stack_slow_down_length);
  mTopStackSlowDownLength=context.getResources().getDimensionPixelSize(R.dimen.top_stack_slow_down_length);
  mRoundedRectCornerRadius=context.getResources().getDimensionPixelSize(R.dimen.notification_material_rounded_rect_radius);
  mCollapseSecondCardPadding=context.getResources().getDimensionPixelSize(R.dimen.notification_collapse_second_card_padding);
}
Program: 198521
Project: 198521
Buggy source:
@ServiceThreadOnly void doManualPortSwitching(int portId,IHdmiControlCallback callback){
  assertRunOnServiceThread();
  if (!mService.isValidPortId(portId)) {
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  if (portId == getActivePortId()) {
    invokeCallback(callback,HdmiControlManager.RESULT_SUCCESS);
    return;
  }
  mActiveSource.invalidate();
  if (!mService.isControlEnabled()) {
    setActivePortId(portId);
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  int oldPath=mService.portIdToPath(getActivePortId());
  int newPath=mService.portIdToPath(portId);
  HdmiCecMessage routingChange=HdmiCecMessageBuilder.buildRoutingChange(mAddress,oldPath,newPath);
  mService.sendCecCommand(routingChange);
  removeAction(RoutingControlAction.class);
  addAndStartAction(new RoutingControlAction(this,newPath,false,callback));
}

Fixed version (ground truth):
@ServiceThreadOnly void doManualPortSwitching(int portId,IHdmiControlCallback callback){
  assertRunOnServiceThread();
  if (!mService.isValidPortId(portId)) {
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  if (portId == getActivePortId()) {
    invokeCallback(callback,HdmiControlManager.RESULT_SUCCESS);
    return;
  }
  mActiveSource.invalidate();
  if (!mService.isControlEnabled()) {
    setActivePortId(portId);
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  int oldPath=getActivePortId() != Constants.INVALID_PORT_ID ? mService.portIdToPath(getActivePortId()) : getDeviceInfo().getPhysicalAddress();
  int newPath=mService.portIdToPath(portId);
  HdmiCecMessage routingChange=HdmiCecMessageBuilder.buildRoutingChange(mAddress,oldPath,newPath);
  mService.sendCecCommand(routingChange);
  removeAction(RoutingControlAction.class);
  addAndStartAction(new RoutingControlAction(this,newPath,false,callback));
}
Program: 198522
Project: 198522
Buggy source:
/** 
 * Sends key to a target CEC device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
@Override @ServiceThreadOnly protected void sendKeyEvent(int keyCode,boolean isPressed){
  assertRunOnServiceThread();
  List<SendKeyAction> action=getActions(SendKeyAction.class);
  if (!action.isEmpty()) {
    action.get(0).processKeyEvent(keyCode,isPressed);
  }
 else {
    if (isPressed) {
      int logicalAddress=getActiveSource().logicalAddress;
      addAndStartAction(new SendKeyAction(this,logicalAddress,keyCode));
    }
 else {
      Slog.w(TAG,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Sends key to a target CEC device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
@Override @ServiceThreadOnly protected void sendKeyEvent(int keyCode,boolean isPressed){
  assertRunOnServiceThread();
  List<SendKeyAction> action=getActions(SendKeyAction.class);
  if (!action.isEmpty()) {
    action.get(0).processKeyEvent(keyCode,isPressed);
  }
 else {
    if (isPressed && getActiveSource().isValid()) {
      int logicalAddress=getActiveSource().logicalAddress;
      addAndStartAction(new SendKeyAction(this,logicalAddress,keyCode));
    }
 else {
      Slog.w(TAG,"String_Node_Str" + keyCode + "String_Node_Str"+ isPressed);
    }
  }
}
Program: 198523
Project: 198523
Buggy source:
@ServiceThreadOnly void doManualPortSwitching(int portId,IHdmiControlCallback callback){
  assertRunOnServiceThread();
  if (!mService.isValidPortId(portId)) {
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  if (portId == getActivePortId()) {
    invokeCallback(callback,HdmiControlManager.RESULT_SUCCESS);
    return;
  }
  mActiveSource.invalidate();
  if (!mService.isControlEnabled()) {
    setActivePortId(portId);
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  int oldPath=mService.portIdToPath(getActivePortId());
  int newPath=mService.portIdToPath(portId);
  HdmiCecMessage routingChange=HdmiCecMessageBuilder.buildRoutingChange(mAddress,oldPath,newPath);
  mService.sendCecCommand(routingChange);
  removeAction(RoutingControlAction.class);
  addAndStartAction(new RoutingControlAction(this,newPath,false,callback));
}

Fixed version (ground truth):
@ServiceThreadOnly void doManualPortSwitching(int portId,IHdmiControlCallback callback){
  assertRunOnServiceThread();
  if (!mService.isValidPortId(portId)) {
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  if (portId == getActivePortId()) {
    invokeCallback(callback,HdmiControlManager.RESULT_SUCCESS);
    return;
  }
  mActiveSource.invalidate();
  if (!mService.isControlEnabled()) {
    setActivePortId(portId);
    invokeCallback(callback,HdmiControlManager.RESULT_INCORRECT_MODE);
    return;
  }
  int oldPath=getActivePortId() != Constants.INVALID_PORT_ID ? mService.portIdToPath(getActivePortId()) : getDeviceInfo().getPhysicalAddress();
  int newPath=mService.portIdToPath(portId);
  HdmiCecMessage routingChange=HdmiCecMessageBuilder.buildRoutingChange(mAddress,oldPath,newPath);
  mService.sendCecCommand(routingChange);
  removeAction(RoutingControlAction.class);
  addAndStartAction(new RoutingControlAction(this,newPath,false,callback));
}
Program: 198524
Project: 198524
Buggy source:
/** 
 * Sends key to a target CEC device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
@Override @ServiceThreadOnly protected void sendKeyEvent(int keyCode,boolean isPressed){
  assertRunOnServiceThread();
  List<SendKeyAction> action=getActions(SendKeyAction.class);
  if (!action.isEmpty()) {
    action.get(0).processKeyEvent(keyCode,isPressed);
  }
 else {
    if (isPressed) {
      int logicalAddress=getActiveSource().logicalAddress;
      addAndStartAction(new SendKeyAction(this,logicalAddress,keyCode));
    }
 else {
      Slog.w(TAG,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Sends key to a target CEC device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
@Override @ServiceThreadOnly protected void sendKeyEvent(int keyCode,boolean isPressed){
  assertRunOnServiceThread();
  List<SendKeyAction> action=getActions(SendKeyAction.class);
  if (!action.isEmpty()) {
    action.get(0).processKeyEvent(keyCode,isPressed);
  }
 else {
    if (isPressed && getActiveSource().isValid()) {
      int logicalAddress=getActiveSource().logicalAddress;
      addAndStartAction(new SendKeyAction(this,logicalAddress,keyCode));
    }
 else {
      Slog.w(TAG,"String_Node_Str" + keyCode + "String_Node_Str"+ isPressed);
    }
  }
}
Program: 198529
Project: 198529
Buggy source:
void startSpecificActivityLocked(ActivityRecord r,boolean andResume,boolean checkConfig){
  ProcessRecord app=mService.getProcessRecordLocked(r.processName,r.info.applicationInfo.uid,true);
  r.task.stack.setLaunchTime(r);
  if (app != null && app.thread != null) {
    try {
      if ((r.info.flags & ActivityInfo.FLAG_MULTIPROCESS) == 0 || !"String_Node_Str".equals(r.info.packageName)) {
        app.addPackage(r.info.packageName,mService.mProcessStats);
      }
      realStartActivityLocked(r,app,andResume,checkConfig);
      return;
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString(),e);
    }
  }
  mService.startProcessLocked(r.processName,r.info.applicationInfo,true,0,"String_Node_Str",r.intent.getComponent(),false,false,true);
}

Fixed version (ground truth):
void startSpecificActivityLocked(ActivityRecord r,boolean andResume,boolean checkConfig){
  ProcessRecord app=mService.getProcessRecordLocked(r.processName,r.info.applicationInfo.uid,true);
  r.task.stack.setLaunchTime(r);
  if (app != null && app.thread != null && !app.killedByAm) {
    try {
      if ((r.info.flags & ActivityInfo.FLAG_MULTIPROCESS) == 0 || !"String_Node_Str".equals(r.info.packageName)) {
        app.addPackage(r.info.packageName,mService.mProcessStats);
      }
      realStartActivityLocked(r,app,andResume,checkConfig);
      return;
    }
 catch (    RemoteException e) {
      Slog.w(TAG,"String_Node_Str" + r.intent.getComponent().flattenToShortString(),e);
    }
  }
  mService.startProcessLocked(r.processName,r.info.applicationInfo,true,0,"String_Node_Str",r.intent.getComponent(),false,false,true);
}
Program: 198530
Project: 198530
Buggy source:
private void startActivateAnimation(boolean reverse){
  int widthHalf=mBackgroundNormal.getWidth() / 2;
  int heightHalf=mBackgroundNormal.getActualHeight() / 2;
  float radius=(float)Math.sqrt(widthHalf * widthHalf + heightHalf * heightHalf);
  Animator animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,0,radius);
  mBackgroundNormal.setVisibility(View.VISIBLE);
  Interpolator interpolator;
  Interpolator alphaInterpolator;
  if (!reverse) {
    interpolator=mLinearOutSlowInInterpolator;
    alphaInterpolator=mLinearOutSlowInInterpolator;
  }
 else {
    interpolator=ACTIVATE_INVERSE_INTERPOLATOR;
    alphaInterpolator=ACTIVATE_INVERSE_ALPHA_INTERPOLATOR;
  }
  animator.setInterpolator(interpolator);
  animator.setDuration(ACTIVATE_ANIMATION_LENGTH);
  if (reverse) {
    mBackgroundNormal.setAlpha(1f);
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        mBackgroundNormal.setVisibility(View.INVISIBLE);
      }
    }
);
    animator.reverse();
  }
 else {
    mBackgroundNormal.setAlpha(0.4f);
    animator.start();
  }
  mBackgroundNormal.animate().alpha(reverse ? 0f : 1f).setInterpolator(alphaInterpolator).setDuration(ACTIVATE_ANIMATION_LENGTH);
}

Fixed version (ground truth):
private void startActivateAnimation(boolean reverse){
  int widthHalf=mBackgroundNormal.getWidth() / 2;
  int heightHalf=mBackgroundNormal.getActualHeight() / 2;
  float radius=(float)Math.sqrt(widthHalf * widthHalf + heightHalf * heightHalf);
  Animator animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,0,radius);
  mBackgroundNormal.setVisibility(View.VISIBLE);
  Interpolator interpolator;
  Interpolator alphaInterpolator;
  if (!reverse) {
    interpolator=mLinearOutSlowInInterpolator;
    alphaInterpolator=mLinearOutSlowInInterpolator;
  }
 else {
    interpolator=ACTIVATE_INVERSE_INTERPOLATOR;
    alphaInterpolator=ACTIVATE_INVERSE_ALPHA_INTERPOLATOR;
  }
  animator.setInterpolator(interpolator);
  animator.setDuration(ACTIVATE_ANIMATION_LENGTH);
  if (reverse) {
    mBackgroundNormal.setAlpha(1f);
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        if (mDimmed) {
          mBackgroundNormal.setVisibility(View.INVISIBLE);
        }
      }
    }
);
    animator.reverse();
  }
 else {
    mBackgroundNormal.setAlpha(0.4f);
    animator.start();
  }
  mBackgroundNormal.animate().alpha(reverse ? 0f : 1f).setInterpolator(alphaInterpolator).setDuration(ACTIVATE_ANIMATION_LENGTH);
}
Program: 198533
Project: 198533
Buggy source:
private void startActivateAnimation(boolean reverse){
  int widthHalf=mBackgroundNormal.getWidth() / 2;
  int heightHalf=mBackgroundNormal.getActualHeight() / 2;
  float radius=(float)Math.sqrt(widthHalf * widthHalf + heightHalf * heightHalf);
  Animator animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,0,radius);
  mBackgroundNormal.setVisibility(View.VISIBLE);
  Interpolator interpolator;
  Interpolator alphaInterpolator;
  if (!reverse) {
    interpolator=mLinearOutSlowInInterpolator;
    alphaInterpolator=mLinearOutSlowInInterpolator;
  }
 else {
    interpolator=ACTIVATE_INVERSE_INTERPOLATOR;
    alphaInterpolator=ACTIVATE_INVERSE_ALPHA_INTERPOLATOR;
  }
  animator.setInterpolator(interpolator);
  animator.setDuration(ACTIVATE_ANIMATION_LENGTH);
  if (reverse) {
    mBackgroundNormal.setAlpha(1f);
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        mBackgroundNormal.setVisibility(View.INVISIBLE);
      }
    }
);
    animator.reverse();
  }
 else {
    mBackgroundNormal.setAlpha(0.4f);
    animator.start();
  }
  mBackgroundNormal.animate().alpha(reverse ? 0f : 1f).setInterpolator(alphaInterpolator).setDuration(ACTIVATE_ANIMATION_LENGTH);
}

Fixed version (ground truth):
private void startActivateAnimation(boolean reverse){
  int widthHalf=mBackgroundNormal.getWidth() / 2;
  int heightHalf=mBackgroundNormal.getActualHeight() / 2;
  float radius=(float)Math.sqrt(widthHalf * widthHalf + heightHalf * heightHalf);
  Animator animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,0,radius);
  mBackgroundNormal.setVisibility(View.VISIBLE);
  Interpolator interpolator;
  Interpolator alphaInterpolator;
  if (!reverse) {
    interpolator=mLinearOutSlowInInterpolator;
    alphaInterpolator=mLinearOutSlowInInterpolator;
  }
 else {
    interpolator=ACTIVATE_INVERSE_INTERPOLATOR;
    alphaInterpolator=ACTIVATE_INVERSE_ALPHA_INTERPOLATOR;
  }
  animator.setInterpolator(interpolator);
  animator.setDuration(ACTIVATE_ANIMATION_LENGTH);
  if (reverse) {
    mBackgroundNormal.setAlpha(1f);
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        if (mDimmed) {
          mBackgroundNormal.setVisibility(View.INVISIBLE);
        }
      }
    }
);
    animator.reverse();
  }
 else {
    mBackgroundNormal.setAlpha(0.4f);
    animator.start();
  }
  mBackgroundNormal.animate().alpha(reverse ? 0f : 1f).setInterpolator(alphaInterpolator).setDuration(ACTIVATE_ANIMATION_LENGTH);
}
Program: 198534
Project: 198534
Buggy source:
private void startActivateAnimation(boolean reverse){
  int widthHalf=mBackgroundNormal.getWidth() / 2;
  int heightHalf=mBackgroundNormal.getActualHeight() / 2;
  float radius=(float)Math.sqrt(widthHalf * widthHalf + heightHalf * heightHalf);
  Animator animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,0,radius);
  mBackgroundNormal.setVisibility(View.VISIBLE);
  Interpolator interpolator;
  Interpolator alphaInterpolator;
  if (!reverse) {
    interpolator=mLinearOutSlowInInterpolator;
    alphaInterpolator=mLinearOutSlowInInterpolator;
  }
 else {
    interpolator=ACTIVATE_INVERSE_INTERPOLATOR;
    alphaInterpolator=ACTIVATE_INVERSE_ALPHA_INTERPOLATOR;
  }
  animator.setInterpolator(interpolator);
  animator.setDuration(ACTIVATE_ANIMATION_LENGTH);
  if (reverse) {
    mBackgroundNormal.setAlpha(1f);
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        mBackgroundNormal.setVisibility(View.INVISIBLE);
      }
    }
);
    animator.reverse();
  }
 else {
    mBackgroundNormal.setAlpha(0.4f);
    animator.start();
  }
  mBackgroundNormal.animate().alpha(reverse ? 0f : 1f).setInterpolator(alphaInterpolator).setDuration(ACTIVATE_ANIMATION_LENGTH);
}

Fixed version (ground truth):
private void startActivateAnimation(boolean reverse){
  int widthHalf=mBackgroundNormal.getWidth() / 2;
  int heightHalf=mBackgroundNormal.getActualHeight() / 2;
  float radius=(float)Math.sqrt(widthHalf * widthHalf + heightHalf * heightHalf);
  Animator animator=ViewAnimationUtils.createCircularReveal(mBackgroundNormal,widthHalf,heightHalf,0,radius);
  mBackgroundNormal.setVisibility(View.VISIBLE);
  Interpolator interpolator;
  Interpolator alphaInterpolator;
  if (!reverse) {
    interpolator=mLinearOutSlowInInterpolator;
    alphaInterpolator=mLinearOutSlowInInterpolator;
  }
 else {
    interpolator=ACTIVATE_INVERSE_INTERPOLATOR;
    alphaInterpolator=ACTIVATE_INVERSE_ALPHA_INTERPOLATOR;
  }
  animator.setInterpolator(interpolator);
  animator.setDuration(ACTIVATE_ANIMATION_LENGTH);
  if (reverse) {
    mBackgroundNormal.setAlpha(1f);
    animator.addListener(new AnimatorListenerAdapter(){
      @Override public void onAnimationEnd(      Animator animation){
        if (mDimmed) {
          mBackgroundNormal.setVisibility(View.INVISIBLE);
        }
      }
    }
);
    animator.reverse();
  }
 else {
    mBackgroundNormal.setAlpha(0.4f);
    animator.start();
  }
  mBackgroundNormal.animate().alpha(reverse ? 0f : 1f).setInterpolator(alphaInterpolator).setDuration(ACTIVATE_ANIMATION_LENGTH);
}
Program: 198535
Project: 198535
Buggy source:
public void reset(){
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}

Fixed version (ground truth):
public void reset(){
  super.reset();
  setTintColor(0);
  setShowingLegacyBackground(false);
  setBelowSpeedBump(false);
}
Program: 198536
Project: 198536
Buggy source:
@Override protected void onLayout(boolean changed,int left,int top,int right,int bottom){
  super.onLayout(changed,left,top,right,bottom);
  boolean updateExpandHeight=mMaxExpandHeight == 0;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
}

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);
  boolean updateExpandHeight=mMaxExpandHeight == 0 && !mWasReset;
  mMaxExpandHeight=mPrivateLayout.getMaxHeight();
  if (updateExpandHeight) {
    applyExpansionToLayout();
  }
  mWasReset=false;
}
Program: 198537
Project: 198537
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;
  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();
  mMaxExpandHeight=0;
  mWasReset=true;
  logExpansionEvent(false,wasExpanded);
}
Program: 198538
Project: 198538
Buggy source:
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  mNeedsAnimation=false;
}

Fixed version (ground truth):
private void generateChildHierarchyEvents(){
  generateChildRemovalEvents();
  generateChildAdditionEvents();
  generatePositionChangeEvents();
  generateSnapBackEvents();
  generateDragEvents();
  generateTopPaddingEvent();
  generateActivateEvent();
  generateDimmedEvent();
  generateHideSensitiveEvent();
  generateDarkEvent();
  generateGoToFullShadeEvent();
  generateViewResizeEvent();
  mNeedsAnimation=false;
}