Program: 29763
Project: 29763
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  Log.d("String_Node_Str","String_Node_Str");
  PreferenceManager.setDefaultValues(this,R.xml.preferences,false);
  try {
    PreferenceManager.getDefaultSharedPreferences(this).edit().putString("String_Node_Str",getPackageManager().getPackageInfo(getPackageName(),0).versionName).commit();
  }
 catch (  NameNotFoundException e1) {
  }
  Util.setActivityTheme(this);
  openHABServiceType=getString(R.string.openhab_service_type);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  requestWindowFeature(Window.FEATURE_PROGRESS);
  setProgressBarIndeterminateVisibility(true);
  JSONObject crittercismConfig=new JSONObject();
  try {
    crittercismConfig.put("String_Node_Str",true);
  }
 catch (  JSONException e) {
    if (e.getMessage() != null)     Log.e(TAG,e.getMessage());
 else     Log.e(TAG,"String_Node_Str");
  }
  Crittercism.init(getApplicationContext(),"String_Node_Str",crittercismConfig);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.openhabwidgetlist);
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(this);
  if (settings.getBoolean("String_Node_Str",false)) {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  }
  openHABUsername=settings.getString("String_Node_Str",null);
  openHABPassword=settings.getString("String_Node_Str",null);
  openHABWidgetDataSource=new OpenHABWidgetDataSource();
  openHABWidgetAdapter=new OpenHABWidgetAdapter(OpenHABWidgetListActivity.this,R.layout.openhabwidgetlist_genericitem,widgetList);
  getListView().setAdapter(openHABWidgetAdapter);
  openHABWidgetAdapter.setOpenHABUsername(openHABUsername);
  openHABWidgetAdapter.setOpenHABPassword(openHABPassword);
  this.getActionBar().setHomeButtonEnabled(true);
  if (savedInstanceState != null) {
    displayPageUrl=savedInstanceState.getString("String_Node_Str");
    pageStack=savedInstanceState.getParcelableArrayList("String_Node_Str");
    openHABBaseUrl=savedInstanceState.getString("String_Node_Str");
    sitemapRootUrl=savedInstanceState.getString("String_Node_Str");
    openHABWidgetAdapter.setOpenHABBaseUrl(openHABBaseUrl);
  }
  if (displayPageUrl.length() > 0) {
    Log.d(TAG,"String_Node_Str" + displayPageUrl);
    showPage(displayPageUrl,false);
  }
 else {
    if (getIntent() != null) {
      if (getIntent().getAction().equals("String_Node_Str")) {
        nfcTagData=getIntent().getDataString();
      }
    }
    if (settings.getBoolean("String_Node_Str",false)) {
      openHABBaseUrl=getString(R.string.openhab_demo_url);
      Log.i(TAG,"String_Node_Str" + openHABBaseUrl);
      Toast.makeText(getApplicationContext(),getString(R.string.info_demo_mode),Toast.LENGTH_LONG).show();
      showTime();
    }
 else {
      openHABBaseUrl=normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
      if (openHABBaseUrl.length() > 0) {
        Log.i(TAG,"String_Node_Str" + openHABBaseUrl);
        Toast.makeText(getApplicationContext(),getString(R.string.info_conn_url),Toast.LENGTH_SHORT).show();
        showTime();
      }
 else {
        ConnectivityManager connectivityManager=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetworkInfo=connectivityManager.getActiveNetworkInfo();
        if (activeNetworkInfo != null) {
          Log.i(TAG,"String_Node_Str");
          if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE) {
            Log.i(TAG,"String_Node_Str" + activeNetworkInfo.getSubtypeName() + "String_Node_Str");
            openHABBaseUrl=normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
            if (openHABBaseUrl.length() > 0) {
              Toast.makeText(getApplicationContext(),getString(R.string.info_conn_rem_url),Toast.LENGTH_SHORT).show();
              Log.i(TAG,"String_Node_Str" + openHABBaseUrl);
              showTime();
            }
 else {
              Toast.makeText(getApplicationContext(),getString(R.string.error_no_url),Toast.LENGTH_LONG).show();
            }
          }
          if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI || activeNetworkInfo.getType() == ConnectivityManager.TYPE_ETHERNET) {
            Log.i(TAG,"String_Node_Str");
            AsyncServiceResolver serviceResolver=new AsyncServiceResolver(this,openHABServiceType);
            progressDialog=ProgressDialog.show(this,"String_Node_Str","String_Node_Str",true);
            serviceResolver.start();
          }
 else {
            Log.i(TAG,"String_Node_Str" + activeNetworkInfo.getTypeName() + "String_Node_Str");
          }
        }
 else {
          Log.i(TAG,"String_Node_Str");
          Toast.makeText(getApplicationContext(),getString(R.string.error_network_not_available),Toast.LENGTH_LONG).show();
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  Log.d("String_Node_Str","String_Node_Str");
  PreferenceManager.setDefaultValues(this,R.xml.preferences,false);
  try {
    PreferenceManager.getDefaultSharedPreferences(this).edit().putString("String_Node_Str",getPackageManager().getPackageInfo(getPackageName(),0).versionName).commit();
  }
 catch (  NameNotFoundException e1) {
  }
  Util.setActivityTheme(this);
  openHABServiceType=getString(R.string.openhab_service_type);
  requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
  requestWindowFeature(Window.FEATURE_PROGRESS);
  setProgressBarIndeterminateVisibility(true);
  JSONObject crittercismConfig=new JSONObject();
  try {
    crittercismConfig.put("String_Node_Str",true);
  }
 catch (  JSONException e) {
    if (e.getMessage() != null)     Log.e(TAG,e.getMessage());
 else     Log.e(TAG,"String_Node_Str");
  }
  Crittercism.init(getApplicationContext(),"String_Node_Str",crittercismConfig);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.openhabwidgetlist);
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(this);
  if (settings.getBoolean("String_Node_Str",false)) {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  }
  openHABUsername=settings.getString("String_Node_Str",null);
  openHABPassword=settings.getString("String_Node_Str",null);
  openHABWidgetDataSource=new OpenHABWidgetDataSource();
  openHABWidgetAdapter=new OpenHABWidgetAdapter(OpenHABWidgetListActivity.this,R.layout.openhabwidgetlist_genericitem,widgetList);
  getListView().setAdapter(openHABWidgetAdapter);
  openHABWidgetAdapter.setOpenHABUsername(openHABUsername);
  openHABWidgetAdapter.setOpenHABPassword(openHABPassword);
  this.getActionBar().setHomeButtonEnabled(true);
  if (savedInstanceState != null) {
    displayPageUrl=savedInstanceState.getString("String_Node_Str");
    pageStack=savedInstanceState.getParcelableArrayList("String_Node_Str");
    openHABBaseUrl=savedInstanceState.getString("String_Node_Str");
    sitemapRootUrl=savedInstanceState.getString("String_Node_Str");
    openHABWidgetAdapter.setOpenHABBaseUrl(openHABBaseUrl);
  }
  if (displayPageUrl.length() > 0) {
    Log.d(TAG,"String_Node_Str" + displayPageUrl);
    showPage(displayPageUrl,false);
  }
 else {
    if (getIntent() != null) {
      if (getIntent().getAction().equals("String_Node_Str")) {
        nfcTagData=getIntent().getDataString();
      }
    }
    if (settings.getBoolean("String_Node_Str",false)) {
      openHABBaseUrl=getString(R.string.openhab_demo_url);
      Log.i(TAG,"String_Node_Str" + openHABBaseUrl);
      Toast.makeText(getApplicationContext(),getString(R.string.info_demo_mode),Toast.LENGTH_LONG).show();
      showTime();
    }
 else {
      openHABBaseUrl=normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
      if (openHABBaseUrl.length() > 0) {
        Log.i(TAG,"String_Node_Str" + openHABBaseUrl);
        Toast.makeText(getApplicationContext(),getString(R.string.info_conn_url),Toast.LENGTH_SHORT).show();
        showTime();
      }
 else {
        ConnectivityManager connectivityManager=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetworkInfo=connectivityManager.getActiveNetworkInfo();
        if (activeNetworkInfo != null) {
          Log.i(TAG,"String_Node_Str");
          if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE) {
            Log.i(TAG,"String_Node_Str" + activeNetworkInfo.getSubtypeName() + "String_Node_Str");
            openHABBaseUrl=normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
            if (openHABBaseUrl.length() > 0) {
              Toast.makeText(getApplicationContext(),getString(R.string.info_conn_rem_url),Toast.LENGTH_SHORT).show();
              Log.i(TAG,"String_Node_Str" + openHABBaseUrl);
              showTime();
            }
 else {
              Toast.makeText(getApplicationContext(),getString(R.string.error_no_url),Toast.LENGTH_LONG).show();
            }
          }
          if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI || activeNetworkInfo.getType() == ConnectivityManager.TYPE_ETHERNET) {
            Log.i(TAG,"String_Node_Str");
            this.serviceResolver=new AsyncServiceResolver(this,openHABServiceType);
            progressDialog=ProgressDialog.show(this,"String_Node_Str","String_Node_Str",true);
            this.serviceResolver.start();
          }
 else {
            Log.i(TAG,"String_Node_Str" + activeNetworkInfo.getTypeName() + "String_Node_Str");
          }
        }
 else {
          Log.i(TAG,"String_Node_Str");
          Toast.makeText(getApplicationContext(),getString(R.string.error_network_not_available),Toast.LENGTH_LONG).show();
        }
      }
    }
  }
}