Program: 185008
Project: 185008
Buggy source:
@Override public void onCreate(Bundle icicle){
  if (LOGV_ENABLED) {
    Log.v(LOGTAG,this + "String_Node_Str");
  }
  super.onCreate(icicle);
  if (CUSTOM_BROWSER_BAR) {
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  }
 else {
    this.requestWindowFeature(Window.FEATURE_LEFT_ICON);
    this.requestWindowFeature(Window.FEATURE_RIGHT_ICON);
    this.requestWindowFeature(Window.FEATURE_PROGRESS);
    this.requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  }
  setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
  mResolver=getContentResolver();
  mSecLockIcon=Resources.getSystem().getDrawable(android.R.drawable.ic_secure);
  mMixLockIcon=Resources.getSystem().getDrawable(android.R.drawable.ic_partial_secure);
  mGenericFavicon=getResources().getDrawable(R.drawable.app_web_browser_sm);
  FrameLayout frameLayout=(FrameLayout)getWindow().getDecorView().findViewById(com.android.internal.R.id.content);
  if (CUSTOM_BROWSER_BAR) {
    FrameLayout browserFrameLayout=(FrameLayout)LayoutInflater.from(this).inflate(R.layout.custom_screen,null);
    mTitleBar=(TitleBarSet)browserFrameLayout.findViewById(R.id.title_bar);
    mContentView=(FrameLayout)browserFrameLayout.findViewById(R.id.main_content);
    mErrorConsoleContainer=(LinearLayout)browserFrameLayout.findViewById(R.id.error_console);
    mCustomViewContainer=(FrameLayout)browserFrameLayout.findViewById(R.id.fullscreen_custom_content);
    frameLayout.addView(browserFrameLayout,COVER_SCREEN_PARAMS);
  }
 else {
    mCustomViewContainer=new FrameLayout(this);
    mCustomViewContainer.setBackgroundColor(Color.BLACK);
    mContentView=new FrameLayout(this);
    LinearLayout linearLayout=new LinearLayout(this);
    linearLayout.setOrientation(LinearLayout.VERTICAL);
    mErrorConsoleContainer=new LinearLayout(this);
    linearLayout.addView(mErrorConsoleContainer,new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
    linearLayout.addView(mContentView,COVER_SCREEN_PARAMS);
    frameLayout.addView(mCustomViewContainer,COVER_SCREEN_PARAMS);
    frameLayout.addView(linearLayout,COVER_SCREEN_PARAMS);
  }
  mTabControl=new TabControl(this);
  retainIconsOnStartup();
  mSettings=BrowserSettings.getInstance();
  mSettings.setTabControl(mTabControl);
  mSettings.loadFromDb(this);
  PowerManager pm=(PowerManager)getSystemService(Context.POWER_SERVICE);
  mWakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"String_Node_Str");
  mNetworkStateChangedFilter=new IntentFilter();
  mNetworkStateChangedFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
  mNetworkStateIntentReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
        boolean down=intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY,false);
        onNetworkToggle(!down);
      }
    }
  }
;
  IntentFilter filter=new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
  filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
  filter.addDataScheme("String_Node_Str");
  mPackageInstallationReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      final String action=intent.getAction();
      final String packageName=intent.getData().getSchemeSpecificPart();
      final boolean replacing=intent.getBooleanExtra(Intent.EXTRA_REPLACING,false);
      if (Intent.ACTION_PACKAGE_REMOVED.equals(action) && replacing) {
        return;
      }
      PackageManager pm=BrowserActivity.this.getPackageManager();
      PackageInfo pkgInfo=null;
      try {
        pkgInfo=pm.getPackageInfo(packageName,PackageManager.GET_PERMISSIONS);
      }
 catch (      PackageManager.NameNotFoundException e) {
        return;
      }
      if (pkgInfo != null) {
        String permissions[]=pkgInfo.requestedPermissions;
        if (permissions == null) {
          return;
        }
        boolean permissionOk=false;
        for (        String permit : permissions) {
          if (PluginManager.PLUGIN_PERMISSION.equals(permit)) {
            permissionOk=true;
            break;
          }
        }
        if (permissionOk) {
          PluginManager.getInstance(BrowserActivity.this).refreshPlugins(Intent.ACTION_PACKAGE_ADDED.equals(action));
        }
      }
    }
  }
