Program: 15419
Project: 15419
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  PrefsUtility.applyTheme(this);
  super.onCreate(savedInstanceState);
  final LinearLayout layout=(LinearLayout)getLayoutInflater().inflate(R.layout.post_submit);
  typeSpinner=(Spinner)layout.findViewById(R.id.post_submit_type);
  usernameSpinner=(Spinner)layout.findViewById(R.id.post_submit_username);
  subredditEdit=(EditText)layout.findViewById(R.id.post_submit_subreddit);
  titleEdit=(EditText)layout.findViewById(R.id.post_submit_title);
  textEdit=(EditText)layout.findViewById(R.id.post_submit_body);
  final Intent intent=getIntent();
  if (intent != null) {
    if (intent.hasExtra("String_Node_Str")) {
      final String subreddit=intent.getStringExtra("String_Node_Str");
      if (subreddit != null && subreddit.length() > 0 && !subreddit.matches("String_Node_Str") && subreddit.matches("String_Node_Str")) {
        subredditEdit.setText(subreddit);
      }
    }
 else     if (intent.getAction().equalsIgnoreCase(Intent.ACTION_SEND) && intent.hasExtra(Intent.EXTRA_TEXT)) {
      final String url=intent.getStringExtra(Intent.EXTRA_TEXT);
      textEdit.setText(url);
    }
  }
 else   if (savedInstanceState != null && savedInstanceState.containsKey("String_Node_Str")) {
    titleEdit.setText(savedInstanceState.getString("String_Node_Str"));
    textEdit.setText(savedInstanceState.getString("String_Node_Str"));
    subredditEdit.setText(savedInstanceState.getString("String_Node_Str"));
    typeSpinner.setSelection(savedInstanceState.getInt("String_Node_Str"));
  }
  final ArrayList<RedditAccount> accounts=RedditAccountManager.getInstance(this).getAccounts();
  final ArrayList<String> usernames=new ArrayList<String>();
  for (  RedditAccount account : accounts) {
    if (!account.isAnonymous()) {
      usernames.add(account.username);
    }
  }
  if (usernames.size() == 0) {
    General.quickToast(this,R.string.error_toast_notloggedin);
    finish();
  }
  usernameSpinner.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,usernames));
  typeSpinner.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,postTypes));
  setHint();
  typeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
    public void onItemSelected(    AdapterView<?> parent,    View view,    int position,    long id){
      setHint();
    }
    public void onNothingSelected(    AdapterView<?> parent){
    }
  }
);
  final ScrollView sv=new ScrollView(this);
  sv.addView(layout);
  setContentView(sv);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  PrefsUtility.applyTheme(this);
  super.onCreate(savedInstanceState);
  final LinearLayout layout=(LinearLayout)getLayoutInflater().inflate(R.layout.post_submit);
  typeSpinner=(Spinner)layout.findViewById(R.id.post_submit_type);
  usernameSpinner=(Spinner)layout.findViewById(R.id.post_submit_username);
  subredditEdit=(EditText)layout.findViewById(R.id.post_submit_subreddit);
  titleEdit=(EditText)layout.findViewById(R.id.post_submit_title);
  textEdit=(EditText)layout.findViewById(R.id.post_submit_body);
  final Intent intent=getIntent();
  if (intent != null) {
    if (intent.hasExtra("String_Node_Str")) {
      final String subreddit=intent.getStringExtra("String_Node_Str");
      if (subreddit != null && subreddit.length() > 0 && !subreddit.matches("String_Node_Str") && subreddit.matches("String_Node_Str")) {
        subredditEdit.setText(subreddit);
      }
    }
 else     if (Intent.ACTION_SEND.equalsIgnoreCase(intent.getAction()) && intent.hasExtra(Intent.EXTRA_TEXT)) {
      final String url=intent.getStringExtra(Intent.EXTRA_TEXT);
      textEdit.setText(url);
    }
  }
 else   if (savedInstanceState != null && savedInstanceState.containsKey("String_Node_Str")) {
    titleEdit.setText(savedInstanceState.getString("String_Node_Str"));
    textEdit.setText(savedInstanceState.getString("String_Node_Str"));
    subredditEdit.setText(savedInstanceState.getString("String_Node_Str"));
    typeSpinner.setSelection(savedInstanceState.getInt("String_Node_Str"));
  }
  final ArrayList<RedditAccount> accounts=RedditAccountManager.getInstance(this).getAccounts();
  final ArrayList<String> usernames=new ArrayList<String>();
  for (  RedditAccount account : accounts) {
    if (!account.isAnonymous()) {
      usernames.add(account.username);
    }
  }
  if (usernames.size() == 0) {
    General.quickToast(this,R.string.error_toast_notloggedin);
    finish();
  }
  usernameSpinner.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,usernames));
  typeSpinner.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,postTypes));
  setHint();
  typeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener(){
    public void onItemSelected(    AdapterView<?> parent,    View view,    int position,    long id){
      setHint();
    }
    public void onNothingSelected(    AdapterView<?> parent){
    }
  }
);
  final ScrollView sv=new ScrollView(this);
  sv.addView(layout);
  setContentView(sv);
}