nus-yam/ex-repair huggingface dataset:
Program: 196214
Project: 196214
Buggy source:
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      stackIndex=Math.min(stackIndex,MAX_ITEMS_IN_TOP_STACK + 2);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}

Fixed version (ground truth):
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      float max=MAX_ITEMS_IN_TOP_STACK + (i == 0 ? 2.5f : 2);
      stackIndex=Math.min(stackIndex,max);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}
Program: 196215
Project: 196215
Buggy source:
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
    float clipHeight=previousNotificationIsSwiped ? newHeight : newNotificationEnd - (previousNotificationEnd - clippingCorrection);
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}

Fixed version (ground truth):
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clipHeight;
    if (previousNotificationIsSwiped) {
      clipHeight=newHeight;
    }
 else {
      clipHeight=newNotificationEnd - previousNotificationEnd;
      clipHeight=Math.max(0.0f,clipHeight);
      if (clipHeight != 0.0f) {
        float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
        clipHeight+=clippingCorrection;
      }
    }
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}
Program: 196218
Project: 196218
Buggy source:
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      stackIndex=Math.min(stackIndex,MAX_ITEMS_IN_TOP_STACK + 2);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}

Fixed version (ground truth):
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      float max=MAX_ITEMS_IN_TOP_STACK + (i == 0 ? 2.5f : 2);
      stackIndex=Math.min(stackIndex,max);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}
Program: 196219
Project: 196219
Buggy source:
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
    float clipHeight=previousNotificationIsSwiped ? newHeight : newNotificationEnd - (previousNotificationEnd - clippingCorrection);
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}

Fixed version (ground truth):
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clipHeight;
    if (previousNotificationIsSwiped) {
      clipHeight=newHeight;
    }
 else {
      clipHeight=newNotificationEnd - previousNotificationEnd;
      clipHeight=Math.max(0.0f,clipHeight);
      if (clipHeight != 0.0f) {
        float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
        clipHeight+=clippingCorrection;
      }
    }
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}
Program: 196223
Project: 196223
Buggy source:
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      stackIndex=Math.min(stackIndex,MAX_ITEMS_IN_TOP_STACK + 2);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}

Fixed version (ground truth):
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      float max=MAX_ITEMS_IN_TOP_STACK + (i == 0 ? 2.5f : 2);
      stackIndex=Math.min(stackIndex,max);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}
Program: 196224
Project: 196224
Buggy source:
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
    float clipHeight=previousNotificationIsSwiped ? newHeight : newNotificationEnd - (previousNotificationEnd - clippingCorrection);
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}

Fixed version (ground truth):
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clipHeight;
    if (previousNotificationIsSwiped) {
      clipHeight=newHeight;
    }
 else {
      clipHeight=newNotificationEnd - previousNotificationEnd;
      clipHeight=Math.max(0.0f,clipHeight);
      if (clipHeight != 0.0f) {
        float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
        clipHeight+=clippingCorrection;
      }
    }
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}
Program: 196227
Project: 196227
Buggy source:
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      stackIndex=Math.min(stackIndex,MAX_ITEMS_IN_TOP_STACK + 2);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}

Fixed version (ground truth):
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      float max=MAX_ITEMS_IN_TOP_STACK + (i == 0 ? 2.5f : 2);
      stackIndex=Math.min(stackIndex,max);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}
Program: 196228
Project: 196228
Buggy source:
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
    float clipHeight=previousNotificationIsSwiped ? newHeight : newNotificationEnd - (previousNotificationEnd - clippingCorrection);
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}

Fixed version (ground truth):
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clipHeight;
    if (previousNotificationIsSwiped) {
      clipHeight=newHeight;
    }
 else {
      clipHeight=newNotificationEnd - previousNotificationEnd;
      clipHeight=Math.max(0.0f,clipHeight);
      if (clipHeight != 0.0f) {
        float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
        clipHeight+=clippingCorrection;
      }
    }
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}
Program: 196231
Project: 196231
Buggy source:
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      stackIndex=Math.min(stackIndex,MAX_ITEMS_IN_TOP_STACK + 2);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}

Fixed version (ground truth):
/** 
 * Calculate the Z positions for all children based on the number of items in both stacks and save it in the resultState
 * @param resultState The result state to update the zTranslation values
 * @param algorithmState The state in which the current pass of the algorithm is currently in
 */
