Program: 86974
Project: 86974
Buggy source:
public void notificationChanged(){
  Log.d(LOG_TAG,"String_Node_Str");
  if (notificationCardsLayout != null) {
    Log.d(LOG_TAG,"String_Node_Str");
    if (((LinearLayout)notificationCardsLayout).getChildCount() > 0) {
      ((LinearLayout)notificationCardsLayout).removeAllViews();
    }
    for (int i=0; i < NotificationService.currentNotifications.size() && i < MAX_NOTIFICATION_SHOWN; i++) {
      final LockScreenNotification lsn=NotificationService.currentNotifications.get(i);
      final int position=i;
      final CardView cardView=(CardView)inflater.inflate(R.layout.list_item_notification,notificationCardsLayout,false);
      TextView titleTextView=(TextView)cardView.findViewById(R.id.notification_card_title);
      TextView subTextTextView=(TextView)cardView.findViewById(R.id.notification_card_subtext);
      ImageView notificationImageView=(ImageView)cardView.findViewById(R.id.image_view_notification);
      final boolean isClearable=lsn.isClearable();
      final Notification mNotification=lsn.getNotification();
      final Bundle extras=mNotification.extras;
      titleTextView.setText(extras.getString(KEY_NOTIFICATION_TITLE));
      CharSequence charSequence=(CharSequence)extras.getCharSequence(KEY_NOTIFICATION_TEXT);
      if (charSequence != null) {
        subTextTextView.setText(charSequence.toString());
      }
      try {
        int icon=mNotification.icon;
        Bitmap img=(Bitmap)mNotification.extras.get(Notification.EXTRA_LARGE_ICON);
        if (img == null) {
          Drawable app_icon=context.getPackageManager().getApplicationIcon(lsn.getPackageName());
          img=((BitmapDrawable)app_icon).getBitmap();
        }
        notificationImageView.setImageBitmap(Picture.getCroppedBitmap(img,Color.DKGRAY));
      }
 catch (      Exception e) {
        Log.e(LOG_TAG,e.toString());
      }
      cardView.setMaxCardElevation(CARD_NORMAL_ELEVATION);
      cardView.setCardElevation(CARD_NORMAL_ELEVATION);
      cardView.getBackground().setAlpha(CARD_VIEW_NORMAL_ALPHA);
      cardView.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          Log.d(LOG_TAG,"String_Node_Str" + position);
          if (clickedCard == position) {
            try {
              mNotification.contentIntent.send();
              lockScreenDismiss(DEFAULT_START_ANIMATION_VELOCITY);
            }
 catch (            Exception e) {
              Log.e(LOG_TAG,e.toString());
            }
            cardView.setMaxCardElevation(CARD_NORMAL_ELEVATION);
            cardView.setCardElevation(CARD_NORMAL_ELEVATION);
            cardView.getBackground().setAlpha(CARD_VIEW_NORMAL_ALPHA);
          }
 else {
            clickedCard=position;
            cardView.setMaxCardElevation(CARD_TOUCHED_ELEVATION);
            cardView.setCardElevation(CARD_TOUCHED_ELEVATION);
            cardView.getBackground().setAlpha(CARD_VIEW_SELECTED_ALPHA);
            CountDownTimer cdt=new CountDownTimer((long)2000,(long)2000){
              @Override public void onTick(              long millisUntilFinished){
              }
              @Override public void onFinish(){
                clickedCard=-1;
                cardView.setMaxCardElevation(CARD_NORMAL_ELEVATION);
                cardView.setCardElevation(CARD_NORMAL_ELEVATION);
                cardView.getBackground().setAlpha(CARD_VIEW_NORMAL_ALPHA);
              }
            }
.start();
          }
        }
      }
);
      cardView.setOnTouchListener(new CustomFlingListener(context){
        @Override public void onRightToLeft(        float endVelocity){
          Log.d(LOG_TAG,"String_Node_Str");
          if (isClearable) {
            cardView.animate().translationX(-cardView.getWidth()).setInterpolator(new DecelerateInterpolator(endVelocity / 2)).alpha(0f);
            lsn.dismiss(context);
            notificationCardsLayout.removeView(cardView);
          }
 else {
            cardView.animate().translationX(0).setInterpolator(new DecelerateInterpolator(endVelocity / 2)).alpha(1f);
          }
        }
        @Override public void onLeftToRight(        float endVelocity){
          Log.d(LOG_TAG,"String_Node_Str");
          if (isClearable) {
            cardView.animate().translationX(cardView.getWidth()).setInterpolator(new DecelerateInterpolator(endVelocity / 2)).alpha(0f);
            lsn.dismiss(context);
            notificationCardsLayout.removeView(cardView);
          }
 else {
            cardView.animate().translationX(0).setInterpolator(new DecelerateInterpolator(endVelocity / 2)).alpha(1f);
          }
        }
        @Override public void onTopToBottom(        float endVelocity){
          lockScreenDismiss(CustomFlingListener.DIRECTION_DOWN,endVelocity);
          NotificationAreaHelper.expand(context);
        }
        @Override public void onBottomToTop(        float endVelocity){
          lockScreenDismiss(CustomFlingListener.DIRECTION_UP,endVelocity);
        }
        @Override public void onMove(        MotionEvent event,        int direction,        float downRawX,        float downRawY){
          if (direction == CustomFlingListener.DIRECTION_LEFT || direction == CustomFlingListener.DIRECTION_RIGHT) {
            Log.d(LOG_TAG,"String_Node_Str" + downRawX + "String_Node_Str"+ event.getRawX());
            cardView.setTranslationX(event.getRawX() - downRawX);
          }
 else           if (direction == CustomFlingListener.DIRECTION_UP || direction == CustomFlingListener.DIRECTION_DOWN) {
            float deltaY=event.getRawY() - downRawY;
            layout.setTranslationY(deltaY);
          }
        }
        @Override public void onDirectionUnknown(){
          cardView.callOnClick();
        }
        @Override public void onSwipeFail(){
          cardView.animate().translationX(0).start();
          layout.animate().translationY(0).start();
        }
      }
);
      notificationCardsLayout.addView(cardView);
    }
    if (NotificationService.currentNotifications.size() > MAX_NOTIFICATION_SHOWN) {
      final CardView cardView;
      cardView=(CardView)inflater.inflate(R.layout.card_extra_notifications,notificationCardsLayout,false);
      TextView cardExtraTextView=(TextView)cardView.findViewById(R.id.text_view_extra_notifications);
      String title=EXTRA_NOTIFICATION_SUBSTRING_PREFIX + (NotificationService.currentNotifications.size() - MAX_NOTIFICATION_SHOWN) + EXTRA_NOTIFICATION_SUBSTRING_SUFFIX;
      cardExtraTextView.setText(title);
      cardView.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          lockScreenDismiss(CustomFlingListener.DIRECTION_DOWN,DEFAULT_START_ANIMATION_VELOCITY_DOWN);
          NotificationAreaHelper.expand(context);
        }
      }
);
      cardView.setOnTouchListener(new CustomFlingListener(context){
        @Override public void onRightToLeft(        float endVelocity){
          ExternalIntents.launchCamera(context);
          lockScreenDismiss(CustomFlingListener.DIRECTION_LEFT,endVelocity);
        }
        @Override public void onLeftToRight(        float endVelocity){
          ExternalIntents.launchDialer(context);
          lockScreenDismiss(CustomFlingListener.DIRECTION_RIGHT,endVelocity);
        }
        @Override public void onTopToBottom(        float endVelocity){
          lockScreenDismiss(CustomFlingListener.DIRECTION_DOWN,DEFAULT_START_ANIMATION_VELOCITY);
          NotificationAreaHelper.expand(context);
        }
        @Override public void onBottomToTop(        float endVelocity){
          lockScreenDismiss(CustomFlingListener.DIRECTION_UP,DEFAULT_START_ANIMATION_VELOCITY);
        }
        @Override public void onMove(        MotionEvent event,        int direction,        float downRawX,        float downRawY){
          if (direction == CustomFlingListener.DIRECTION_UP || direction == CustomFlingListener.DIRECTION_DOWN) {
            float deltaY=event.getRawY() - downRawY;
            layout.setTranslationY(deltaY);
          }
 else {
            float deltaX=event.getRawX() - downRawX;
            layout.setTranslationX(deltaX);
          }
        }
        @Override public void onSwipeFail(){
          layout.animate().translationY(0).start();
          layout.animate().translationX(0).start();
        }
        @Override public void onDirectionUnknown(){
          cardView.callOnClick();
        }
      }
);
      cardView.getBackground().setAlpha(60);
      notificationCardsLayout.addView(cardView);
    }
  }
}

