Program: 180989
Project: 180989
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  Log.v(TAG,"String_Node_Str" + intent.getAction());
  String action=intent.getAction();
  BluetoothDevice device=intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
  if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
    int state=intent.getIntExtra(BluetoothAdapter.EXTRA_STATE,BluetoothAdapter.ERROR);
    mManager.setBluetoothStateInt(state);
  }
 else   if (action.equals(BluetoothAdapter.ACTION_DISCOVERY_STARTED)) {
    mManager.onScanningStateChanged(true);
  }
 else   if (action.equals(BluetoothAdapter.ACTION_DISCOVERY_FINISHED)) {
    mManager.onScanningStateChanged(false);
  }
 else   if (action.equals(BluetoothDevice.ACTION_FOUND)) {
    short rssi=intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,Short.MIN_VALUE);
    BluetoothClass btClass=intent.getParcelableExtra(BluetoothDevice.EXTRA_CLASS);
    String name=intent.getStringExtra(BluetoothDevice.EXTRA_NAME);
    mManager.getCachedDeviceManager().onDeviceAppeared(device,rssi,btClass,name);
  }
 else   if (action.equals(BluetoothDevice.ACTION_DISAPPEARED)) {
    mManager.getCachedDeviceManager().onDeviceDisappeared(device);
  }
 else   if (action.equals(BluetoothDevice.ACTION_NAME_CHANGED)) {
    mManager.getCachedDeviceManager().onDeviceNameUpdated(device);
  }
 else   if (action.equals(BluetoothDevice.ACTION_BOND_STATE_CHANGED)) {
    int bondState=intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE,BluetoothDevice.ERROR);
    mManager.getCachedDeviceManager().onBondingStateChanged(device,bondState);
    if (bondState == BluetoothDevice.BOND_NONE) {
      int reason=intent.getIntExtra(BluetoothDevice.EXTRA_REASON,BluetoothDevice.ERROR);
      mManager.getCachedDeviceManager().onBondingError(device,reason);
    }
  }
 else   if (action.equals(BluetoothHeadset.ACTION_STATE_CHANGED)) {
    int newState=intent.getIntExtra(BluetoothHeadset.EXTRA_STATE,0);
    int oldState=intent.getIntExtra(BluetoothHeadset.EXTRA_PREVIOUS_STATE,0);
    if (newState == BluetoothHeadset.STATE_DISCONNECTED && oldState == BluetoothHeadset.STATE_CONNECTING) {
      Log.i(TAG,"String_Node_Str");
    }
    mManager.getCachedDeviceManager().onProfileStateChanged(device,Profile.HEADSET,newState);
  }
 else   if (action.equals(BluetoothA2dp.ACTION_SINK_STATE_CHANGED)) {
    int newState=intent.getIntExtra(BluetoothA2dp.EXTRA_SINK_STATE,0);
    int oldState=intent.getIntExtra(BluetoothA2dp.EXTRA_PREVIOUS_SINK_STATE,0);
    if (newState == BluetoothA2dp.STATE_DISCONNECTED && oldState == BluetoothA2dp.STATE_CONNECTING) {
      Log.i(TAG,"String_Node_Str");
    }
    mManager.getCachedDeviceManager().onProfileStateChanged(device,Profile.A2DP,newState);
  }
 else   if (action.equals(BluetoothDevice.ACTION_CLASS_CHANGED)) {
    mManager.getCachedDeviceManager().onBtClassChanged(device);
  }
 else   if (action.equals(BluetoothDevice.ACTION_UUID)) {
    mManager.getCachedDeviceManager().onUuidChanged(device);
  }
 else   if (action.equals(BluetoothDevice.ACTION_PAIRING_CANCEL)) {
    int errorMsg=R.string.bluetooth_pairing_error_message;
    mManager.showError(device,R.string.bluetooth_error_title,errorMsg);
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  Log.v(TAG,"String_Node_Str" + intent.getAction());
  String action=intent.getAction();
  BluetoothDevice device=intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
  if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
    int state=intent.getIntExtra(BluetoothAdapter.EXTRA_STATE,BluetoothAdapter.ERROR);
    mManager.setBluetoothStateInt(state);
  }
 else   if (action.equals(BluetoothAdapter.ACTION_DISCOVERY_STARTED)) {
    mManager.onScanningStateChanged(true);
  }
 else   if (action.equals(BluetoothAdapter.ACTION_DISCOVERY_FINISHED)) {
    mManager.onScanningStateChanged(false);
  }
 else   if (action.equals(BluetoothDevice.ACTION_FOUND)) {
    short rssi=intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,Short.MIN_VALUE);
    BluetoothClass btClass=intent.getParcelableExtra(BluetoothDevice.EXTRA_CLASS);
    String name=intent.getStringExtra(BluetoothDevice.EXTRA_NAME);
    mManager.getCachedDeviceManager().onDeviceAppeared(device,rssi,btClass,name);
  }
 else   if (action.equals(BluetoothDevice.ACTION_DISAPPEARED)) {
    mManager.getCachedDeviceManager().onDeviceDisappeared(device);
  }
 else   if (action.equals(BluetoothDevice.ACTION_NAME_CHANGED)) {
    mManager.getCachedDeviceManager().onDeviceNameUpdated(device);
  }
 else   if (action.equals(BluetoothDevice.ACTION_BOND_STATE_CHANGED)) {
    int bondState=intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE,BluetoothDevice.ERROR);
    mManager.getCachedDeviceManager().onBondingStateChanged(device,bondState);
    if (bondState == BluetoothDevice.BOND_NONE) {
      int reason=intent.getIntExtra(BluetoothDevice.EXTRA_REASON,BluetoothDevice.ERROR);
      mManager.getCachedDeviceManager().showUnbondMessage(device,reason);
    }
  }
 else   if (action.equals(BluetoothHeadset.ACTION_STATE_CHANGED)) {
    int newState=intent.getIntExtra(BluetoothHeadset.EXTRA_STATE,0);
    int oldState=intent.getIntExtra(BluetoothHeadset.EXTRA_PREVIOUS_STATE,0);
    if (newState == BluetoothHeadset.STATE_DISCONNECTED && oldState == BluetoothHeadset.STATE_CONNECTING) {
      Log.i(TAG,"String_Node_Str");
    }
    mManager.getCachedDeviceManager().onProfileStateChanged(device,Profile.HEADSET,newState);
  }
 else   if (action.equals(BluetoothA2dp.ACTION_SINK_STATE_CHANGED)) {
    int newState=intent.getIntExtra(BluetoothA2dp.EXTRA_SINK_STATE,0);
    int oldState=intent.getIntExtra(BluetoothA2dp.EXTRA_PREVIOUS_SINK_STATE,0);
    if (newState == BluetoothA2dp.STATE_DISCONNECTED && oldState == BluetoothA2dp.STATE_CONNECTING) {
      Log.i(TAG,"String_Node_Str");
    }
    mManager.getCachedDeviceManager().onProfileStateChanged(device,Profile.A2DP,newState);
  }
 else   if (action.equals(BluetoothDevice.ACTION_CLASS_CHANGED)) {
    mManager.getCachedDeviceManager().onBtClassChanged(device);
  }
 else   if (action.equals(BluetoothDevice.ACTION_UUID)) {
    mManager.getCachedDeviceManager().onUuidChanged(device);
  }
 else   if (action.equals(BluetoothDevice.ACTION_PAIRING_CANCEL)) {
    int errorMsg=R.string.bluetooth_pairing_error_message;
    mManager.showError(device,R.string.bluetooth_error_title,errorMsg);
  }
}