Program: 80566
Project: 80566
Buggy source:
public void createNotification(ArrayList<Tools.TaskInfo> taskList){
  String taskPackage=this.getPackageName();
  Context mContext=getApplicationContext();
  int contLayout=prefs.getBoolean(Settings.ROW_DIVIDER_PREFERENCE,Settings.ROW_DIVIDER_DEFAULT) ? getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage) : getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage);
  int rowLayout=prefs.getBoolean(Settings.DIVIDER_PREFERENCE,Settings.DIVIDER_DEFAULT) ? getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage) : getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage);
  int imageButtonLayout=getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage);
  int imageContLayout=getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage);
  RemoteViews customNotifView=new RemoteViews(taskPackage,contLayout);
  RemoteViews customNotifBigView=customNotifView;
  AppDrawer appDrawer=new AppDrawer(taskPackage);
  appDrawer.createRow(rowLayout,R.id.notifRow);
  appDrawer.setImageLayouts(imageButtonLayout,imageContLayout);
  appDrawer.setPrefs(prefs);
  appDrawer.setContext(mContext);
  int maxButtons;
  int setPriority=Integer.parseInt(prefs.getString(Settings.PRIORITY_PREFERENCE,Integer.toString(Settings.PRIORITY_DEFAULT)));
  if (taskList.size() < numOfApps) {
    maxButtons=taskList.size();
  }
 else {
    maxButtons=numOfApps;
  }
  if (taskList.size() <= numOfApps) {
    Tools.HangarLog("String_Node_Str");
    secondRow=false;
  }
  Tools.HangarLog("String_Node_Str" + taskList.size() + "String_Node_Str"+ numOfApps+ "String_Node_Str"+ maxButtons);
  int filledConts=0;
  boolean filledSecondRow=false;
  int iconSize=Integer.parseInt(prefs.getString(Settings.ICON_SIZE_PREFERENCE,Integer.toString(Settings.ICON_SIZE_DEFAULT)));
  int itemLayout=R.layout.notification_item;
  if (iconSize == ICON_SIZE_SMALL) {
    itemLayout=R.layout.notification_item_small;
  }
 else   if (iconSize == ICON_SIZE_LARGE) {
    itemLayout=R.layout.notification_item_large;
  }
  customNotifBigView.removeAllViews(R.id.notifContainer);
  for (int i=0; i <= taskList.size(); i++) {
    if (filledConts == maxButtons) {
      if (filledSecondRow) {
        filledSecondRow=false;
        customNotifBigView=customNotifView;
        customNotifBigView.addView(R.id.notifContainer,appDrawer.getRow());
        break;
      }
 else {
        customNotifView.addView(R.id.notifContainer,appDrawer.getRow());
        filledSecondRow=true;
        filledConts=0;
        appDrawer.createRow(rowLayout,R.id.notifRow);
        appDrawer.setImageLayouts(imageButtonLayout,imageContLayout);
      }
    }
    if (appDrawer.newItem(taskList.get(i),itemLayout)) {
      appDrawer.addItem();
      filledConts++;
    }
  }
  if (filledSecondRow && secondRow) {
    Tools.HangarLog("String_Node_Str");
    customNotifBigView=customNotifView;
    customNotifBigView.addView(R.id.notifContainer,appDrawer.getRow());
  }
  String mIcon=prefs.getString(Settings.STATUSBAR_ICON_PREFERENCE,Settings.STATUSBAR_ICON_DEFAULT);
  int smallIcon=iconMap.get(Settings.STATUSBAR_ICON_WHITE_WARM);
  try {
    smallIcon=iconMap.get(mIcon);
  }
 catch (  NullPointerException e) {
  }
  Notification notification=new Notification.Builder(WatchfulService.this).setContentTitle(getResources().getString(R.string.app_name)).setContentText(getResources().getString(R.string.app_name)).setSmallIcon(smallIcon).setContent(customNotifView).setOngoing(true).setPriority(setPriority).build();
  if (secondRow) {
    notification.bigContentView=customNotifBigView;
  }
  startForeground(1337,notification);
  isNotificationRunning=true;
}