;
  registerReceiver(mPackageInstallationReceiver,filter);
  if (handleWebSearchIntent(getIntent())) {
    moveTaskToBack(true);
    return;
  }
  if (!mTabControl.restoreState(icicle)) {
    new ClearThumbnails().execute(mTabControl.getThumbnailDir().listFiles());
    CookieManager.getInstance().removeSessionCookie();
    final Intent intent=getIntent();
    final Bundle extra=intent.getExtras();
    UrlData urlData=getUrlDataFromIntent(intent);
    final TabControl.Tab t=mTabControl.createNewTab(Intent.ACTION_VIEW.equals(intent.getAction()) && intent.getData() != null,intent.getStringExtra(Browser.EXTRA_APPLICATION_ID),urlData.mUrl);
    mTabControl.setCurrentTab(t);
    attachTabToContentView(t);
    WebView webView=t.getWebView();
    if (extra != null) {
      int scale=extra.getInt(Browser.INITIAL_ZOOM_LEVEL,0);
      if (scale > 0 && scale <= 1000) {
        webView.setInitialScale(scale);
      }
    }
    if ((extra == null || !extra.getBoolean("String_Node_Str")) && !mSettings.isLoginInitialized()) {
      setupHomePage();
    }
    if (urlData.isEmpty()) {
      bookmarksOrHistoryPicker(false);
    }
 else {
      if (extra != null) {
        urlData.setPostData(extra.getByteArray(Browser.EXTRA_POST_DATA));
      }
      urlData.loadIn(webView);
    }
  }
 else {
    attachTabToContentView(mTabControl.getCurrentTab());
  }
  if (CUSTOM_BROWSER_BAR) {
    for (int i=0; i < mTabControl.getTabCount(); i++) {
      WebView view=mTabControl.getTab(i).getWebView();
      mTitleBar.addTab(view,false);
    }
    mTitleBar.setBrowserActivity(this);
    mTitleBar.setCurrentTab(mTabControl.getCurrentIndex());
  }
  String jsFlags=mSettings.getJsFlags();
  if (jsFlags.trim().length() != 0) {
    mTabControl.getCurrentWebView().setJsFlags(jsFlags);
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle icicle){
  if (LOGV_ENABLED) {
    Log.v(LOGTAG,this + "String_Node_Str");
  }
  super.onCreate(icicle);
  if (CUSTOM_BROWSER_BAR) {
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  }
 else {
    this.requestWindowFeature(Window.FEATURE_LEFT_ICON);
    this.requestWindowFeature(Window.FEATURE_RIGHT_ICON);
    this.requestWindowFeature(Window.FEATURE_PROGRESS);
    this.requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  }
  setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
  mResolver=getContentResolver();
  mSecLockIcon=Resources.getSystem().getDrawable(android.R.drawable.ic_secure);
  mMixLockIcon=Resources.getSystem().getDrawable(android.R.drawable.ic_partial_secure);
  mGenericFavicon=getResources().getDrawable(R.drawable.app_web_browser_sm);
  FrameLayout frameLayout=(FrameLayout)getWindow().getDecorView().findViewById(com.android.internal.R.id.content);
  if (CUSTOM_BROWSER_BAR) {
    FrameLayout browserFrameLayout=(FrameLayout)LayoutInflater.from(this).inflate(R.layout.custom_screen,null);
    mTitleBar=(TitleBarSet)browserFrameLayout.findViewById(R.id.title_bar);
    mContentView=(FrameLayout)browserFrameLayout.findViewById(R.id.main_content);
    mErrorConsoleContainer=(LinearLayout)browserFrameLayout.findViewById(R.id.error_console);
    mCustomViewContainer=(FrameLayout)browserFrameLayout.findViewById(R.id.fullscreen_custom_content);
    frameLayout.addView(browserFrameLayout,COVER_SCREEN_PARAMS);
  }
 else {
    mCustomViewContainer=new FrameLayout(this);
    mCustomViewContainer.setBackgroundColor(Color.BLACK);
    mContentView=new FrameLayout(this);
    LinearLayout linearLayout=new LinearLayout(this);
    linearLayout.setOrientation(LinearLayout.VERTICAL);
    mErrorConsoleContainer=new LinearLayout(this);
    linearLayout.addView(mErrorConsoleContainer,new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT));
    linearLayout.addView(mContentView,COVER_SCREEN_PARAMS);
    frameLayout.addView(mCustomViewContainer,COVER_SCREEN_PARAMS);
    frameLayout.addView(linearLayout,COVER_SCREEN_PARAMS);
  }
  mTabControl=new TabControl(this);
  retainIconsOnStartup();
  mSettings=BrowserSettings.getInstance();
  mSettings.setTabControl(mTabControl);
  mSettings.loadFromDb(this);
  PowerManager pm=(PowerManager)getSystemService(Context.POWER_SERVICE);
  mWakeLock=pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"String_Node_Str");
  mNetworkStateChangedFilter=new IntentFilter();
  mNetworkStateChangedFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
  mNetworkStateIntentReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
        boolean down=intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY,false);
        onNetworkToggle(!down);
      }
    }
  }
