Program: 161524
Project: 161524
Buggy source:
/** 
 * Inflates the cafeteria menu layout. This is put into an extra static method to be able to reuse it in   {@link de.tum.in.tumcampusapp.cards.CafeteriaMenuCard}
 * @param rootView    Parent layout
 * @param cafeteriaId Cafeteria id
 * @param dateStr     Date in yyyy-mm-dd format
 * @param big         True to show big lines
 */
public static List<View> showMenu(LinearLayout rootView,int cafeteriaId,String dateStr,boolean big){
  final Context context=rootView.getContext();
  final Map<String,String> rolePrices=CafeteriaPrices.getRolePrices(context);
  final int padding=(int)context.getResources().getDimension(R.dimen.card_text_padding);
  List<View> addedViews=new ArrayList<>();
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  Cursor cursorCafeteriaMenu=new CafeteriaMenuManager(context).getTypeNameFromDbCard(cafeteriaId,dateStr);
  TextView textview;
  if (!big) {
    OpenHoursManager lm=new OpenHoursManager(context);
    textview=new TextView(context);
    textview.setText(lm.getHoursByIdAsString(context,cafeteriaId,Utils.getDate(dateStr)));
    textview.setTextColor(ContextCompat.getColor(context,R.color.sections_green));
    rootView.addView(textview);
    addedViews.add(textview);
  }
  String curShort="String_Node_Str";
  if (cursorCafeteriaMenu.moveToFirst()) {
    do {
      String typeShort=cursorCafeteriaMenu.getString(3);
      String typeLong=cursorCafeteriaMenu.getString(0);
      String menu=cursorCafeteriaMenu.getString(1);
      boolean shouldShow=Utils.getSettingBool(context,"String_Node_Str" + typeShort,typeShort.equals("String_Node_Str") || typeShort.equals("String_Node_Str"));
      if (!big && !shouldShow) {
        continue;
      }
      if (!typeShort.equals(curShort)) {
        curShort=typeShort;
        View view=inflater.inflate(big ? R.layout.list_header_big : R.layout.card_list_header,rootView,false);
        textview=(TextView)view.findViewById(R.id.list_header);
        textview.setText(typeLong.replaceAll("String_Node_Str","String_Node_Str").trim());
        rootView.addView(view);
        addedViews.add(view);
      }
      SpannableString text=menuToSpan(context,big ? menu : prepare(menu));
      int dishId=cursorCafeteriaMenu.getInt(2);
      if (rolePrices.containsKey(typeLong)) {
        View view=inflater.inflate(big ? R.layout.price_line_big : R.layout.card_price_line,rootView,false);
        textview=(TextView)view.findViewById(R.id.line_name);
        TextView priceView=(TextView)view.findViewById(R.id.line_price);
        final ToggleButton favDish=(ToggleButton)view.findViewById(R.id.favortieDish);
        favDish.setOnClickListener(v -> {
          if (favDish.isChecked()) {
            Intent myIntent=new Intent(context,FavoriteDishReceiver.class);
            PendingIntent pendingIntent=PendingIntent.getBroadcast(context,0,myIntent,0);
            AlarmManager alarmManager=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
            alarmManager.set(AlarmManager.RTC,System.currentTimeMillis() + 5000,pendingIntent);
            Toast.makeText(context,favDish.getTag().toString(),Toast.LENGTH_SHORT).show();
          }
 else {
          }
        }
);
        favDish.setTag(dishId + "String_Node_Str");
        textview.setText(text);
        priceView.setText(String.format("String_Node_Str",rolePrices.get(typeLong)));
        rootView.addView(view);
        addedViews.add(view);
      }
 else {
        textview=new TextView(context);
        textview.setText(text);
        textview.setPadding(padding,padding,padding,padding);
        rootView.addView(textview);
        addedViews.add(textview);
      }
    }
 while (cursorCafeteriaMenu.moveToNext());
  }
  cursorCafeteriaMenu.close();
  return addedViews;
}

