Source:
<code>public void openPort() throws InitializationException { if (typeIsSerial) { CommPortIdentifier portIdentifier; try { portIdentifier = CommPortIdentifier.getPortIdentifier(port); try { serialPort = portIdentifier.open("openhab", 3000); serialPort.setSerialPortParams(19200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.enableReceiveTimeout(100); serialPort.enableReceiveThreshold(1); inputStream = new DataInputStream(new BufferedInputStream(serialPort.getInputStream())); outputStream = serialPort.getOutputStream(); <START> logger.debug("port opened: " + port); <END> } catch (PortInUseException e) { throw new InitializationException(e); } catch (UnsupportedCommOperationException e) { throw new InitializationException(e); } catch (IOException e) { throw new InitializationException(e); } } catch (NoSuchPortException e) { StringBuilder sb = new StringBuilder(); Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier id = (CommPortIdentifier) portList.nextElement(); if (id.getPortType() == CommPortIdentifier.PORT_SERIAL) { sb.append(id.getName() + "\n"); } } throw new InitializationException( "Serial port '" + port + "' could not be found. Available ports are:\n" + sb.toString()); } } else { try { ipSocket = new Socket(hostName, ipPortNumber); inputStream = ipSocket.getInputStream(); outputStream = ipSocket.getOutputStream(); logger.debug("ipSocket opened: " + hostName + " on port " + ipPortNumber); } catch (UnknownHostException e) { throw new InitializationException("UnknownHost '" + hostName); } catch (IOException e) { throw new InitializationException("IO error with '" + hostName + " on port " + ipPortNumber); } } }</code><technical_language>Need parameterized logging instead of string concatenation</technical_language>

Target:
public void openPort() throws InitializationException { if (typeIsSerial) { CommPortIdentifier portIdentifier; try { portIdentifier = CommPortIdentifier.getPortIdentifier(port); try { serialPort = portIdentifier.open("openhab", 3000); serialPort.setSerialPortParams(19200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.enableReceiveTimeout(100); serialPort.enableReceiveThreshold(1); inputStream = new DataInputStream(new BufferedInputStream(serialPort.getInputStream())); outputStream = serialPort.getOutputStream(); logger.debug("port opened: {}", port); } catch (PortInUseException e) { throw new InitializationException(e); } catch (UnsupportedCommOperationException e) { throw new InitializationException(e); } catch (IOException e) { throw new InitializationException(e); } } catch (NoSuchPortException e) { StringBuilder sb = new StringBuilder(); Enumeration portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { CommPortIdentifier id = (CommPortIdentifier) portList.nextElement(); if (id.getPortType() == CommPortIdentifier.PORT_SERIAL) { sb.append(id.getName() + "\n"); } } throw new InitializationException( "Serial port '" + port + "' could not be found. Available ports are:\n" + sb.toString()); } } else { try { ipSocket = new Socket(hostName, ipPortNumber); inputStream = ipSocket.getInputStream(); outputStream = ipSocket.getOutputStream(); logger.debug("ipSocket opened: on port {}", hostName, ipPortNumber); } catch (UnknownHostException e) { throw new InitializationException("Unknown Host '" + hostName); } catch (IOException e) { throw new InitializationException("I/O error with '" + hostName + " on port " + ipPortNumber); } } }