Program: 29761
Project: 29761
Buggy source:
public void start(){
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(mCtx);
  mCtx.registerReceiver(mConnectivityChangeReceiver,new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
  if (settings.getBoolean("String_Node_Str",false)) {
    mOpenHABUrl=mCtx.getString(R.string.openhab_demo_url);
    Log.d(TAG,"String_Node_Str" + mOpenHABUrl);
    openHABTracked(mOpenHABUrl,mCtx.getString(R.string.info_demo_mode));
    return;
  }
 else {
    mOpenHABUrl=Util.normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
    if (mOpenHABUrl.length() > 0) {
      Log.d(TAG,"String_Node_Str" + mOpenHABUrl);
      openHABTracked(mOpenHABUrl,mCtx.getString(R.string.info_conn_url));
      return;
    }
 else {
      ConnectivityManager connectivityManager=(ConnectivityManager)mCtx.getSystemService(Context.CONNECTIVITY_SERVICE);
      NetworkInfo activeNetworkInfo=connectivityManager.getActiveNetworkInfo();
      if (activeNetworkInfo != null) {
        Log.d(TAG,"String_Node_Str");
        if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE || mDiscoveryEnabled == false) {
          if (!mDiscoveryEnabled) {
            Log.d(TAG,"String_Node_Str");
          }
 else {
            Log.d(TAG,"String_Node_Str" + activeNetworkInfo.getSubtypeName() + "String_Node_Str");
          }
          mOpenHABUrl=Util.normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
          if (mOpenHABUrl.length() > 0) {
            Log.d(TAG,"String_Node_Str" + mOpenHABUrl);
            openHABTracked(mOpenHABUrl,mCtx.getString(R.string.info_conn_rem_url));
          }
 else {
            openHABError(mCtx.getString(R.string.error_no_url));
          }
        }
        if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI || activeNetworkInfo.getType() == ConnectivityManager.TYPE_ETHERNET) {
          Log.i(TAG,"String_Node_Str");
          mServiceResolver=new AsyncServiceResolver(mCtx,this,mOpenHABServiceType);
          bonjourDiscoveryStarted();
          mServiceResolver.start();
        }
 else {
          Log.e(TAG,"String_Node_Str" + activeNetworkInfo.getTypeName() + "String_Node_Str");
          openHABError("String_Node_Str" + activeNetworkInfo.getTypeName() + "String_Node_Str");
        }
      }
 else {
        Log.e(TAG,"String_Node_Str");
        openHABError(mCtx.getString(R.string.error_network_not_available));
      }
    }
  }
}

Fixed version (ground truth):
public void start(){
  SharedPreferences settings=PreferenceManager.getDefaultSharedPreferences(mCtx);
  mCtx.registerReceiver(mConnectivityChangeReceiver,new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
  if (settings.getBoolean("String_Node_Str",false)) {
    mOpenHABUrl=mCtx.getString(R.string.openhab_demo_url);
    Log.d(TAG,"String_Node_Str" + mOpenHABUrl);
    openHABTracked(mOpenHABUrl,mCtx.getString(R.string.info_demo_mode));
    return;
  }
 else {
    mOpenHABUrl=Util.normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
    if (mOpenHABUrl.length() > 0) {
      Log.d(TAG,"String_Node_Str" + mOpenHABUrl);
      openHABTracked(mOpenHABUrl,mCtx.getString(R.string.info_conn_url));
      return;
    }
 else {
      ConnectivityManager connectivityManager=(ConnectivityManager)mCtx.getSystemService(Context.CONNECTIVITY_SERVICE);
      NetworkInfo activeNetworkInfo=connectivityManager.getActiveNetworkInfo();
      if (activeNetworkInfo != null) {
        Log.d(TAG,"String_Node_Str");
        if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE || mDiscoveryEnabled == false) {
          if (!mDiscoveryEnabled) {
            Log.d(TAG,"String_Node_Str");
          }
 else {
            Log.d(TAG,"String_Node_Str" + activeNetworkInfo.getSubtypeName() + "String_Node_Str");
          }
          mOpenHABUrl=Util.normalizeUrl(settings.getString("String_Node_Str","String_Node_Str"));
          if (mOpenHABUrl.length() > 0) {
            Log.d(TAG,"String_Node_Str" + mOpenHABUrl);
            openHABTracked(mOpenHABUrl,mCtx.getString(R.string.info_conn_rem_url));
          }
 else {
            openHABError(mCtx.getString(R.string.error_no_url));
          }
        }
 else         if (activeNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI || activeNetworkInfo.getType() == ConnectivityManager.TYPE_ETHERNET) {
          Log.i(TAG,"String_Node_Str");
          mServiceResolver=new AsyncServiceResolver(mCtx,this,mOpenHABServiceType);
          bonjourDiscoveryStarted();
          mServiceResolver.start();
        }
 else {
          Log.e(TAG,"String_Node_Str" + activeNetworkInfo.getTypeName() + "String_Node_Str");
          openHABError("String_Node_Str" + activeNetworkInfo.getTypeName() + "String_Node_Str");
        }
      }
 else {
        Log.e(TAG,"String_Node_Str");
        openHABError(mCtx.getString(R.string.error_network_not_available));
      }
    }
  }
}