Program: 14942
Project: 14942
Buggy source:
@Override protected void onMessage(Context context,Intent intent){
  Log.v("String_Node_Str","String_Node_Str");
  if (!WordPress.hasValidWPComCredentials(context))   return;
  Bundle extras=intent.getExtras();
  if (extras == null) {
    Log.v("String_Node_Str","String_Node_Str");
    return;
  }
  String title=extras.getString("String_Node_Str");
  if (title == null)   title="String_Node_Str";
  String message=StringUtils.unescapeHTML(extras.getString("String_Node_Str"));
  String note_id=extras.getString("String_Node_Str");
  Note note=null;
  if (extras.getString("String_Node_Str") != null) {
    byte[] decode=Base64.decode(intent.getStringExtra("String_Node_Str"),Base64.DEFAULT);
    String unzippedString=NotificationUtils.unzipString(decode);
    JSONObject jsonObject=null;
    try {
      jsonObject=new JSONObject(unzippedString);
      JSONArray notesJSON=jsonObject.getJSONArray("String_Node_Str");
      note=new Note(notesJSON.getJSONObject(0));
      WordPress.wpDB.addNote(note,false);
    }
 catch (    JSONException e) {
      Log.e(WordPress.TAG,"String_Node_Str" + e);
    }
  }
 else {
    note=new Note(extras);
    WordPress.wpDB.addNote(note,true);
    refreshNotes();
  }
  boolean md5GeneratedNoteId=false;
  if (note_id == null && note != null) {
    note_id=String.valueOf(WordPressDB.generateIdFor(note));
    md5GeneratedNoteId=true;
  }
  long thisTime=System.currentTimeMillis();
  if (mPreviousNoteId != null && mPreviousNoteId.equals(note_id)) {
    long seconds=TimeUnit.MILLISECONDS.toSeconds(thisTime - mPreviousNoteTime);
    if (seconds <= 1) {
      Log.w("String_Node_Str","String_Node_Str");
      return;
    }
  }
  mPreviousNoteId=note_id;
  mPreviousNoteTime=thisTime;
  if (note_id != null) {
    if (!activeNotificationsMap.containsKey(note_id))     activeNotificationsMap.put(note_id,extras);
  }
  String iconURL=extras.getString("String_Node_Str");
  Bitmap largeIconBitmap=null;
  if (iconURL != null) {
    try {
      iconURL=URLDecoder.decode(iconURL,"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
    float screenDensity=getResources().getDisplayMetrics().densityDpi;
    int size=Math.round(64 * (screenDensity / 160));
    String resizedURL=iconURL.replaceAll("String_Node_Str","String_Node_Str" + size);
    largeIconBitmap=ImageHelper.downloadBitmap(resizedURL);
  }
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  boolean sound, vibrate, light;
  sound=prefs.getBoolean("String_Node_Str",false);
  vibrate=prefs.getBoolean("String_Node_Str",false);
  light=prefs.getBoolean("String_Node_Str",false);
  NotificationCompat.Builder mBuilder;
  Intent resultIntent=new Intent(this,PostsActivity.class);
  resultIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
  resultIntent.setAction("String_Node_Str");
  resultIntent.addCategory("String_Node_Str");
  resultIntent.putExtra(NotificationsActivity.FROM_NOTIFICATION_EXTRA,true);
  if (activeNotificationsMap.size() <= 1) {
    mBuilder=new NotificationCompat.Builder(this).setSmallIcon(R.drawable.notification_icon).setContentTitle(title).setContentText(message).setTicker(message).setAutoCancel(true).setStyle(new NotificationCompat.BigTextStyle().bigText(message));
    if (md5GeneratedNoteId)     resultIntent.putExtra(NotificationsActivity.MD5_NOTE_ID_EXTRA,note_id);
    if (note_id != null)     resultIntent.putExtra(NotificationsActivity.NOTE_ID_EXTRA,note_id);
    String noteType=extras.getString("String_Node_Str");
    if (noteType != null && noteType.equals("String_Node_Str")) {
      Intent commentReplyIntent=new Intent(this,PostsActivity.class);
      commentReplyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
      commentReplyIntent.setAction("String_Node_Str");
      commentReplyIntent.addCategory("String_Node_Str");
      commentReplyIntent.addCategory("String_Node_Str");
      commentReplyIntent.putExtra(NotificationsActivity.FROM_NOTIFICATION_EXTRA,true);
      commentReplyIntent.putExtra(NotificationsActivity.NOTE_INSTANT_REPLY_EXTRA,true);
      if (note_id != null)       commentReplyIntent.putExtra(NotificationsActivity.NOTE_ID_EXTRA,note_id);
      PendingIntent commentReplyPendingIntent=PendingIntent.getActivity(context,0,commentReplyIntent,PendingIntent.FLAG_CANCEL_CURRENT);
      mBuilder.addAction(R.drawable.ab_icon_reply,getResources().getText(R.string.reply),commentReplyPendingIntent);
    }
    if (largeIconBitmap != null) {
      mBuilder.setLargeIcon(largeIconBitmap);
    }
  }
 else {
    NotificationCompat.InboxStyle inboxStyle=new NotificationCompat.InboxStyle();
    int noteCtr=1;
    for (    Bundle wpNotification : activeNotificationsMap.values()) {
      if (noteCtr > 5)       break;
      if (wpNotification.getString("String_Node_Str") != null) {
        if (wpNotification.getString("String_Node_Str").equals("String_Node_Str"))         inboxStyle.addLine(wpNotification.getString("String_Node_Str") + "String_Node_Str" + wpNotification.getString("String_Node_Str"));
 else         inboxStyle.addLine(wpNotification.getString("String_Node_Str"));
        noteCtr++;
      }
    }
    if (activeNotificationsMap.size() > 5)     inboxStyle.setSummaryText(String.format(getString(R.string.more_notifications),activeNotificationsMap.size() - 5));
    String subject=String.format(getString(R.string.new_notifications),activeNotificationsMap.size());
    mBuilder=new NotificationCompat.Builder(this).setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.notification_multi)).setSmallIcon(R.drawable.notification_icon).setContentTitle("String_Node_Str").setContentText(subject).setTicker(message).setAutoCancel(true).setStyle(inboxStyle);
  }
  if (sound)   mBuilder.setSound(Uri.parse("String_Node_Str" + getPackageName() + "String_Node_Str"+ R.raw.notification));
  if (vibrate)   mBuilder.setVibrate(new long[]{500,500,500});
  if (light)   mBuilder.setLights(0xff0000ff,1000,5000);
  PendingIntent pendingIntent=PendingIntent.getActivity(context,0,resultIntent,PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_UPDATE_CURRENT);
  mBuilder.setContentIntent(pendingIntent);
  NotificationManager mNotificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  mNotificationManager.notify(notificationId,mBuilder.build());
  broadcastNewNotification();
}