private void updateZValuesForState(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    View child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState childViewState=resultState.getViewStateForView(child);
    if (i < algorithmState.itemsInTopStack) {
      float stackIndex=algorithmState.itemsInTopStack - i;
      float max=MAX_ITEMS_IN_TOP_STACK + (i == 0 ? 2.5f : 2);
      stackIndex=Math.min(stackIndex,max);
      if (i == 0 && algorithmState.itemsInTopStack < 2.0f) {
        stackIndex-=1.0f;
        if (algorithmState.scrollY > mCollapsedSize) {
          stackIndex=0.1f + stackIndex * 1.9f;
        }
      }
      childViewState.zTranslation=mZBasicHeight + stackIndex * mZDistanceBetweenElements;
    }
 else     if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
      float numItemsAbove=i - (childCount - 1 - algorithmState.itemsInBottomStack);
      float translationZ=mZBasicHeight - numItemsAbove * mZDistanceBetweenElements;
      childViewState.zTranslation=translationZ;
    }
 else {
      childViewState.zTranslation=mZBasicHeight;
    }
  }
}
Program: 196232
Project: 196232
Buggy source:
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
    float clipHeight=previousNotificationIsSwiped ? newHeight : newNotificationEnd - (previousNotificationEnd - clippingCorrection);
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}

Fixed version (ground truth):
private void updateClipping(StackScrollState resultState,StackScrollAlgorithmState algorithmState){
  float previousNotificationEnd=0;
  float previousNotificationStart=0;
  boolean previousNotificationIsSwiped=false;
  int childCount=algorithmState.visibleChildren.size();
  for (int i=0; i < childCount; i++) {
    ExpandableView child=algorithmState.visibleChildren.get(i);
    StackScrollState.ViewState state=resultState.getViewStateForView(child);
    float newYTranslation=state.yTranslation + state.height * (1f - state.scale) / 2f;
    float newHeight=state.height * state.scale;
    float newNotificationEnd=newYTranslation + newHeight;
    float clipHeight;
    if (previousNotificationIsSwiped) {
      clipHeight=newHeight;
    }
 else {
      clipHeight=newNotificationEnd - previousNotificationEnd;
      clipHeight=Math.max(0.0f,clipHeight);
      if (clipHeight != 0.0f) {
        float clippingCorrection=state.dimmed ? 0 : mRoundedRectCornerRadius * state.scale;
        clipHeight+=clippingCorrection;
      }
    }
    updateChildClippingAndBackground(state,newHeight,clipHeight,newHeight - (previousNotificationStart - newYTranslation));
    if (!child.isTransparent()) {
      previousNotificationStart=newYTranslation + state.clipTopAmount * state.scale;
      previousNotificationEnd=newNotificationEnd;
      previousNotificationIsSwiped=child.getTranslationX() != 0;
    }
  }
}
Program: 196239
Project: 196239
Buggy source:
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}

