Program: 162537
Project: 162537
Buggy source:
@SuppressWarnings("String_Node_Str") private void createNotification(Context context){
  String notificationService=Context.NOTIFICATION_SERVICE;
  NotificationManager notificationManager=(NotificationManager)context.getSystemService(notificationService);
  InetAddress address=FTPService.getLocalInetAddress(context);
  String iptext="String_Node_Str" + address.getHostAddress() + "String_Node_Str"+ FTPService.getPort()+ "String_Node_Str";
  int icon=R.drawable.ic_ftp_light;
  CharSequence tickerText=context.getResources().getString(R.string.ftp_notif_starting);
  long when=System.currentTimeMillis();
  CharSequence contentTitle=context.getResources().getString(R.string.ftp_notif_title);
  CharSequence contentText=String.format(context.getResources().getString(R.string.ftp_notif_text),iptext);
  Intent notificationIntent=new Intent(context,MainActivity.class);
  notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
  PendingIntent contentIntent=PendingIntent.getActivity(context,0,notificationIntent,0);
  int stopIcon=android.R.drawable.ic_menu_close_clear_cancel;
  CharSequence stopText=context.getResources().getString(R.string.ftp_notif_stop_server);
  Intent stopIntent=new Intent(FTPService.ACTION_STOP_FTPSERVER);
  PendingIntent stopPendingIntent=PendingIntent.getBroadcast(context,0,stopIntent,PendingIntent.FLAG_ONE_SHOT);
  Notification.Builder notificationBuilder=new Notification.Builder(context).setContentTitle(contentTitle).setContentText(contentText).setContentIntent(contentIntent).setSmallIcon(icon).setTicker(tickerText).setWhen(when).setOngoing(true);
  Notification notification=null;
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    notificationBuilder.setVisibility(Notification.VISIBILITY_PUBLIC);
    notificationBuilder.setCategory(Notification.CATEGORY_SERVICE);
    notificationBuilder.setPriority(Notification.PRIORITY_MAX);
  }
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    notificationBuilder.addAction(stopIcon,stopText,stopPendingIntent);
    notificationBuilder.setShowWhen(false);
    notification=notificationBuilder.build();
  }
 else {
    notification=notificationBuilder.getNotification();
  }
  notificationManager.notify(NOTIFICATION_ID,notification);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void createNotification(Context context){
  String notificationService=Context.NOTIFICATION_SERVICE;
  NotificationManager notificationManager=(NotificationManager)context.getSystemService(notificationService);
  InetAddress address=FTPService.getLocalInetAddress(context);
  String iptext="String_Node_Str" + address.getHostAddress() + "String_Node_Str"+ FTPService.getPort(context)+ "String_Node_Str";
  int icon=R.drawable.ic_ftp_light;
  CharSequence tickerText=context.getResources().getString(R.string.ftp_notif_starting);
  long when=System.currentTimeMillis();
  CharSequence contentTitle=context.getResources().getString(R.string.ftp_notif_title);
  CharSequence contentText=String.format(context.getResources().getString(R.string.ftp_notif_text),iptext);
  Intent notificationIntent=new Intent(context,MainActivity.class);
  notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
  PendingIntent contentIntent=PendingIntent.getActivity(context,0,notificationIntent,0);
  int stopIcon=android.R.drawable.ic_menu_close_clear_cancel;
  CharSequence stopText=context.getResources().getString(R.string.ftp_notif_stop_server);
  Intent stopIntent=new Intent(FTPService.ACTION_STOP_FTPSERVER);
  PendingIntent stopPendingIntent=PendingIntent.getBroadcast(context,0,stopIntent,PendingIntent.FLAG_ONE_SHOT);
  Notification.Builder notificationBuilder=new Notification.Builder(context).setContentTitle(contentTitle).setContentText(contentText).setContentIntent(contentIntent).setSmallIcon(icon).setTicker(tickerText).setWhen(when).setOngoing(true);
  Notification notification=null;
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    notificationBuilder.setVisibility(Notification.VISIBILITY_PUBLIC);
    notificationBuilder.setCategory(Notification.CATEGORY_SERVICE);
    notificationBuilder.setPriority(Notification.PRIORITY_MAX);
  }
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    notificationBuilder.addAction(stopIcon,stopText,stopPendingIntent);
    notificationBuilder.setShowWhen(false);
    notification=notificationBuilder.build();
  }
 else {
    notification=notificationBuilder.getNotification();
  }
  notificationManager.notify(NOTIFICATION_ID,notification);
}