Fixed version (ground truth):
public void notificationChanged(){
  Log.d(LOG_TAG,"String_Node_Str");
  if (notificationCardsLayout != null) {
    Log.d(LOG_TAG,"String_Node_Str");
    if (((LinearLayout)notificationCardsLayout).getChildCount() > 0) {
      ((LinearLayout)notificationCardsLayout).removeAllViews();
    }
    for (int i=0; i < NotificationService.currentNotifications.size() && i < MAX_NOTIFICATION_SHOWN; i++) {
      final LockScreenNotification lsn=NotificationService.currentNotifications.get(i);
      final int position=i;
      final CardView cardView=(CardView)inflater.inflate(R.layout.list_item_notification,notificationCardsLayout,false);
      TextView titleTextView=(TextView)cardView.findViewById(R.id.notification_card_title);
      TextView subTextTextView=(TextView)cardView.findViewById(R.id.notification_card_subtext);
      ImageView notificationImageView=(ImageView)cardView.findViewById(R.id.image_view_notification);
      final boolean isClearable=lsn.isClearable();
      final Notification mNotification=lsn.getNotification();
      final Bundle extras=mNotification.extras;
      titleTextView.setText(extras.getString(KEY_NOTIFICATION_TITLE));
      CharSequence charSequence=(CharSequence)extras.getCharSequence(KEY_NOTIFICATION_TEXT);
      if (charSequence != null) {
        subTextTextView.setText(charSequence.toString());
      }
      try {
        int icon=mNotification.icon;
        Bitmap img=(Bitmap)mNotification.extras.get(Notification.EXTRA_LARGE_ICON);
        if (img == null) {
          Drawable app_icon=context.getPackageManager().getApplicationIcon(lsn.getPackageName());
          img=((BitmapDrawable)app_icon).getBitmap();
        }
        notificationImageView.setImageBitmap(Picture.getCroppedBitmap(img,Color.DKGRAY));
      }
 catch (      Exception e) {
        Log.e(LOG_TAG,e.toString());
      }
      cardView.setMaxCardElevation(CARD_NORMAL_ELEVATION);
      cardView.setCardElevation(CARD_NORMAL_ELEVATION);
      cardView.getBackground().setAlpha(CARD_VIEW_NORMAL_ALPHA);
      cardView.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          Log.d(LOG_TAG,"String_Node_Str" + position);
          if (clickedCard == position) {
            try {
              mNotification.contentIntent.send();
              lockScreenDismiss(DEFAULT_START_ANIMATION_VELOCITY);
            }
 catch (            Exception e) {
              Log.e(LOG_TAG,e.toString());
            }
            cardView.setMaxCardElevation(CARD_NORMAL_ELEVATION);
            cardView.setCardElevation(CARD_NORMAL_ELEVATION);
            cardView.getBackground().setAlpha(CARD_VIEW_NORMAL_ALPHA);
          }
 else {
            clickedCard=position;
            cardView.setMaxCardElevation(CARD_TOUCHED_ELEVATION);
            cardView.setCardElevation(CARD_TOUCHED_ELEVATION);
            cardView.getBackground().setAlpha(CARD_VIEW_SELECTED_ALPHA);
            CountDownTimer cdt=new CountDownTimer((long)2000,(long)2000){
              @Override public void onTick(              long millisUntilFinished){
              }
              @Override public void onFinish(){
                clickedCard=-1;
                cardView.setMaxCardElevation(CARD_NORMAL_ELEVATION);
                cardView.setCardElevation(CARD_NORMAL_ELEVATION);
                cardView.getBackground().setAlpha(CARD_VIEW_NORMAL_ALPHA);
              }
            }
.start();
          }
        }
      }
);
      cardView.setOnTouchListener(new CustomFlingListener(context){
        @Override public void onRightToLeft(        float endVelocity){
          Log.d(LOG_TAG,"String_Node_Str");
          if (isClearable) {
            cardView.animate().translationX(-cardView.getWidth()).setInterpolator(new DecelerateInterpolator(endVelocity / 2)).alpha(0f);
            lsn.dismiss(context);
            notificationCardsLayout.removeView(cardView);
          }
 else {
            cardView.animate().translationX(0).setInterpolator(new DecelerateInterpolator(endVelocity / 2)).alpha(1f);
          }
        }
        @Override public void onLeftToRight(        float endVelocity){
          Log.d(LOG_TAG,"String_Node_Str");
          if (isClearable) {
            cardView.animate().translationX(cardView.getWidth()).setInterpolator(new DecelerateInterpolator(endVelocity / 2)).alpha(0f);
            lsn.dismiss(context);
            notificationCardsLayout.removeView(cardView);
          }
 else {
            cardView.animate().translationX(0).setInterpolator(new DecelerateInterpolator(endVelocity / 2)).alpha(1f);
          }
        }
        @Override public void onTopToBottom(        float endVelocity){
          lockScreenDismiss(CustomFlingListener.DIRECTION_DOWN,endVelocity);
          NotificationAreaHelper.expand(context);
        }
        @Override public void onBottomToTop(        float endVelocity){
          lockScreenDismiss(CustomFlingListener.DIRECTION_UP,endVelocity);
        }
        @Override public void onMove(        MotionEvent event,        int direction,        float downRawX,        float downRawY){
          if (direction == CustomFlingListener.DIRECTION_LEFT || direction == CustomFlingListener.DIRECTION_RIGHT) {
            Log.d(LOG_TAG,"String_Node_Str" + downRawX + "String_Node_Str"+ event.getRawX());
            cardView.setTranslationX(event.getRawX() - downRawX);
          }
 else           if (direction == CustomFlingListener.DIRECTION_UP || direction == CustomFlingListener.DIRECTION_DOWN) {
            float deltaY=event.getRawY() - downRawY;
            layout.setTranslationY(deltaY);
          }
        }
        @Override public void onDirectionUnknown(){
          cardView.callOnClick();
        }
        @Override public void onSwipeFail(){
          cardView.animate().translationX(0).start();
          layout.animate().translationY(0).start();
        }
      }
);
      notificationCardsLayout.addView(cardView);
    }
    if (NotificationService.currentNotifications.size() > MAX_NOTIFICATION_SHOWN) {
      final CardView cardView;
      cardView=(CardView)inflater.inflate(R.layout.card_extra_notifications,notificationCardsLayout,false);
      TextView cardExtraTextView=(TextView)cardView.findViewById(R.id.text_view_extra_notifications);
      String title=EXTRA_NOTIFICATION_SUBSTRING_PREFIX + (NotificationService.currentNotifications.size() - MAX_NOTIFICATION_SHOWN) + EXTRA_NOTIFICATION_SUBSTRING_SUFFIX;
      cardExtraTextView.setText(title);
      cardView.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          lockScreenDismiss(CustomFlingListener.DIRECTION_DOWN,DEFAULT_START_ANIMATION_VELOCITY_DOWN);
          NotificationAreaHelper.expand(context);
        }
      }
);
      cardView.setOnTouchListener(new CustomFlingListener(context){
        @Override public void onRightToLeft(        float endVelocity){
          ExternalIntents.launchCamera(context);
          lockScreenDismiss(CustomFlingListener.DIRECTION_LEFT,endVelocity);
        }
        @Override public void onLeftToRight(        float endVelocity){
          ExternalIntents.launchDialer(context);
          lockScreenDismiss(CustomFlingListener.DIRECTION_RIGHT,endVelocity);
        }
        @Override public void onTopToBottom(        float endVelocity){
          lockScreenDismiss(CustomFlingListener.DIRECTION_DOWN,endVelocity);
          NotificationAreaHelper.expand(context);
        }
        @Override public void onBottomToTop(        float endVelocity){
          lockScreenDismiss(CustomFlingListener.DIRECTION_UP,endVelocity);
        }
        @Override public void onMove(        MotionEvent event,        int direction,        float downRawX,        float downRawY){
          if (direction == CustomFlingListener.DIRECTION_UP || direction == CustomFlingListener.DIRECTION_DOWN) {
            float deltaY=event.getRawY() - downRawY;
            layout.setTranslationY(deltaY);
          }
 else {
            float deltaX=event.getRawX() - downRawX;
            layout.setTranslationX(deltaX);
          }
        }
        @Override public void onSwipeFail(){
          layout.animate().translationY(0).start();
          layout.animate().translationX(0).start();
        }
        @Override public void onDirectionUnknown(){
          cardView.callOnClick();
        }
      }
);
      cardView.getBackground().setAlpha(60);
      notificationCardsLayout.addView(cardView);
    }
  }
}