Fixed version (ground truth):
private View updateColorViewInt(View view,int sysUiVis,int systemUiHideFlag,int translucentFlag,int color,int height,int verticalGravity,String transitionName,int id,boolean hiddenByWindowFlag){
  boolean show=height > 0 && (sysUiVis & systemUiHideFlag) == 0 && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
  if (view == null) {
    if (show) {
      view=new View(mContext);
      view.setBackgroundColor(color);
      view.setTransitionName(transitionName);
      view.setId(id);
      addView(view,new LayoutParams(LayoutParams.MATCH_PARENT,height,Gravity.START | verticalGravity));
      updateColorViewTranslations();
    }
  }
 else {
    int vis=show ? VISIBLE : INVISIBLE;
    view.setVisibility(vis);
    if (show) {
      LayoutParams lp=(LayoutParams)view.getLayoutParams();
      if (lp.height != height) {
        lp.height=height;
        view.setLayoutParams(lp);
      }
      view.setBackgroundColor(color);
    }
  }
  return view;
}
Program: 196241
Project: 196241
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  long currentTime=System.currentTimeMillis();
  if ((currentTime > mLastToggleTime) && (currentTime - mLastToggleTime) < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 196242
Project: 196242
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  long currentTime=System.currentTimeMillis();
  if ((currentTime > mLastToggleTime) && (currentTime - mLastToggleTime) < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 196243
Project: 196243
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  long currentTime=System.currentTimeMillis();
  if ((currentTime > mLastToggleTime) && (currentTime - mLastToggleTime) < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 196244
Project: 196244
Buggy source:
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  if (System.currentTimeMillis() - mLastToggleTime < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}

Fixed version (ground truth):
/** 
 * Toggles the recents activity 
 */
void toggleRecentsActivity(){
  long currentTime=System.currentTimeMillis();
  if ((currentTime > mLastToggleTime) && (currentTime - mLastToggleTime) < sMinToggleDelay) {
    return;
  }
  ActivityManager.RunningTaskInfo topTask=getTopMostTask();
  AtomicBoolean isTopTaskHome=new AtomicBoolean();
  if (isRecentsTopMost(topTask,isTopTaskHome)) {
    Intent intent=new Intent(ACTION_TOGGLE_RECENTS_ACTIVITY);
    intent.setPackage(mContext.getPackageName());
    intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND);
    mContext.sendBroadcastAsUser(intent,UserHandle.CURRENT);
    mLastToggleTime=System.currentTimeMillis();
    return;
  }
 else {
    startRecentsActivity(topTask,isTopTaskHome.get());
  }
}
Program: 196245
Project: 196245
Buggy source:
/** 
 * Phase 1: Move everything upwards.
 */
private void startUnlockHintAnimationPhase1(final Runnable onAnimationFinished){
  float target=Math.max(0,getMaxPanelHeight() - mHintDistance);
  ValueAnimator animator=createHeightAnimator(target);
  animator.setDuration(250);
  animator.setInterpolator(mFastOutSlowInInterpolator);
  animator.addListener(new AnimatorListenerAdapter(){
    private boolean mCancelled;
    @Override public void onAnimationCancel(    Animator animation){
      mCancelled=true;
    }
    @Override public void onAnimationEnd(    Animator animation){
      if (mCancelled) {
        mHeightAnimator=null;
        onAnimationFinished.run();
      }
 else {
        startUnlockHintAnimationPhase2(onAnimationFinished);
      }
    }
  }
);
  animator.start();
  mHeightAnimator=animator;
  mOriginalIndicationY=mKeyguardBottomArea.getIndicationView().getY();
  mKeyguardBottomArea.getIndicationView().animate().y(mOriginalIndicationY - mHintDistance).setDuration(250).setInterpolator(mFastOutSlowInInterpolator).withEndAction(new Runnable(){
    @Override public void run(){
      mKeyguardBottomArea.getIndicationView().animate().y(mOriginalIndicationY).setDuration(450).setInterpolator(mBounceInterpolator).start();
    }
  }
).start();
}

Fixed version (ground truth):
/** 
 * Phase 1: Move everything upwards.
 */
private void startUnlockHintAnimationPhase1(final Runnable onAnimationFinished){
  float target=Math.max(0,getMaxPanelHeight() - mHintDistance);
  ValueAnimator animator=createHeightAnimator(target);
  animator.setDuration(250);
  animator.setInterpolator(mFastOutSlowInInterpolator);
  animator.addListener(new AnimatorListenerAdapter(){
    private boolean mCancelled;
    @Override public void onAnimationCancel(    Animator animation){
      mCancelled=true;
    }
    @Override public void onAnimationEnd(    Animator animation){
      if (mCancelled) {
        mHeightAnimator=null;
        onAnimationFinished.run();
      }
 else {
        startUnlockHintAnimationPhase2(onAnimationFinished);
      }
    }
  }
);
  animator.start();
  mHeightAnimator=animator;
  mKeyguardBottomArea.getIndicationView().animate().translationY(-mHintDistance).setDuration(250).setInterpolator(mFastOutSlowInInterpolator).withEndAction(new Runnable(){
    @Override public void run(){
      mKeyguardBottomArea.getIndicationView().animate().translationY(0).setDuration(450).setInterpolator(mBounceInterpolator).start();
    }
  }
).start();
}
Program: 196246
Project: 196246
Buggy source:
/** 
 * Phase 1: Move everything upwards.
 */
private void startUnlockHintAnimationPhase1(final Runnable onAnimationFinished){
  float target=Math.max(0,getMaxPanelHeight() - mHintDistance);
  ValueAnimator animator=createHeightAnimator(target);
  animator.setDuration(250);
  animator.setInterpolator(mFastOutSlowInInterpolator);
  animator.addListener(new AnimatorListenerAdapter(){
    private boolean mCancelled;
    @Override public void onAnimationCancel(    Animator animation){
      mCancelled=true;
    }
    @Override public void onAnimationEnd(    Animator animation){
      if (mCancelled) {
        mHeightAnimator=null;
        onAnimationFinished.run();
      }
 else {
        startUnlockHintAnimationPhase2(onAnimationFinished);
      }
    }
  }
);
  animator.start();
  mHeightAnimator=animator;
  mOriginalIndicationY=mKeyguardBottomArea.getIndicationView().getY();
  mKeyguardBottomArea.getIndicationView().animate().y(mOriginalIndicationY - mHintDistance).setDuration(250).setInterpolator(mFastOutSlowInInterpolator).withEndAction(new Runnable(){
    @Override public void run(){
      mKeyguardBottomArea.getIndicationView().animate().y(mOriginalIndicationY).setDuration(450).setInterpolator(mBounceInterpolator).start();
    }
  }
).start();
}

Fixed version (ground truth):
/** 
 * Phase 1: Move everything upwards.
 */
private void startUnlockHintAnimationPhase1(final Runnable onAnimationFinished){
  float target=Math.max(0,getMaxPanelHeight() - mHintDistance);
  ValueAnimator animator=createHeightAnimator(target);
  animator.setDuration(250);
  animator.setInterpolator(mFastOutSlowInInterpolator);
  animator.addListener(new AnimatorListenerAdapter(){
    private boolean mCancelled;
    @Override public void onAnimationCancel(    Animator animation){
      mCancelled=true;
    }
    @Override public void onAnimationEnd(    Animator animation){
      if (mCancelled) {
        mHeightAnimator=null;
        onAnimationFinished.run();
      }
 else {
        startUnlockHintAnimationPhase2(onAnimationFinished);
      }
    }
  }
);
  animator.start();
  mHeightAnimator=animator;
  mKeyguardBottomArea.getIndicationView().animate().translationY(-mHintDistance).setDuration(250).setInterpolator(mFastOutSlowInInterpolator).withEndAction(new Runnable(){
    @Override public void run(){
      mKeyguardBottomArea.getIndicationView().animate().translationY(0).setDuration(450).setInterpolator(mBounceInterpolator).start();
    }
  }
).start();
}
Program: 196247
Project: 196247
Buggy source:
/** 
 * Phase 1: Move everything upwards.
 */
private void startUnlockHintAnimationPhase1(final Runnable onAnimationFinished){
  float target=Math.max(0,getMaxPanelHeight() - mHintDistance);
  ValueAnimator animator=createHeightAnimator(target);
  animator.setDuration(250);
  animator.setInterpolator(mFastOutSlowInInterpolator);
  animator.addListener(new AnimatorListenerAdapter(){
    private boolean mCancelled;
    @Override public void onAnimationCancel(    Animator animation){
      mCancelled=true;
    }
    @Override public void onAnimationEnd(    Animator animation){
      if (mCancelled) {
        mHeightAnimator=null;
        onAnimationFinished.run();
      }
 else {
        startUnlockHintAnimationPhase2(onAnimationFinished);
      }
    }
  }
);
  animator.start();
  mHeightAnimator=animator;
  mOriginalIndicationY=mKeyguardBottomArea.getIndicationView().getY();
  mKeyguardBottomArea.getIndicationView().animate().y(mOriginalIndicationY - mHintDistance).setDuration(250).setInterpolator(mFastOutSlowInInterpolator).withEndAction(new Runnable(){
    @Override public void run(){
      mKeyguardBottomArea.getIndicationView().animate().y(mOriginalIndicationY).setDuration(450).setInterpolator(mBounceInterpolator).start();
    }
  }
).start();
}

Fixed version (ground truth):
/** 
 * Phase 1: Move everything upwards.
 */
private void startUnlockHintAnimationPhase1(final Runnable onAnimationFinished){
  float target=Math.max(0,getMaxPanelHeight() - mHintDistance);
  ValueAnimator animator=createHeightAnimator(target);
  animator.setDuration(250);
  animator.setInterpolator(mFastOutSlowInInterpolator);
  animator.addListener(new AnimatorListenerAdapter(){
    private boolean mCancelled;
    @Override public void onAnimationCancel(    Animator animation){
      mCancelled=true;
    }
    @Override public void onAnimationEnd(    Animator animation){
      if (mCancelled) {
        mHeightAnimator=null;
        onAnimationFinished.run();
      }
 else {
        startUnlockHintAnimationPhase2(onAnimationFinished);
      }
    }
  }
);
  animator.start();
  mHeightAnimator=animator;
  mKeyguardBottomArea.getIndicationView().animate().translationY(-mHintDistance).setDuration(250).setInterpolator(mFastOutSlowInInterpolator).withEndAction(new Runnable(){
    @Override public void run(){
      mKeyguardBottomArea.getIndicationView().animate().translationY(0).setDuration(450).setInterpolator(mBounceInterpolator).start();
    }
  }
).start();
}
Program: 196248
Project: 196248
Buggy source:
/** 
 * Phase 1: Move everything upwards.
 */
private void startUnlockHintAnimationPhase1(final Runnable onAnimationFinished){
  float target=Math.max(0,getMaxPanelHeight() - mHintDistance);
  ValueAnimator animator=createHeightAnimator(target);
  animator.setDuration(250);
  animator.setInterpolator(mFastOutSlowInInterpolator);
  animator.addListener(new AnimatorListenerAdapter(){
    private boolean mCancelled;
    @Override public void onAnimationCancel(    Animator animation){
      mCancelled=true;
    }
    @Override public void onAnimationEnd(    Animator animation){
      if (mCancelled) {
        mHeightAnimator=null;
        onAnimationFinished.run();
      }
 else {
        startUnlockHintAnimationPhase2(onAnimationFinished);
      }
    }
  }
);
  animator.start();
  mHeightAnimator=animator;
  mOriginalIndicationY=mKeyguardBottomArea.getIndicationView().getY();
  mKeyguardBottomArea.getIndicationView().animate().y(mOriginalIndicationY - mHintDistance).setDuration(250).setInterpolator(mFastOutSlowInInterpolator).withEndAction(new Runnable(){
    @Override public void run(){
      mKeyguardBottomArea.getIndicationView().animate().y(mOriginalIndicationY).setDuration(450).setInterpolator(mBounceInterpolator).start();
    }
  }
).start();
}

Fixed version (ground truth):
/** 
 * Phase 1: Move everything upwards.
 */
private void startUnlockHintAnimationPhase1(final Runnable onAnimationFinished){
  float target=Math.max(0,getMaxPanelHeight() - mHintDistance);
  ValueAnimator animator=createHeightAnimator(target);
  animator.setDuration(250);
  animator.setInterpolator(mFastOutSlowInInterpolator);
  animator.addListener(new AnimatorListenerAdapter(){
    private boolean mCancelled;
    @Override public void onAnimationCancel(    Animator animation){
      mCancelled=true;
    }
    @Override public void onAnimationEnd(    Animator animation){
      if (mCancelled) {
        mHeightAnimator=null;
        onAnimationFinished.run();
      }
 else {
        startUnlockHintAnimationPhase2(onAnimationFinished);
      }
    }
  }
);
  animator.start();
  mHeightAnimator=animator;
  mKeyguardBottomArea.getIndicationView().animate().translationY(-mHintDistance).setDuration(250).setInterpolator(mFastOutSlowInInterpolator).withEndAction(new Runnable(){
    @Override public void run(){
      mKeyguardBottomArea.getIndicationView().animate().translationY(0).setDuration(450).setInterpolator(mBounceInterpolator).start();
    }
  }
).start();
}
Program: 196249
Project: 196249
Buggy source:
protected abstract int getDeviceType();

Fixed version (ground truth):
abstract int getDeviceType();
Program: 196250
Project: 196250
Buggy source:
public HdmiClient(IHdmiControlService service){
  mService=service;
}

Fixed version (ground truth):
HdmiClient(IHdmiControlService service){
  mService=service;
}
Program: 196251
Project: 196251
Buggy source:
/** 
 * Send a key event to other logical device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
public void sendKeyEvent(int keyCode,boolean isPressed){
  try {
    mService.sendKeyEvent(getDeviceType(),keyCode,isPressed);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Sends a key event to other logical device.
 * @param keyCode key code to send. Defined in {@link android.view.KeyEvent}.
 * @param isPressed true if this is key press event
 */
public void sendKeyEvent(int keyCode,boolean isPressed){
  try {
    mService.sendKeyEvent(getDeviceType(),keyCode,isPressed);
  }
 catch (  RemoteException e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}