Program: 161522
Project: 161522
Buggy source:
public void setUpSpinner(){
  new AsyncTask<Void,Void,String[]>(){
    @Override protected String[] doInBackground(    Void... voids){
      ArrayList<String> fetchedFaculties=new ArrayList<>();
      SurveyManager sm=new SurveyManager(getApplicationContext());
      sm.downloadFacultiesFromExternal();
      Cursor cursor=sm.getAllFaculties();
      if (cursor.moveToFirst()) {
        do {
          fetchedFaculties.add(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
        }
 while (cursor.moveToNext());
      }
      fetchedFaculties.add(0,getResources().getString(R.string.choose_own_faculty));
      return fetchedFaculties.toArray(new String[fetchedFaculties.size()]);
    }
    @Override protected void onPostExecute(    String[] majors){
      ArrayAdapter<String> adapter=new ArrayAdapter<>(getBaseContext(),android.R.layout.simple_list_item_1,majors);
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      userMajorSpinner.setAdapter(adapter);
      Utils.setInternalSetting(getApplicationContext(),"String_Node_Str","String_Node_Str");
      userMajorSpinner.setSelection(Integer.parseInt(Utils.getInternalSettingString(getApplicationContext(),"String_Node_Str","String_Node_Str")));
      userMajorSpinner.setOnTouchListener((view,motionEvent) -> {
        if (!NetUtils.isConnected(getApplicationContext())) {
          Toast.makeText(getApplicationContext(),getString(R.string.please_connect_to_internet),Toast.LENGTH_LONG).show();
        }
        return view.performClick();
      }
);
      userMajorSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
        @Override public void onItemSelected(        AdapterView<?> adapterView,        View view,        int i,        long l){
          SurveyManager sm=new SurveyManager(getApplicationContext());
          Cursor c=sm.getFacultyID((String)adapterView.getItemAtPosition(i));
          if (c.moveToFirst()) {
            Utils.setInternalSetting(getApplicationContext(),"String_Node_Str",c.getString(c.getColumnIndex("String_Node_Str")));
            Utils.setInternalSetting(getApplicationContext(),"String_Node_Str",userMajorSpinner.getSelectedItemPosition() + "String_Node_Str");
          }
          TextView selectedItem=(TextView)adapterView.getChildAt(0);
          if (selectedItem != null) {
            selectedItem.setTextColor(ContextCompat.getColor(getApplicationContext(),R.color.color_primary));
          }
        }
        @Override public void onNothingSelected(        AdapterView<?> adapterView){
        }
      }
);
    }
  }
.execute();
}

Fixed version (ground truth):
public void setUpSpinner(){
  new AsyncTask<Void,Void,String[]>(){
    @Override protected String[] doInBackground(    Void... voids){
      ArrayList<String> fetchedFaculties=new ArrayList<>();
      SurveyManager sm=new SurveyManager(getApplicationContext());
      sm.downloadFacultiesFromExternal();
      Cursor cursor=sm.getAllFaculties();
      if (cursor.moveToFirst()) {
        do {
          fetchedFaculties.add(cursor.getString(cursor.getColumnIndex("String_Node_Str")));
        }
 while (cursor.moveToNext());
      }
      fetchedFaculties.add(0,getResources().getString(R.string.choose_own_faculty));
      return fetchedFaculties.toArray(new String[fetchedFaculties.size()]);
    }
    @SuppressLint("String_Node_Str") @Override protected void onPostExecute(    String[] majors){
      ArrayAdapter<String> adapter=new ArrayAdapter<>(getBaseContext(),android.R.layout.simple_list_item_1,majors);
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
      userMajorSpinner.setAdapter(adapter);
      Utils.setInternalSetting(getApplicationContext(),"String_Node_Str","String_Node_Str");
      userMajorSpinner.setSelection(Integer.parseInt(Utils.getInternalSettingString(getApplicationContext(),"String_Node_Str","String_Node_Str")));
      userMajorSpinner.setOnTouchListener((view,motionEvent) -> {
        if (!NetUtils.isConnected(getApplicationContext())) {
          Toast.makeText(getApplicationContext(),getString(R.string.please_connect_to_internet),Toast.LENGTH_LONG).show();
        }
        return view.performClick();
      }
);
      userMajorSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
        @Override public void onItemSelected(        AdapterView<?> adapterView,        View view,        int i,        long l){
          SurveyManager sm=new SurveyManager(getApplicationContext());
          Cursor c=sm.getFacultyID((String)adapterView.getItemAtPosition(i));
          if (c.moveToFirst()) {
            Utils.setInternalSetting(getApplicationContext(),"String_Node_Str",c.getString(c.getColumnIndex("String_Node_Str")));
            Utils.setInternalSetting(getApplicationContext(),"String_Node_Str",userMajorSpinner.getSelectedItemPosition() + "String_Node_Str");
          }
          TextView selectedItem=(TextView)adapterView.getChildAt(0);
          if (selectedItem != null) {
            selectedItem.setTextColor(ContextCompat.getColor(getApplicationContext(),R.color.color_primary));
          }
        }
        @Override public void onNothingSelected(        AdapterView<?> adapterView){
        }
      }
);
    }
  }
.execute();
}