Fixed version (ground truth):
public void createNotification(ArrayList<Tools.TaskInfo> taskList){
  String taskPackage=this.getPackageName();
  Context mContext=getApplicationContext();
  int contLayout=prefs.getBoolean(Settings.ROW_DIVIDER_PREFERENCE,Settings.ROW_DIVIDER_DEFAULT) ? getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage) : getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage);
  int rowLayout=prefs.getBoolean(Settings.DIVIDER_PREFERENCE,Settings.DIVIDER_DEFAULT) ? getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage) : getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage);
  int imageButtonLayout=getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage);
  int imageContLayout=getResources().getIdentifier("String_Node_Str","String_Node_Str",taskPackage);
  RemoteViews customNotifView=new RemoteViews(taskPackage,contLayout);
  RemoteViews customNotifBigView=customNotifView;
  AppDrawer appDrawer=new AppDrawer(taskPackage);
  appDrawer.createRow(rowLayout,R.id.notifRow);
  appDrawer.setImageLayouts(imageButtonLayout,imageContLayout);
  appDrawer.setPrefs(prefs);
  appDrawer.setContext(mContext);
  int maxButtons;
  int setPriority=Integer.parseInt(prefs.getString(Settings.PRIORITY_PREFERENCE,Integer.toString(Settings.PRIORITY_DEFAULT)));
  if (taskList.size() < numOfApps) {
    maxButtons=taskList.size();
  }
 else {
    maxButtons=numOfApps;
  }
  if (taskList.size() <= numOfApps) {
    Tools.HangarLog("String_Node_Str");
    secondRow=false;
  }
  Tools.HangarLog("String_Node_Str" + taskList.size() + "String_Node_Str"+ numOfApps+ "String_Node_Str"+ maxButtons);
  int filledConts=0;
  boolean filledSecondRow=false;
  int iconSize=Integer.parseInt(prefs.getString(Settings.ICON_SIZE_PREFERENCE,Integer.toString(Settings.ICON_SIZE_DEFAULT)));
  int itemLayout=R.layout.notification_item;
  if (iconSize == ICON_SIZE_SMALL) {
    itemLayout=R.layout.notification_item_small;
  }
 else   if (iconSize == ICON_SIZE_LARGE) {
    itemLayout=R.layout.notification_item_large;
  }
  customNotifBigView.removeAllViews(R.id.notifContainer);
  for (int i=0; i <= taskList.size(); i++) {
    boolean wrapItUp=false;
    if (i == taskList.size())     wrapItUp=true;
    if (filledConts == maxButtons || wrapItUp) {
      if (filledSecondRow) {
        filledSecondRow=false;
        customNotifBigView=customNotifView;
        customNotifBigView.addView(R.id.notifContainer,appDrawer.getRow());
        break;
      }
 else {
        customNotifView.addView(R.id.notifContainer,appDrawer.getRow());
        filledSecondRow=true;
        filledConts=0;
        appDrawer.createRow(rowLayout,R.id.notifRow);
        appDrawer.setImageLayouts(imageButtonLayout,imageContLayout);
      }
    }
    if (!wrapItUp && appDrawer.newItem(taskList.get(i),itemLayout)) {
      appDrawer.addItem();
      filledConts++;
    }
  }
  if (filledSecondRow && secondRow) {
    Tools.HangarLog("String_Node_Str");
    customNotifBigView=customNotifView;
    customNotifBigView.addView(R.id.notifContainer,appDrawer.getRow());
  }
  String mIcon=prefs.getString(Settings.STATUSBAR_ICON_PREFERENCE,Settings.STATUSBAR_ICON_DEFAULT);
  int smallIcon=iconMap.get(Settings.STATUSBAR_ICON_WHITE_WARM);
  try {
    smallIcon=iconMap.get(mIcon);
  }
 catch (  NullPointerException e) {
  }
  Notification notification=new Notification.Builder(WatchfulService.this).setContentTitle(getResources().getString(R.string.app_name)).setContentText(getResources().getString(R.string.app_name)).setSmallIcon(smallIcon).setContent(customNotifView).setOngoing(true).setPriority(setPriority).build();
  if (secondRow) {
    notification.bigContentView=customNotifBigView;
  }
  if (isNotificationRunning) {
    NotificationManager mNotificationManager=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
    mNotificationManager.notify(1337,notification);
  }
 else {
    startForeground(1337,notification);
  }
  isNotificationRunning=true;
}