Program: 162697
Project: 162697
Buggy source:
@SuppressLint("String_Node_Str") private void scanLeDevice(final Boolean enable){
  mScanCyclerStarted=true;
  if (android.os.Build.VERSION.SDK_INT < 18) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  if (getBluetoothAdapter() == null) {
    Log.e(TAG,"String_Node_Str");
  }
  if (enable) {
    if (deferScanIfNeeded()) {
      return;
    }
    Log.d(TAG,"String_Node_Str");
    if (mScanning == false || mScanningPaused || mRestartNeeded) {
      mScanning=true;
      mScanningPaused=false;
      try {
        if (getBluetoothAdapter() != null) {
          if (getBluetoothAdapter().isEnabled()) {
            if (mBluetoothCrashResolver != null && mBluetoothCrashResolver.isRecoveryInProgress()) {
              Log.w(TAG,"String_Node_Str");
            }
 else {
              if (mScanningEnabled) {
                try {
                  if (mUseAndroidLScanner) {
                    if (mRestartNeeded) {
                      mRestartNeeded=false;
                      Log.d(TAG,"String_Node_Str");
                    }
 else {
                      Log.d(TAG,"String_Node_Str");
                    }
                    List<ScanFilter> filters=new ArrayList<ScanFilter>();
                    if (mScanner == null) {
                      Log.d(TAG,"String_Node_Str");
                      mScanner=getBluetoothAdapter().getBluetoothLeScanner();
                    }
                    ScanSettings settings;
                    if (mBackgroundFlag) {
                      Log.d(TAG,"String_Node_Str");
                      settings=(new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_POWER)).build();
                    }
 else {
                      Log.d(TAG,"String_Node_Str");
                      settings=(new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)).build();
                    }
                    mScanner.startScan(filters,settings,(android.bluetooth.le.ScanCallback)getNewLeScanCallback());
                  }
 else {
                    Log.d(TAG,"String_Node_Str");
                    mRestartNeeded=false;
                    getBluetoothAdapter().startLeScan((BluetoothAdapter.LeScanCallback)getLeScanCallback());
                  }
                }
 catch (                Exception e) {
                  Log.w("String_Node_Str",e);
                }
              }
 else {
                BeaconManager.logDebug(TAG,"String_Node_Str");
              }
            }
            mLastScanCycleStartTime=new Date().getTime();
          }
 else {
            Log.w(TAG,"String_Node_Str");
          }
        }
      }
 catch (      Exception e) {
        Log.e("String_Node_Str","String_Node_Str",e);
      }
    }
 else {
      BeaconManager.logDebug(TAG,"String_Node_Str");
    }
    mScanCycleStopTime=(new Date().getTime() + mScanPeriod);
    scheduleScanCycleStop();
    BeaconManager.logDebug(TAG,"String_Node_Str");
  }
 else {
    BeaconManager.logDebug(TAG,"String_Node_Str");
    mScanning=false;
    if (getBluetoothAdapter() != null) {
      try {
        getBluetoothAdapter().stopLeScan((BluetoothAdapter.LeScanCallback)getLeScanCallback());
      }
 catch (      Exception e) {
        Log.w("String_Node_Str",e);
      }
      mLastScanCycleEndTime=new Date().getTime();
    }
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") private void scanLeDevice(final Boolean enable){
  mScanCyclerStarted=true;
  if (android.os.Build.VERSION.SDK_INT < 18) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  if (getBluetoothAdapter() == null) {
    Log.e(TAG,"String_Node_Str");
  }
  if (enable) {
    if (deferScanIfNeeded()) {
      return;
    }
    BeaconManager.logDebug(TAG,"String_Node_Str");
    if (mScanning == false || mScanningPaused || mRestartNeeded) {
      mScanning=true;
      mScanningPaused=false;
      try {
        if (getBluetoothAdapter() != null) {
          if (getBluetoothAdapter().isEnabled()) {
            if (mBluetoothCrashResolver != null && mBluetoothCrashResolver.isRecoveryInProgress()) {
              Log.w(TAG,"String_Node_Str");
            }
 else {
              if (mScanningEnabled) {
                try {
                  if (mUseAndroidLScanner) {
                    if (mRestartNeeded) {
                      mRestartNeeded=false;
                      BeaconManager.logDebug(TAG,"String_Node_Str");
                    }
 else {
                      BeaconManager.logDebug(TAG,"String_Node_Str");
                    }
                    List<ScanFilter> filters=new ArrayList<ScanFilter>();
                    if (mScanner == null) {
                      BeaconManager.logDebug(TAG,"String_Node_Str");
                      mScanner=getBluetoothAdapter().getBluetoothLeScanner();
                    }
                    ScanSettings settings;
                    if (mBackgroundFlag) {
                      BeaconManager.logDebug(TAG,"String_Node_Str");
                      settings=(new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_POWER)).build();
                    }
 else {
                      BeaconManager.logDebug(TAG,"String_Node_Str");
                      settings=(new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)).build();
                    }
                    mScanner.startScan(filters,settings,(android.bluetooth.le.ScanCallback)getNewLeScanCallback());
                  }
 else {
                    BeaconManager.logDebug(TAG,"String_Node_Str");
                    mRestartNeeded=false;
                    getBluetoothAdapter().startLeScan((BluetoothAdapter.LeScanCallback)getLeScanCallback());
                  }
                }
 catch (                Exception e) {
                  Log.w("String_Node_Str",e);
                }
              }
 else {
                BeaconManager.logDebug(TAG,"String_Node_Str");
              }
            }
            mLastScanCycleStartTime=new Date().getTime();
          }
 else {
            Log.w(TAG,"String_Node_Str");
          }
        }
      }
 catch (      Exception e) {
        Log.e("String_Node_Str","String_Node_Str",e);
      }
    }
 else {
      BeaconManager.logDebug(TAG,"String_Node_Str");
    }
    mScanCycleStopTime=(new Date().getTime() + mScanPeriod);
    scheduleScanCycleStop();
    BeaconManager.logDebug(TAG,"String_Node_Str");
  }
 else {
    BeaconManager.logDebug(TAG,"String_Node_Str");
    mScanning=false;
    if (mUseAndroidLScanner) {
      mScanner.stopScan((android.bluetooth.le.ScanCallback)getNewLeScanCallback());
    }
 else {
      if (getBluetoothAdapter() != null) {
        try {
          getBluetoothAdapter().stopLeScan((BluetoothAdapter.LeScanCallback)getLeScanCallback());
        }
 catch (        Exception e) {
          Log.w("String_Node_Str",e);
        }
        mLastScanCycleEndTime=new Date().getTime();
      }
    }
  }
}