Fixed version (ground truth):
@Override protected void onMessage(Context context,Intent intent){
  Log.v("String_Node_Str","String_Node_Str");
  if (!WordPress.hasValidWPComCredentials(context))   return;
  Bundle extras=intent.getExtras();
  if (extras == null) {
    Log.v("String_Node_Str","String_Node_Str");
    return;
  }
  long wpcomUserID=UserPrefs.getCurrentUserId();
  if (wpcomUserID <= 0) {
  }
 else {
    String userIDFromPN=extras.getString("String_Node_Str");
    if (!String.valueOf(wpcomUserID).equals(userIDFromPN)) {
      Log.e("String_Node_Str","String_Node_Str");
      return;
    }
  }
  String title=extras.getString("String_Node_Str");
  if (title == null)   title="String_Node_Str";
  String message=StringUtils.unescapeHTML(extras.getString("String_Node_Str"));
  String note_id=extras.getString("String_Node_Str");
  Note note=null;
  if (extras.getString("String_Node_Str") != null) {
    byte[] decode=Base64.decode(intent.getStringExtra("String_Node_Str"),Base64.DEFAULT);
    String unzippedString=NotificationUtils.unzipString(decode);
    JSONObject jsonObject=null;
    try {
      jsonObject=new JSONObject(unzippedString);
      JSONArray notesJSON=jsonObject.getJSONArray("String_Node_Str");
      note=new Note(notesJSON.getJSONObject(0));
      WordPress.wpDB.addNote(note,false);
    }
 catch (    JSONException e) {
      Log.e(WordPress.TAG,"String_Node_Str" + e);
    }
  }
 else {
    note=new Note(extras);
    WordPress.wpDB.addNote(note,true);
    refreshNotes();
  }
  boolean md5GeneratedNoteId=false;
  if (note_id == null && note != null) {
    note_id=String.valueOf(WordPressDB.generateIdFor(note));
    md5GeneratedNoteId=true;
  }
  long thisTime=System.currentTimeMillis();
  if (mPreviousNoteId != null && mPreviousNoteId.equals(note_id)) {
    long seconds=TimeUnit.MILLISECONDS.toSeconds(thisTime - mPreviousNoteTime);
    if (seconds <= 1) {
      Log.w("String_Node_Str","String_Node_Str");
      return;
    }
  }
  mPreviousNoteId=note_id;
  mPreviousNoteTime=thisTime;
  if (note_id != null) {
    if (!activeNotificationsMap.containsKey(note_id))     activeNotificationsMap.put(note_id,extras);
  }
  String iconURL=extras.getString("String_Node_Str");
  Bitmap largeIconBitmap=null;
  if (iconURL != null) {
    try {
      iconURL=URLDecoder.decode(iconURL,"String_Node_Str");
    }
 catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
    float screenDensity=getResources().getDisplayMetrics().densityDpi;
    int size=Math.round(64 * (screenDensity / 160));
    String resizedURL=iconURL.replaceAll("String_Node_Str","String_Node_Str" + size);
    largeIconBitmap=ImageHelper.downloadBitmap(resizedURL);
  }
  SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  boolean sound, vibrate, light;
  sound=prefs.getBoolean("String_Node_Str",false);
  vibrate=prefs.getBoolean("String_Node_Str",false);
  light=prefs.getBoolean("String_Node_Str",false);
  NotificationCompat.Builder mBuilder;
  Intent resultIntent=new Intent(this,PostsActivity.class);
  resultIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
  resultIntent.setAction("String_Node_Str");
  resultIntent.addCategory("String_Node_Str");
  resultIntent.putExtra(NotificationsActivity.FROM_NOTIFICATION_EXTRA,true);
  if (activeNotificationsMap.size() <= 1) {
    mBuilder=new NotificationCompat.Builder(this).setSmallIcon(R.drawable.notification_icon).setContentTitle(title).setContentText(message).setTicker(message).setAutoCancel(true).setStyle(new NotificationCompat.BigTextStyle().bigText(message));
    if (md5GeneratedNoteId)     resultIntent.putExtra(NotificationsActivity.MD5_NOTE_ID_EXTRA,note_id);
    if (note_id != null)     resultIntent.putExtra(NotificationsActivity.NOTE_ID_EXTRA,note_id);
    String noteType=extras.getString("String_Node_Str");
    if (noteType != null && noteType.equals("String_Node_Str")) {
      Intent commentReplyIntent=new Intent(this,PostsActivity.class);
      commentReplyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | IntentCompat.FLAG_ACTIVITY_CLEAR_TASK);
      commentReplyIntent.setAction("String_Node_Str");
      commentReplyIntent.addCategory("String_Node_Str");
      commentReplyIntent.addCategory("String_Node_Str");
      commentReplyIntent.putExtra(NotificationsActivity.FROM_NOTIFICATION_EXTRA,true);
      commentReplyIntent.putExtra(NotificationsActivity.NOTE_INSTANT_REPLY_EXTRA,true);
      if (note_id != null)       commentReplyIntent.putExtra(NotificationsActivity.NOTE_ID_EXTRA,note_id);
      PendingIntent commentReplyPendingIntent=PendingIntent.getActivity(context,0,commentReplyIntent,PendingIntent.FLAG_CANCEL_CURRENT);
      mBuilder.addAction(R.drawable.ab_icon_reply,getResources().getText(R.string.reply),commentReplyPendingIntent);
    }
    if (largeIconBitmap != null) {
      mBuilder.setLargeIcon(largeIconBitmap);
    }
  }
 else {
    NotificationCompat.InboxStyle inboxStyle=new NotificationCompat.InboxStyle();
    int noteCtr=1;
    for (    Bundle wpNotification : activeNotificationsMap.values()) {
      if (noteCtr > 5)       break;
      if (wpNotification.getString("String_Node_Str") != null) {
        if (wpNotification.getString("String_Node_Str").equals("String_Node_Str"))         inboxStyle.addLine(wpNotification.getString("String_Node_Str") + "String_Node_Str" + wpNotification.getString("String_Node_Str"));
 else         inboxStyle.addLine(wpNotification.getString("String_Node_Str"));
        noteCtr++;
      }
    }
    if (activeNotificationsMap.size() > 5)     inboxStyle.setSummaryText(String.format(getString(R.string.more_notifications),activeNotificationsMap.size() - 5));
    String subject=String.format(getString(R.string.new_notifications),activeNotificationsMap.size());
    mBuilder=new NotificationCompat.Builder(this).setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.notification_multi)).setSmallIcon(R.drawable.notification_icon).setContentTitle("String_Node_Str").setContentText(subject).setTicker(message).setAutoCancel(true).setStyle(inboxStyle);
  }
  if (sound)   mBuilder.setSound(Uri.parse("String_Node_Str" + getPackageName() + "String_Node_Str"+ R.raw.notification));
  if (vibrate)   mBuilder.setVibrate(new long[]{500,500,500});
  if (light)   mBuilder.setLights(0xff0000ff,1000,5000);
  PendingIntent pendingIntent=PendingIntent.getActivity(context,0,resultIntent,PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_UPDATE_CURRENT);
  mBuilder.setContentIntent(pendingIntent);
  NotificationManager mNotificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
  mNotificationManager.notify(notificationId,mBuilder.build());
  broadcastNewNotification();
}