Program: 42872
Project: 42872
Buggy source:
void performAddUpdateIcon(IBinder key,IconData data,NotificationData n) throws StatusBarException {
  if (DBG) {
    Log.d(TAG,"String_Node_Str" + data + "String_Node_Str"+ n+ "String_Node_Str"+ key);
  }
  if (n != null) {
    StatusBarNotification notification=getNotification(key);
    NotificationData oldData=null;
    if (notification == null) {
      notification=new StatusBarNotification();
      notification.key=key;
      notification.data=n;
synchronized (mNotificationData) {
        mNotificationData.add(notification);
      }
      addNotificationView(notification);
      setAreThereNotifications();
    }
 else {
      oldData=notification.data;
      notification.data=n;
      updateNotificationView(notification,oldData);
    }
    if (n.tickerText != null && mStatusBarView.getWindowToken() != null && (oldData == null || oldData.tickerText == null || !CharSequences.equals(oldData.tickerText,n.tickerText))) {
      if ((mDisabled & StatusBarManager.DISABLE_NOTIFICATION_ICONS) == 0) {
        mTicker.addEntry(n,StatusBarIcon.getIcon(mContext,data),n.tickerText);
      }
    }
    updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
  }
synchronized (mIconMap) {
    StatusBarIcon icon=mIconMap.get(key);
    if (icon == null) {
      LinearLayout v=n == null ? mStatusIcons : mNotificationIcons;
      icon=new StatusBarIcon(mContext,data,v);
      mIconMap.put(key,icon);
      mIconList.add(icon);
      if (n == null) {
        int slotIndex=getRightIconIndex(data.slot);
        StatusBarIcon[] rightIcons=mRightIcons;
        if (rightIcons[slotIndex] == null) {
          int pos=0;
          for (int i=mRightIcons.length - 1; i > slotIndex; i--) {
            StatusBarIcon ic=rightIcons[i];
            if (ic != null) {
              pos++;
            }
          }
          rightIcons[slotIndex]=icon;
          mStatusIcons.addView(icon.view,pos);
        }
 else {
          Log.e(TAG,"String_Node_Str" + slotIndex + "String_Node_Str"+ data.slot);
          mIconMap.remove(key);
          mIconList.remove(icon);
          return;
        }
      }
 else {
        int iconIndex=mNotificationData.getIconIndex(n);
        mNotificationIcons.addView(icon.view,iconIndex);
      }
    }
 else {
      if (n == null) {
        icon.update(mContext,data);
      }
 else {
        ViewGroup parent=(ViewGroup)icon.view.getParent();
        parent.removeView(icon.view);
        icon.update(mContext,data);
        int iconIndex=mNotificationData.getIconIndex(n);
        mNotificationIcons.addView(icon.view,iconIndex);
      }
    }
  }
}

Fixed version (ground truth):
void performAddUpdateIcon(IBinder key,IconData data,NotificationData n) throws StatusBarException {
  if (SPEW) {
    Log.d(TAG,"String_Node_Str" + data + "String_Node_Str"+ n+ "String_Node_Str"+ key);
  }
  if (n != null) {
    StatusBarNotification notification=getNotification(key);
    NotificationData oldData=null;
    if (notification == null) {
      notification=new StatusBarNotification();
      notification.key=key;
      notification.data=n;
synchronized (mNotificationData) {
        mNotificationData.add(notification);
      }
      addNotificationView(notification);
      setAreThereNotifications();
    }
 else {
      oldData=notification.data;
      notification.data=n;
      updateNotificationView(notification,oldData);
    }
    if (n.tickerText != null && mStatusBarView.getWindowToken() != null && (oldData == null || oldData.tickerText == null || !CharSequences.equals(oldData.tickerText,n.tickerText))) {
      if ((mDisabled & StatusBarManager.DISABLE_NOTIFICATION_ICONS) == 0) {
        mTicker.addEntry(n,StatusBarIcon.getIcon(mContext,data),n.tickerText);
      }
    }
    updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
  }
synchronized (mIconMap) {
    StatusBarIcon icon=mIconMap.get(key);
    if (icon == null) {
      LinearLayout v=n == null ? mStatusIcons : mNotificationIcons;
      icon=new StatusBarIcon(mContext,data,v);
      mIconMap.put(key,icon);
      mIconList.add(icon);
      if (n == null) {
        int slotIndex=getRightIconIndex(data.slot);
        StatusBarIcon[] rightIcons=mRightIcons;
        if (rightIcons[slotIndex] == null) {
          int pos=0;
          for (int i=mRightIcons.length - 1; i > slotIndex; i--) {
            StatusBarIcon ic=rightIcons[i];
            if (ic != null) {
              pos++;
            }
          }
          rightIcons[slotIndex]=icon;
          mStatusIcons.addView(icon.view,pos);
        }
 else {
          Log.e(TAG,"String_Node_Str" + slotIndex + "String_Node_Str"+ data.slot);
          mIconMap.remove(key);
          mIconList.remove(icon);
          return;
        }
      }
 else {
        int iconIndex=mNotificationData.getIconIndex(n);
        mNotificationIcons.addView(icon.view,iconIndex);
      }
    }
 else {
      if (n == null) {
        icon.update(mContext,data);
      }
 else {
        ViewGroup parent=(ViewGroup)icon.view.getParent();
        parent.removeView(icon.view);
        icon.update(mContext,data);
        int iconIndex=mNotificationData.getIconIndex(n);
        mNotificationIcons.addView(icon.view,iconIndex);
      }
    }
  }
}