Program: 15239
Project: 15239
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.view_stats);
  initStats();
  Button saveStatsLogin=(Button)findViewById(R.id.saveDotcom);
  saveStatsLogin.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      EditText dotcomUsername=(EditText)findViewById(R.id.dotcomUsername);
      EditText dotcomPassword=(EditText)findViewById(R.id.dotcomPassword);
      String dcUsername=dotcomUsername.getText().toString();
      String dcPassword=dotcomPassword.getText().toString();
      if (dcUsername.equals("String_Node_Str") || dcPassword.equals("String_Node_Str")) {
        AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(ViewStats.this);
        dialogBuilder.setTitle(getResources().getText(R.string.required_fields));
        dialogBuilder.setMessage(getResources().getText(R.string.username_password_required));
        dialogBuilder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          public void onClick(          DialogInterface dialog,          int whichButton){
          }
        }
);
        dialogBuilder.setCancelable(true);
        if (!isFinishing()) {
          dialogBuilder.create().show();
        }
      }
 else {
        WordPress.wpDB.saveStatsLogin(WordPress.currentBlog.getId(),dcUsername,dcPassword);
        showOrHideLoginForm();
        initStats();
      }
    }
  }
);
  final Button go=(Button)findViewById(R.id.go);
  go.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      Spinner reportType=(Spinner)findViewById(R.id.reportType);
      Spinner reportInterval=(Spinner)findViewById(R.id.reportInterval);
      final String type=parseType(reportType.getSelectedItemPosition());
      final int interval=parseInterval(reportInterval.getSelectedItemPosition());
      Vector<?> apiData=WordPress.wpDB.loadAPIData(WordPress.currentBlog.getId());
      final String apiKey=apiData.get(0).toString();
      final String apiBlogID=apiData.get(1).toString();
      if (!isFinishing())       showDialog(ID_DIALOG_GET_STATS);
      Thread action=new Thread(){
        public void run(){
          getStatsData(apiKey,apiBlogID,type,interval);
        }
      }
;
      action.start();
    }
  }
);
  titleBar=(WPTitleBar)findViewById(R.id.actionBar);
  titleBar.refreshButton.setOnClickListener(new ImageButton.OnClickListener(){
    public void onClick(    View v){
      go.performClick();
    }
  }
);
  titleBar.setOnBlogChangedListener(new OnBlogChangedListener(){
    @Override public void OnBlogChanged(){
      ImageView iv=(ImageView)findViewById(R.id.chart);
      iv.setVisibility(View.GONE);
      RelativeLayout filters=(RelativeLayout)findViewById(R.id.filters);
      filters.setVisibility(View.GONE);
      TableLayout tl=(TableLayout)findViewById(R.id.dataTable);
      tl.removeAllViews();
      RelativeLayout moderationBar=(RelativeLayout)findViewById(R.id.dotcomLogin);
      moderationBar.setVisibility(View.GONE);
      TextView reportTitle=(TextView)findViewById(R.id.chartTitle);
      reportTitle.setVisibility(View.GONE);
      initStats();
    }
  }
);
  TextView wpcomHelp=(TextView)findViewById(R.id.wpcomHelp);
  wpcomHelp.setOnClickListener(new TextView.OnClickListener(){
    public void onClick(    View v){
      Intent intent1=new Intent(Intent.ACTION_VIEW);
      intent1.setData(Uri.parse("String_Node_Str"));
      startActivity(intent1);
    }
  }
);
  Spinner reportInterval=(Spinner)findViewById(R.id.reportInterval);
  reportInterval.setSelection(1);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  setContentView(R.layout.view_stats);
  initStats();
  Button saveStatsLogin=(Button)findViewById(R.id.saveDotcom);
  saveStatsLogin.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      EditText dotcomUsername=(EditText)findViewById(R.id.dotcomUsername);
      EditText dotcomPassword=(EditText)findViewById(R.id.dotcomPassword);
      String dcUsername=dotcomUsername.getText().toString();
      String dcPassword=dotcomPassword.getText().toString();
      if (dcUsername.equals("String_Node_Str") || dcPassword.equals("String_Node_Str")) {
        AlertDialog.Builder dialogBuilder=new AlertDialog.Builder(ViewStats.this);
        dialogBuilder.setTitle(getResources().getText(R.string.required_fields));
        dialogBuilder.setMessage(getResources().getText(R.string.username_password_required));
        dialogBuilder.setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
          public void onClick(          DialogInterface dialog,          int whichButton){
          }
        }
);
        dialogBuilder.setCancelable(true);
        if (!isFinishing()) {
          dialogBuilder.create().show();
        }
      }
 else {
        WordPress.wpDB.saveStatsLogin(WordPress.currentBlog.getId(),dcUsername,dcPassword);
        showOrHideLoginForm();
        initStats();
      }
    }
  }
);
  final Button go=(Button)findViewById(R.id.go);
  go.setOnClickListener(new Button.OnClickListener(){
    public void onClick(    View v){
      Spinner reportType=(Spinner)findViewById(R.id.reportType);
      Spinner reportInterval=(Spinner)findViewById(R.id.reportInterval);
      final String type=parseType(reportType.getSelectedItemPosition());
      final int interval=parseInterval(reportInterval.getSelectedItemPosition());
      final String apiKey=WordPress.currentBlog.getApi_key();
      final String apiBlogID=WordPress.currentBlog.getApi_blogid();
      if (!isFinishing())       titleBar.startRotatingRefreshIcon();
      Thread action=new Thread(){
        public void run(){
          getStatsData(apiKey,apiBlogID,type,interval);
        }
      }
;
      action.start();
    }
  }
);
  titleBar=(WPTitleBar)findViewById(R.id.actionBar);
  titleBar.refreshButton.setOnClickListener(new ImageButton.OnClickListener(){
    public void onClick(    View v){
      go.performClick();
    }
  }
);
  titleBar.setOnBlogChangedListener(new OnBlogChangedListener(){
    @Override public void OnBlogChanged(){
      ImageView iv=(ImageView)findViewById(R.id.chart);
      iv.setVisibility(View.GONE);
      RelativeLayout filters=(RelativeLayout)findViewById(R.id.filters);
      filters.setVisibility(View.GONE);
      TableLayout tl=(TableLayout)findViewById(R.id.dataTable);
      tl.removeAllViews();
      RelativeLayout moderationBar=(RelativeLayout)findViewById(R.id.dotcomLogin);
      moderationBar.setVisibility(View.GONE);
      TextView reportTitle=(TextView)findViewById(R.id.chartTitle);
      reportTitle.setVisibility(View.GONE);
      initStats();
    }
  }
);
  TextView wpcomHelp=(TextView)findViewById(R.id.wpcomHelp);
  wpcomHelp.setOnClickListener(new TextView.OnClickListener(){
    public void onClick(    View v){
      Intent intent1=new Intent(Intent.ACTION_VIEW);
      intent1.setData(Uri.parse("String_Node_Str"));
      startActivity(intent1);
    }
  }
);
  Spinner reportInterval=(Spinner)findViewById(R.id.reportInterval);
  reportInterval.setSelection(1);
}