;
  IntentFilter filter=new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
  filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
  filter.addDataScheme("String_Node_Str");
  mPackageInstallationReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      final String action=intent.getAction();
      final String packageName=intent.getData().getSchemeSpecificPart();
      final boolean replacing=intent.getBooleanExtra(Intent.EXTRA_REPLACING,false);
      if (Intent.ACTION_PACKAGE_REMOVED.equals(action) && replacing) {
        return;
      }
      PackageManager pm=BrowserActivity.this.getPackageManager();
      PackageInfo pkgInfo=null;
      try {
        pkgInfo=pm.getPackageInfo(packageName,PackageManager.GET_PERMISSIONS);
      }
 catch (      PackageManager.NameNotFoundException e) {
        return;
      }
      if (pkgInfo != null) {
        String permissions[]=pkgInfo.requestedPermissions;
        if (permissions == null) {
          return;
        }
        boolean permissionOk=false;
        for (        String permit : permissions) {
          if (PluginManager.PLUGIN_PERMISSION.equals(permit)) {
            permissionOk=true;
            break;
          }
        }
        if (permissionOk) {
          PluginManager.getInstance(BrowserActivity.this).refreshPlugins(Intent.ACTION_PACKAGE_ADDED.equals(action));
        }
      }
    }
  }
;
  registerReceiver(mPackageInstallationReceiver,filter);
  if (handleWebSearchIntent(getIntent())) {
    moveTaskToBack(true);
    return;
  }
  if (!mTabControl.restoreState(icicle)) {
    new ClearThumbnails().execute(mTabControl.getThumbnailDir().listFiles());
    CookieManager.getInstance().removeSessionCookie();
    final Intent intent=getIntent();
    final Bundle extra=intent.getExtras();
    UrlData urlData=getUrlDataFromIntent(intent);
    final TabControl.Tab t=mTabControl.createNewTab(Intent.ACTION_VIEW.equals(intent.getAction()) && intent.getData() != null,intent.getStringExtra(Browser.EXTRA_APPLICATION_ID),urlData.mUrl);
    mTabControl.setCurrentTab(t);
    attachTabToContentView(t);
    WebView webView=t.getWebView();
    if (extra != null) {
      int scale=extra.getInt(Browser.INITIAL_ZOOM_LEVEL,0);
      if (scale > 0 && scale <= 1000) {
        webView.setInitialScale(scale);
      }
    }
    if ((extra == null || !extra.getBoolean("String_Node_Str")) && !mSettings.isLoginInitialized()) {
      setupHomePage();
    }
    if (urlData.isEmpty()) {
      bookmarksOrHistoryPicker(false,true);
    }
 else {
      if (extra != null) {
        urlData.setPostData(extra.getByteArray(Browser.EXTRA_POST_DATA));
      }
      urlData.loadIn(webView);
    }
  }
 else {
    attachTabToContentView(mTabControl.getCurrentTab());
  }
  if (CUSTOM_BROWSER_BAR) {
    for (int i=0; i < mTabControl.getTabCount(); i++) {
      WebView view=mTabControl.getTab(i).getWebView();
      mTitleBar.addTab(view,false);
    }
    mTitleBar.setBrowserActivity(this);
    mTitleBar.setCurrentTab(mTabControl.getCurrentIndex());
  }
  String jsFlags=mSettings.getJsFlags();
  if (jsFlags.trim().length() != 0) {
    mTabControl.getCurrentWebView().setJsFlags(jsFlags);
  }
}