Program: 161523
Project: 161523
Buggy source:
@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){
    }
  }
);
}

Fixed version (ground truth):
@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){
    }
  }
);
}