Program: 54339
Project: 54339
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  sharedPrefs=getSharedPreferences("String_Node_Str",Context.MODE_WORLD_READABLE + Context.MODE_WORLD_WRITEABLE);
  context=this;
  settings=AppSettings.getInstance(context);
  Utils.setUpTheme(context,settings);
  setContentView(R.layout.login_activity);
  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
  ConfigurationBuilder builder=new ConfigurationBuilder();
  builder.setOAuthConsumerKey(settings.TWITTER_CONSUMER_KEY);
  builder.setOAuthConsumerSecret(settings.TWITTER_CONSUMER_SECRET);
  Configuration configuration=builder.build();
  TwitterFactory factory=new TwitterFactory(configuration);
  twitter=factory.getInstance();
  btnLoginTwitter=(Button)findViewById(R.id.btnLoginTwitter);
  noThanks=(Button)findViewById(R.id.dont_follow);
  title=(TextSwitcher)findViewById(R.id.welcome);
  summary=(TextSwitcher)findViewById(R.id.info);
  progDescription=(TextSwitcher)findViewById(R.id.progress_desc);
  progressBar=(ProgressBar)findViewById(R.id.progress_bar);
  main=(LinearLayout)findViewById(R.id.mainLayout);
  Animation in=AnimationUtils.loadAnimation(this,android.R.anim.slide_in_left);
  Animation out=AnimationUtils.loadAnimation(this,android.R.anim.slide_out_right);
  title.setFactory(new ViewSwitcher.ViewFactory(){
    public View makeView(){
      TextView myText=new TextView(LoginActivity.this);
      myText.setTextSize(30);
      return myText;
    }
  }
);
  title.setInAnimation(in);
  title.setOutAnimation(out);
  summary.setFactory(new ViewSwitcher.ViewFactory(){
    public View makeView(){
      TextView myText=new TextView(LoginActivity.this);
      myText.setTextSize(17);
      return myText;
    }
  }
);
  summary.setInAnimation(in);
  summary.setOutAnimation(out);
  progDescription.setFactory(new ViewSwitcher.ViewFactory(){
    public View makeView(){
      TextView myText=new TextView(LoginActivity.this);
      myText.setTextSize(17);
      return myText;
    }
  }
);
  progDescription.setInAnimation(in);
  progDescription.setOutAnimation(out);
  title.setText(getResources().getString(R.string.first_welcome));
  summary.setText(getResources().getString(R.string.first_info));
  progressBar.setProgress(100);
  CookieSyncManager.createInstance(this);
  CookieManager cookieManager=CookieManager.getInstance();
  cookieManager.removeAllCookie();
  mWebView=(WebView)findViewById(R.id.loginWebView);
  try {
    mWebView.getSettings().setJavaScriptEnabled(true);
  }
 catch (  Exception e) {
  }
  mWebView.getSettings().setAppCacheEnabled(false);
  mWebView.getSettings().setSavePassword(false);
  mWebView.getSettings().setSaveFormData(false);
  mWebView.setWebViewClient(new WebViewClient(){
    @Override public boolean shouldOverrideUrlLoading(    WebView webView,    String url){
      if (url != null && url.startsWith("String_Node_Str")) {
        handleTwitterCallback(url);
      }
 else {
        webView.loadUrl(url);
      }
      return true;
    }
  }
);
  noThanks.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      new FollowMe().execute();
      btnLoginTwitter.setText(getResources().getString(R.string.back_to_timeline));
      noThanks.setVisibility(View.GONE);
      summary.setText(getResources().getString(R.string.third_info));
    }
  }
);
  btnLoginTwitter.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View arg0){
      if (btnLoginTwitter.getText().toString().contains(getResources().getString(R.string.login_to_twitter))) {
        if (Utils.hasInternetConnection(context)) {
          btnLoginTwitter.setEnabled(false);
          new RetreiveFeedTask().execute();
        }
 else {
          Toast.makeText(context,getResources().getString(R.string.no_network) + "String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
 else       if (btnLoginTwitter.getText().toString().contains(getResources().getString(R.string.initial_sync))) {
        new getTimeLine().execute();
      }
 else       if (btnLoginTwitter.getText().toString().contains(getResources().getString(R.string.no_thanks))) {
        btnLoginTwitter.setText(getResources().getString(R.string.back_to_timeline));
        noThanks.setVisibility(View.GONE);
        summary.setText(getResources().getString(R.string.third_info));
      }
 else {
        if (settings.timelineRefresh != 0) {
          AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
          long now=new Date().getTime();
          long alarm=now + settings.timelineRefresh;
          PendingIntent pendingIntent=PendingIntent.getService(context,HomeFragment.HOME_REFRESH_ID,new Intent(context,TimelineRefreshService.class),0);
          am.setRepeating(AlarmManager.RTC_WAKEUP,alarm,settings.timelineRefresh,pendingIntent);
          now=new Date().getTime();
          alarm=now + settings.mentionsRefresh;
          PendingIntent pendingIntent2=PendingIntent.getService(context,MentionsFragment.MENTIONS_REFRESH_ID,new Intent(context,MentionsRefreshService.class),0);
          am.setRepeating(AlarmManager.RTC_WAKEUP,alarm,settings.mentionsRefresh,pendingIntent2);
          alarm=now + settings.dmRefresh;
          PendingIntent pendingIntent3=PendingIntent.getService(context,DMFragment.DM_REFRESH_ID,new Intent(context,DirectMessageRefreshService.class),0);
          am.setRepeating(AlarmManager.RTC_WAKEUP,alarm,settings.dmRefresh,pendingIntent3);
        }
        AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
        long now=new Date().getTime();
        long alarm=now + AlarmManager.INTERVAL_DAY;
        Log.v("String_Node_Str","String_Node_Str" + new Date(alarm).toString());
        PendingIntent pendingIntent=PendingIntent.getService(context,161,new Intent(context,TrimDataService.class),0);
        am.set(AlarmManager.RTC_WAKEUP,alarm,pendingIntent);
        finish();
        Intent timeline=new Intent(context,MainActivity.class);
        timeline.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
        timeline.putExtra("String_Node_Str",true);
        sharedPrefs.edit().putBoolean("String_Node_Str",false).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",true).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",true).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",true).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",false).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",false).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",true).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",false).commit();
        AppSettings.invalidate();
        startActivity(timeline);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  sharedPrefs=getSharedPreferences("String_Node_Str",Context.MODE_WORLD_READABLE + Context.MODE_WORLD_WRITEABLE);
  context=this;
  settings=AppSettings.getInstance(context);
  Utils.setUpTheme(context,settings);
  setContentView(R.layout.login_activity);
  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
  ConfigurationBuilder builder=new ConfigurationBuilder();
  builder.setOAuthConsumerKey(settings.TWITTER_CONSUMER_KEY);
  builder.setOAuthConsumerSecret(settings.TWITTER_CONSUMER_SECRET);
  Configuration configuration=builder.build();
  TwitterFactory factory=new TwitterFactory(configuration);
  twitter=factory.getInstance();
  btnLoginTwitter=(Button)findViewById(R.id.btnLoginTwitter);
  noThanks=(Button)findViewById(R.id.dont_follow);
  title=(TextSwitcher)findViewById(R.id.welcome);
  summary=(TextSwitcher)findViewById(R.id.info);
  progDescription=(TextSwitcher)findViewById(R.id.progress_desc);
  progressBar=(ProgressBar)findViewById(R.id.progress_bar);
  main=(LinearLayout)findViewById(R.id.mainLayout);
  Animation in=AnimationUtils.loadAnimation(this,android.R.anim.slide_in_left);
  Animation out=AnimationUtils.loadAnimation(this,android.R.anim.slide_out_right);
  title.setFactory(new ViewSwitcher.ViewFactory(){
    public View makeView(){
      TextView myText=new TextView(LoginActivity.this);
      myText.setTextSize(30);
      return myText;
    }
  }
);
  title.setInAnimation(in);
  title.setOutAnimation(out);
  summary.setFactory(new ViewSwitcher.ViewFactory(){
    public View makeView(){
      TextView myText=new TextView(LoginActivity.this);
      myText.setTextSize(17);
      return myText;
    }
  }
);
  summary.setInAnimation(in);
  summary.setOutAnimation(out);
  progDescription.setFactory(new ViewSwitcher.ViewFactory(){
    public View makeView(){
      TextView myText=new TextView(LoginActivity.this);
      myText.setTextSize(17);
      return myText;
    }
  }
);
  progDescription.setInAnimation(in);
  progDescription.setOutAnimation(out);
  title.setText(getResources().getString(R.string.first_welcome));
  summary.setText(getResources().getString(R.string.first_info));
  progressBar.setProgress(100);
  CookieSyncManager.createInstance(this);
  CookieManager cookieManager=CookieManager.getInstance();
  cookieManager.removeAllCookie();
  mWebView=(WebView)findViewById(R.id.loginWebView);
  try {
    mWebView.getSettings().setJavaScriptEnabled(true);
  }
 catch (  Exception e) {
  }
  mWebView.getSettings().setAppCacheEnabled(false);
  mWebView.getSettings().setSavePassword(false);
  mWebView.getSettings().setSaveFormData(false);
  mWebView.setWebViewClient(new WebViewClient(){
    @Override public boolean shouldOverrideUrlLoading(    WebView webView,    String url){
      Log.v("String_Node_Str","String_Node_Str" + url);
      if (url != null && url.startsWith("String_Node_Str")) {
        handleTwitterCallback(url);
      }
 else       if (url.equals("String_Node_Str")) {
        webView.loadUrl(requestUrl);
      }
 else {
        webView.loadUrl(url);
      }
      return true;
    }
  }
);
  noThanks.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      new FollowMe().execute();
      btnLoginTwitter.setText(getResources().getString(R.string.back_to_timeline));
      noThanks.setVisibility(View.GONE);
      summary.setText(getResources().getString(R.string.third_info));
    }
  }
);
  btnLoginTwitter.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View arg0){
      if (btnLoginTwitter.getText().toString().contains(getResources().getString(R.string.login_to_twitter))) {
        if (Utils.hasInternetConnection(context)) {
          btnLoginTwitter.setEnabled(false);
          new AlertDialog.Builder(context).setMessage("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str").setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
            @Override public void onClick(            DialogInterface dialog,            int which){
              dialog.dismiss();
            }
          }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
            @Override public void onClick(            DialogInterface dialog,            int which){
              startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str")));
            }
          }
).show();
          new RetreiveFeedTask().execute();
        }
 else {
          Toast.makeText(context,getResources().getString(R.string.no_network) + "String_Node_Str",Toast.LENGTH_SHORT).show();
        }
      }
 else       if (btnLoginTwitter.getText().toString().contains(getResources().getString(R.string.initial_sync))) {
        new getTimeLine().execute();
      }
 else       if (btnLoginTwitter.getText().toString().contains(getResources().getString(R.string.no_thanks))) {
        btnLoginTwitter.setText(getResources().getString(R.string.back_to_timeline));
        noThanks.setVisibility(View.GONE);
        summary.setText(getResources().getString(R.string.third_info));
      }
 else {
        if (settings.timelineRefresh != 0) {
          AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
          long now=new Date().getTime();
          long alarm=now + settings.timelineRefresh;
          PendingIntent pendingIntent=PendingIntent.getService(context,HomeFragment.HOME_REFRESH_ID,new Intent(context,TimelineRefreshService.class),0);
          am.setRepeating(AlarmManager.RTC_WAKEUP,alarm,settings.timelineRefresh,pendingIntent);
          now=new Date().getTime();
          alarm=now + settings.mentionsRefresh;
          PendingIntent pendingIntent2=PendingIntent.getService(context,MentionsFragment.MENTIONS_REFRESH_ID,new Intent(context,MentionsRefreshService.class),0);
          am.setRepeating(AlarmManager.RTC_WAKEUP,alarm,settings.mentionsRefresh,pendingIntent2);
          alarm=now + settings.dmRefresh;
          PendingIntent pendingIntent3=PendingIntent.getService(context,DMFragment.DM_REFRESH_ID,new Intent(context,DirectMessageRefreshService.class),0);
          am.setRepeating(AlarmManager.RTC_WAKEUP,alarm,settings.dmRefresh,pendingIntent3);
        }
        AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
        long now=new Date().getTime();
        long alarm=now + AlarmManager.INTERVAL_DAY;
        Log.v("String_Node_Str","String_Node_Str" + new Date(alarm).toString());
        PendingIntent pendingIntent=PendingIntent.getService(context,161,new Intent(context,TrimDataService.class),0);
        am.set(AlarmManager.RTC_WAKEUP,alarm,pendingIntent);
        finish();
        Intent timeline=new Intent(context,MainActivity.class);
        timeline.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
        timeline.putExtra("String_Node_Str",true);
        sharedPrefs.edit().putBoolean("String_Node_Str",false).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",true).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",true).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",true).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",false).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",false).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",true).commit();
        sharedPrefs.edit().putBoolean("String_Node_Str",false).commit();
        AppSettings.invalidate();
        startActivity(timeline);
      }
    }
  }
);
}