Program: 26631
Project: 26631
Buggy source:
/** 
 * Builds a notification and shows it
 * @param item object
 * @return true if successful
 */
@SuppressLint("String_Node_Str") public boolean buildNotif(NotificationItem item,boolean isAlarm){
  Log.i(NOTABLE,"String_Node_Str" + item.getID());
  Log.i(NOTABLE,"String_Node_Str" + item.getTitle());
  Log.i(NOTABLE,"String_Node_Str" + item.getTime());
  Log.i(NOTABLE,"String_Node_Str" + item.getIcon());
  int smallicon=R.drawable.ic_stat_status_icon;
  int iconId=R.drawable.ic_checkmark_gray;
  if (item.getIcon().equals("String_Node_Str")) {
  }
 else   if (item.getIcon().equals("String_Node_Str"))   iconId=R.drawable.ic_checkmark_orange;
 else   if (item.getIcon().equals("String_Node_Str"))   iconId=R.drawable.ic_checkmark_red;
 else   if (item.getIcon().equals("String_Node_Str"))   iconId=R.drawable.ic_checkmark_green;
  Bitmap icon=BitmapFactory.decodeResource(cxt.getResources(),iconId);
  String[] input=item.getLongText().toString().split("String_Node_Str");
  String secondLine, tickerText=item.getTitle();
  if (input.length < 2 && input[0].length() < 2) {
    secondLine="String_Node_Str";
  }
 else {
    secondLine=input[0];
    tickerText+="String_Node_Str" + secondLine;
  }
  if (input.length > 1) {
    secondLine+="String_Node_Str";
  }
  String longtext=item.getLongText();
  if (item.getReminderTime() > 0) {
    String alarmString="String_Node_Str" + DateFormat.getLongDateFormat(cxt).format(item.getReminderTime()) + "String_Node_Str"+ DateFormat.getTimeFormat(cxt).format(item.getReminderTime());
    secondLine+=alarmString;
    longtext+=alarmString;
  }
  Integer pref=Integer.parseInt(PreferenceManager.getDefaultSharedPreferences(cxt).getString("String_Node_Str","String_Node_Str"));
  Intent j=new Intent(cxt,com.icechen1.notable.library.MainActivity_.class);
  Bundle jBundle=new Bundle();
  jBundle.putInt("String_Node_Str",item.getID());
  j.putExtras(jBundle);
  PendingIntent jIntent=PendingIntent.getActivity(cxt,item.getID(),j,PendingIntent.FLAG_CANCEL_CURRENT);
  Intent s=new Intent(cxt,com.icechen1.notable.library.NotificationService_.class);
  Bundle smBundle=new Bundle();
  smBundle.putString("String_Node_Str","String_Node_Str");
  smBundle.putInt("String_Node_Str",item.getID());
  s.putExtras(smBundle);
  PendingIntent spIntent=PendingIntent.getService(cxt,item.getID(),s,PendingIntent.FLAG_CANCEL_CURRENT);
  PendingIntent pIntent;
  if (pref == 2) {
    Intent i=new Intent(cxt,com.icechen1.notable.library.DetailActivity_.class);
    Bundle iBundle=new Bundle();
    iBundle.putInt("String_Node_Str",item.getID());
    i.putExtras(iBundle);
    pIntent=PendingIntent.getActivity(cxt,item.getID(),i,PendingIntent.FLAG_CANCEL_CURRENT);
  }
 else {
    if (pref == 3) {
      pIntent=jIntent;
    }
 else {
      pIntent=spIntent;
    }
  }
  String title;
  if (isAlarm) {
    title=cxt.getResources().getString(R.string.alarm) + "String_Node_Str" + item.getTitle();
  }
 else {
    title=item.getTitle();
  }
  NotificationCompat.Builder builder=new NotificationCompat.Builder(cxt).setContentTitle(title).setContentText(secondLine).setSmallIcon(smallicon).setContentIntent(pIntent).setStyle(new NotificationCompat.BigTextStyle().bigText(longtext)).setTicker(tickerText).setPriority(Notification.PRIORITY_HIGH).setWhen(item.getTime()).setDeleteIntent(spIntent).setVisibility(Notification.VISIBILITY_SECRET).setLargeIcon(icon);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    builder.setGroup("String_Node_Str");
  }
  if (PreferenceManager.getDefaultSharedPreferences(cxt).getBoolean("String_Node_Str",true)) {
    builder.addAction(R.drawable.ic_action_image_edit_dark,cxt.getResources().getString(R.string.edit),jIntent).addAction(R.drawable.ic_action_ic_done,cxt.getResources().getString(R.string.done),spIntent);
  }
  Notification noti=builder.build();
  noti.deleteIntent=spIntent;
  if (PreferenceManager.getDefaultSharedPreferences(cxt).getString("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
    try {
      if (Build.VERSION.SDK_INT > 15) {
        noti.priority=Notification.PRIORITY_LOW;
      }
    }
 catch (    Exception e) {
    }
  }
  if (PreferenceManager.getDefaultSharedPreferences(cxt).getString("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
    try {
      if (Build.VERSION.SDK_INT > 15) {
        noti.priority=Notification.PRIORITY_MIN;
      }
    }
 catch (    Exception e) {
    }
  }
  if (isAlarm) {
    noti.priority=Notification.PRIORITY_HIGH;
    noti.flags|=Notification.FLAG_ONGOING_EVENT;
    noti.flags|=Notification.FLAG_NO_CLEAR;
    noti.flags|=Notification.FLAG_SHOW_LIGHTS;
    noti.when=Calendar.getInstance().getTimeInMillis();
    noti.defaults|=Notification.DEFAULT_VIBRATE;
    noti.defaults|=Notification.DEFAULT_LIGHTS;
    String strRingtonePreference=PreferenceManager.getDefaultSharedPreferences(cxt).getString("String_Node_Str","String_Node_Str");
    noti.sound=Uri.parse(strRingtonePreference);
  }
  NotificationManagerCompat notificationManager=NotificationManagerCompat.from(cxt);
  if (PreferenceManager.getDefaultSharedPreferences(cxt).getBoolean("String_Node_Str",false)) {
  }
 else {
    noti.flags|=Notification.FLAG_ONGOING_EVENT;
    noti.flags|=Notification.FLAG_NO_CLEAR;
  }
  notificationManager.notify(item.getID(),noti);
  return true;
}

Fixed version (ground truth):
/** 
 * Builds a notification and shows it
 * @param item object
 * @return true if successful
 */
@SuppressLint("String_Node_Str") public boolean buildNotif(NotificationItem item,boolean isAlarm){
  Log.i(NOTABLE,"String_Node_Str" + item.getID());
  Log.i(NOTABLE,"String_Node_Str" + item.getTitle());
  Log.i(NOTABLE,"String_Node_Str" + item.getTime());
  Log.i(NOTABLE,"String_Node_Str" + item.getIcon());
  int smallicon=R.drawable.ic_stat_status_icon;
  int iconId=R.drawable.ic_checkmark_gray;
  if (item.getIcon().equals(NotificationItem.CHECKMARK_GRAY)) {
  }
 else   if (item.getIcon().equals(NotificationItem.CHECKMARK_ORANGE))   iconId=R.drawable.ic_checkmark_orange;
 else   if (item.getIcon().equals(NotificationItem.CHECKMARK_RED))   iconId=R.drawable.ic_checkmark_red;
 else   if (item.getIcon().equals(NotificationItem.CHECKMARK_GREEN))   iconId=R.drawable.ic_checkmark_green;
  Bitmap icon=BitmapFactory.decodeResource(cxt.getResources(),iconId);
  String[] input=item.getLongText().toString().split("String_Node_Str");
  String secondLine, tickerText=item.getTitle();
  if (input.length < 2 && input[0].length() < 2) {
    secondLine="String_Node_Str";
  }
 else {
    secondLine=input[0];
    tickerText+="String_Node_Str" + secondLine;
  }
  if (input.length > 1) {
    secondLine+="String_Node_Str";
  }
  String longtext=item.getLongText();
  if (item.getReminderTime() > 0) {
    String alarmString="String_Node_Str" + DateFormat.getLongDateFormat(cxt).format(item.getReminderTime()) + "String_Node_Str"+ DateFormat.getTimeFormat(cxt).format(item.getReminderTime());
    secondLine+=alarmString;
    longtext+=alarmString;
  }
  Integer pref=Integer.parseInt(PreferenceManager.getDefaultSharedPreferences(cxt).getString("String_Node_Str","String_Node_Str"));
  Intent j=new Intent(cxt,com.icechen1.notable.library.MainActivity_.class);
  Bundle jBundle=new Bundle();
  jBundle.putInt("String_Node_Str",item.getID());
  j.putExtras(jBundle);
  PendingIntent jIntent=PendingIntent.getActivity(cxt,item.getID(),j,PendingIntent.FLAG_CANCEL_CURRENT);
  Intent s=new Intent(cxt,com.icechen1.notable.library.NotificationService_.class);
  Bundle smBundle=new Bundle();
  smBundle.putString("String_Node_Str","String_Node_Str");
  smBundle.putInt("String_Node_Str",item.getID());
  s.putExtras(smBundle);
  PendingIntent spIntent=PendingIntent.getService(cxt,item.getID(),s,PendingIntent.FLAG_CANCEL_CURRENT);
  PendingIntent pIntent;
  if (pref == 2) {
    Intent i=new Intent(cxt,com.icechen1.notable.library.DetailActivity_.class);
    Bundle iBundle=new Bundle();
    iBundle.putInt("String_Node_Str",item.getID());
    i.putExtras(iBundle);
    pIntent=PendingIntent.getActivity(cxt,item.getID(),i,PendingIntent.FLAG_CANCEL_CURRENT);
  }
 else {
    if (pref == 3) {
      pIntent=jIntent;
    }
 else {
      pIntent=spIntent;
    }
  }
  String title;
  if (isAlarm) {
    title=cxt.getResources().getString(R.string.alarm) + "String_Node_Str" + item.getTitle();
  }
 else {
    title=item.getTitle();
  }
  NotificationCompat.Builder builder=new NotificationCompat.Builder(cxt).setContentTitle(title).setContentText(secondLine).setSmallIcon(smallicon).setContentIntent(pIntent).setStyle(new NotificationCompat.BigTextStyle().bigText(longtext)).setTicker(tickerText).setPriority(Notification.PRIORITY_HIGH).setWhen(item.getTime()).setDeleteIntent(spIntent).setVisibility(Notification.VISIBILITY_SECRET).setLargeIcon(icon);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    builder.setGroup("String_Node_Str");
  }
  if (PreferenceManager.getDefaultSharedPreferences(cxt).getBoolean("String_Node_Str",true)) {
    builder.addAction(R.drawable.ic_action_image_edit_dark,cxt.getResources().getString(R.string.edit),jIntent).addAction(R.drawable.ic_action_ic_done,cxt.getResources().getString(R.string.done),spIntent);
  }
  Notification noti=builder.build();
  noti.deleteIntent=spIntent;
  if (PreferenceManager.getDefaultSharedPreferences(cxt).getString("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
    try {
      if (Build.VERSION.SDK_INT > 15) {
        noti.priority=Notification.PRIORITY_LOW;
      }
    }
 catch (    Exception e) {
    }
  }
  if (PreferenceManager.getDefaultSharedPreferences(cxt).getString("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
    try {
      if (Build.VERSION.SDK_INT > 15) {
        noti.priority=Notification.PRIORITY_MIN;
      }
    }
 catch (    Exception e) {
    }
  }
  if (isAlarm) {
    noti.priority=Notification.PRIORITY_HIGH;
    noti.flags|=Notification.FLAG_ONGOING_EVENT;
    noti.flags|=Notification.FLAG_NO_CLEAR;
    noti.flags|=Notification.FLAG_SHOW_LIGHTS;
    noti.when=Calendar.getInstance().getTimeInMillis();
    noti.defaults|=Notification.DEFAULT_VIBRATE;
    noti.defaults|=Notification.DEFAULT_LIGHTS;
    String strRingtonePreference=PreferenceManager.getDefaultSharedPreferences(cxt).getString("String_Node_Str","String_Node_Str");
    noti.sound=Uri.parse(strRingtonePreference);
  }
  NotificationManagerCompat notificationManager=NotificationManagerCompat.from(cxt);
  if (PreferenceManager.getDefaultSharedPreferences(cxt).getBoolean("String_Node_Str",false)) {
  }
 else {
    noti.flags|=Notification.FLAG_ONGOING_EVENT;
    noti.flags|=Notification.FLAG_NO_CLEAR;
  }
  notificationManager.notify(item.getID(),noti);
  return true;
}