Fixed version (ground truth):
/** 
 * Inflates the cafeteria menu layout. This is put into an extra static method to be able to reuse it in   {@link de.tum.in.tumcampusapp.cards.CafeteriaMenuCard}
 * @param rootView    Parent layout
 * @param cafeteriaId Cafeteria id
 * @param dateStr     Date in yyyy-mm-dd format
 * @param big         True to show big lines
 */
@SuppressLint("String_Node_Str") public static List<View> showMenu(LinearLayout rootView,int cafeteriaId,String dateStr,boolean big){
  final Context context=rootView.getContext();
  final Map<String,String> rolePrices=CafeteriaPrices.getRolePrices(context);
  final int padding=(int)context.getResources().getDimension(R.dimen.card_text_padding);
  List<View> addedViews=new ArrayList<>();
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  Cursor cursorCafeteriaMenu=new CafeteriaMenuManager(context).getTypeNameFromDbCard(cafeteriaId,dateStr);
  TextView textview;
  if (!big) {
    OpenHoursManager lm=new OpenHoursManager(context);
    textview=new TextView(context);
    textview.setText(lm.getHoursByIdAsString(context,cafeteriaId,Utils.getDate(dateStr)));
    textview.setTextColor(ContextCompat.getColor(context,R.color.sections_green));
    rootView.addView(textview);
    addedViews.add(textview);
  }
  String curShort="String_Node_Str";
  if (cursorCafeteriaMenu.moveToFirst()) {
    do {
      String typeShort=cursorCafeteriaMenu.getString(3);
      String typeLong=cursorCafeteriaMenu.getString(0);
      String menu=cursorCafeteriaMenu.getString(1);
      boolean shouldShow=Utils.getSettingBool(context,"String_Node_Str" + typeShort,typeShort.equals("String_Node_Str") || typeShort.equals("String_Node_Str"));
      if (!big && !shouldShow) {
        continue;
      }
      if (!typeShort.equals(curShort)) {
        curShort=typeShort;
        View view=inflater.inflate(big ? R.layout.list_header_big : R.layout.card_list_header,rootView,false);
        textview=(TextView)view.findViewById(R.id.list_header);
        textview.setText(typeLong.replaceAll("String_Node_Str","String_Node_Str").trim());
        rootView.addView(view);
        addedViews.add(view);
      }
      SpannableString text=menuToSpan(context,big ? menu : prepare(menu));
      int dishId=cursorCafeteriaMenu.getInt(2);
      if (rolePrices.containsKey(typeLong)) {
        View view=inflater.inflate(big ? R.layout.price_line_big : R.layout.card_price_line,rootView,false);
        textview=(TextView)view.findViewById(R.id.line_name);
        TextView priceView=(TextView)view.findViewById(R.id.line_price);
        final ToggleButton favDish=(ToggleButton)view.findViewById(R.id.favortieDish);
        favDish.setOnClickListener(v -> {
          if (favDish.isChecked()) {
            Intent myIntent=new Intent(context,FavoriteDishReceiver.class);
            PendingIntent pendingIntent=PendingIntent.getBroadcast(context,0,myIntent,0);
            AlarmManager alarmManager=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
            alarmManager.set(AlarmManager.RTC,System.currentTimeMillis() + 5000,pendingIntent);
            Toast.makeText(context,favDish.getTag().toString(),Toast.LENGTH_SHORT).show();
          }
 else {
          }
        }
);
        favDish.setTag(dishId + "String_Node_Str");
        textview.setText(text);
        priceView.setText(String.format("String_Node_Str",rolePrices.get(typeLong)));
        rootView.addView(view);
        addedViews.add(view);
      }
 else {
        textview=new TextView(context);
        textview.setText(text);
        textview.setPadding(padding,padding,padding,padding);
        rootView.addView(textview);
        addedViews.add(textview);
      }
    }
 while (cursorCafeteriaMenu.moveToNext());
  }
  cursorCafeteriaMenu.close();
  return addedViews;
}