Source:
<code>protected void open() throws XBeeException { logger.info(toString() + "Opening the connection interface..."); if (isRemote()) <START> throw new RuntimeException("Remote devices cannot be open."); <END> if (connectionInterface.isOpen()) throw new InterfaceAlreadyOpenException(); connectionInterface.open(); logger.info(toString() + "Connection interface open."); dataReader = new DataReader(connectionInterface, operatingMode, (XBeeDevice)this); dataReader.start(); try { Thread.sleep(10); } catch (InterruptedException e) if (connectionInterface.getConnectionType() == ConnectionType.BLUETOOTH) { operatingMode = OperatingMode.API; dataReader.setXBeeReaderMode(operatingMode); try { logger.info(toString() + "Starting Bluetooth authentication..."); BluetoothAuthentication auth = new BluetoothAuthentication((XBeeDevice)this, bluetoothPassword); auth.authenticate(); ((AbstractBluetoothInterface) connectionInterface).setEncryptionKeys(auth.getKey(), auth.getTxNonce(), auth.getRxNonce()); logger.info(toString() + "Authentication finished successfully."); } catch (BluetoothAuthenticationException e) { close(); throw e; } } else { if (operatingMode == OperatingMode.UNKNOWN) operatingMode = determineOperatingMode(); if (operatingMode == OperatingMode.UNKNOWN) { close(); throw new InvalidOperatingModeException("Could not determine operating mode."); } else if (operatingMode == OperatingMode.AT) { close(); throw new InvalidOperatingModeException(operatingMode); } } try { readDeviceInfo(); } catch (ATCommandException e) { throw new XBeeException("Error reading device information.", e); } }</code><technical_language>I throw OperationNotSupportedException</technical_language>

Target:
protected void open() throws XBeeException { logger.info(toString() + "Opening the connection interface..."); if (isRemote()) throw new OperationNotSupportedException("Remote devices cannot be open."); if (connectionInterface.isOpen()) throw new InterfaceAlreadyOpenException(); connectionInterface.open(); logger.info(toString() + "Connection interface open."); dataReader = new DataReader(connectionInterface, operatingMode, (XBeeDevice)this); dataReader.start(); try { Thread.sleep(10); } catch (InterruptedException e) if (connectionInterface.getConnectionType() == ConnectionType.BLUETOOTH) { operatingMode = OperatingMode.API; dataReader.setXBeeReaderMode(operatingMode); try { logger.info(toString() + "Starting Bluetooth authentication..."); BluetoothAuthentication auth = new BluetoothAuthentication((XBeeDevice)this, bluetoothPassword); auth.authenticate(); ((AbstractBluetoothInterface) connectionInterface).setEncryptionKeys(auth.getKey(), auth.getTxNonce(), auth.getRxNonce()); logger.info(toString() + "Authentication finished successfully."); } catch (BluetoothAuthenticationException e) { close(); throw e; } } else { if (operatingMode == OperatingMode.UNKNOWN) operatingMode = determineOperatingMode(); if (operatingMode == OperatingMode.UNKNOWN) { close(); throw new InvalidOperatingModeException("Could not determine operating mode."); } else if (operatingMode == OperatingMode.AT) { close(); throw new InvalidOperatingModeException(operatingMode); } } try { readDeviceInfo(); } catch (ATCommandException e) { throw new XBeeException("Error reading device information.", e); } }