Program: 162648
Project: 162648
Buggy source:
@SuppressLint("String_Node_Str") protected void scanLeDevice(final Boolean enable){
  mScanCyclerStarted=true;
  if (getBluetoothAdapter() == null) {
    LogManager.e(TAG,"String_Node_Str");
  }
  if (enable) {
    if (deferScanIfNeeded()) {
      return;
    }
    LogManager.d(TAG,"String_Node_Str");
    if (!mScanning || mScanningPaused || mRestartNeeded) {
      mScanning=true;
      mScanningPaused=false;
      try {
        if (getBluetoothAdapter() != null) {
          if (getBluetoothAdapter().isEnabled()) {
            if (mBluetoothCrashResolver != null && mBluetoothCrashResolver.isRecoveryInProgress()) {
              LogManager.w(TAG,"String_Node_Str");
            }
 else {
              if (mScanningEnabled) {
                if (mRestartNeeded) {
                  mRestartNeeded=false;
                  LogManager.d(TAG,"String_Node_Str");
                }
 else {
                  LogManager.d(TAG,"String_Node_Str");
                }
                try {
                  if (android.os.Build.VERSION.SDK_INT < 23 || checkLocationPermission()) {
                    startScan();
                  }
                }
 catch (                Exception e) {
                  LogManager.e(e,TAG,"String_Node_Str");
                }
              }
 else {
                LogManager.d(TAG,"String_Node_Str");
              }
            }
            mLastScanCycleStartTime=SystemClock.elapsedRealtime();
          }
 else {
            LogManager.d(TAG,"String_Node_Str");
          }
        }
      }
 catch (      Exception e) {
        LogManager.e(e,TAG,"String_Node_Str");
      }
    }
 else {
      LogManager.d(TAG,"String_Node_Str");
    }
    mScanCycleStopTime=(SystemClock.elapsedRealtime() + mScanPeriod);
    scheduleScanCycleStop();
    LogManager.d(TAG,"String_Node_Str");
  }
 else {
    LogManager.d(TAG,"String_Node_Str");
    mScanning=false;
    mScanCyclerStarted=false;
    stopScan();
    mLastScanCycleEndTime=SystemClock.elapsedRealtime();
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") protected void scanLeDevice(final Boolean enable){
  try {
    mScanCyclerStarted=true;
    if (getBluetoothAdapter() == null) {
      LogManager.e(TAG,"String_Node_Str");
    }
    if (enable) {
      if (deferScanIfNeeded()) {
        return;
      }
      LogManager.d(TAG,"String_Node_Str");
      if (!mScanning || mScanningPaused || mRestartNeeded) {
        mScanning=true;
        mScanningPaused=false;
        try {
          if (getBluetoothAdapter() != null) {
            if (getBluetoothAdapter().isEnabled()) {
              if (mBluetoothCrashResolver != null && mBluetoothCrashResolver.isRecoveryInProgress()) {
                LogManager.w(TAG,"String_Node_Str");
              }
 else {
                if (mScanningEnabled) {
                  if (mRestartNeeded) {
                    mRestartNeeded=false;
                    LogManager.d(TAG,"String_Node_Str");
                  }
 else {
                    LogManager.d(TAG,"String_Node_Str");
                  }
                  try {
                    if (android.os.Build.VERSION.SDK_INT < 23 || checkLocationPermission()) {
                      startScan();
                    }
                  }
 catch (                  Exception e) {
                    LogManager.e(e,TAG,"String_Node_Str");
                  }
                }
 else {
                  LogManager.d(TAG,"String_Node_Str");
                }
              }
              mLastScanCycleStartTime=SystemClock.elapsedRealtime();
            }
 else {
              LogManager.d(TAG,"String_Node_Str");
            }
          }
        }
 catch (        Exception e) {
          LogManager.e(e,TAG,"String_Node_Str");
        }
      }
 else {
        LogManager.d(TAG,"String_Node_Str");
      }
      mScanCycleStopTime=(SystemClock.elapsedRealtime() + mScanPeriod);
      scheduleScanCycleStop();
      LogManager.d(TAG,"String_Node_Str");
    }
 else {
      LogManager.d(TAG,"String_Node_Str");
      mScanning=false;
      mScanCyclerStarted=false;
      stopScan();
      mLastScanCycleEndTime=SystemClock.elapsedRealtime();
    }
  }
 catch (  SecurityException e) {
    LogManager.w(TAG,"String_Node_Str");
  }
}