Source:
<code>protected void internalReceiveUpdate(String itemName, State newState) { logger.info("Update received ({},{})", itemName, newState); SonanceBindingProvider provider = findFirstMatchingBindingProvider(itemName); String group = provider.getGroup(itemName); String ip = provider.getIP(itemName); int port = provider.getPort(itemName); ip = null; group = null; Socket s = null; try { s = new Socket(ip, port); DataOutputStream outToServer = new DataOutputStream( s.getOutputStream()); BufferedReader i = new BufferedReader(new InputStreamReader( s.getInputStream())); if (provider.isMute(itemName)) if (newState.equals(OnOffType.OFF)) <START> sendMuteCommand(itemName, "FF550207" + group, outToServer, <END> i); else if (newState.equals(OnOffType.ON)) sendMuteCommand(itemName, "FF550208" + group, outToServer, i); else logger.error("I don't know what to do with this command"); else if (provider.isVolume(itemName)) if (newState.equals(IncreaseDecreaseType.INCREASE)) sendVolumeCommand(itemName, "FF550204" + group, outToServer, i); else if (newState.equals(IncreaseDecreaseType.DECREASE)) sendVolumeCommand(itemName, "FF550205" + group, outToServer, i); else logger.error("I don't know what to do with this command: " + newState); s.close(); } catch (IOException e) { logger.error("IO Exception"); } finally { try { if (s != null) s.close(); } catch (IOException e) { } } }</code><technical_language>extract constant</technical_language>

Target:
protected void internalReceiveUpdate(String itemName, State newState) { logger.info("Update received ({},{})", itemName, newState); SonanceBindingProvider provider = findFirstMatchingBindingProvider(itemName); String group = provider.getGroup(itemName); String ip = provider.getIP(itemName); int port = provider.getPort(itemName); ip = null; group = null; Socket s = null; try { s = new Socket(ip, port); DataOutputStream outToServer = new DataOutputStream( s.getOutputStream()); BufferedReader i = new BufferedReader(new InputStreamReader( s.getInputStream())); if (provider.isMute(itemName)) if (newState.equals(OnOffType.OFF)) sendMuteCommand(itemName, SonanceConsts.MUTE_ON + group, outToServer, i); else if (newState.equals(OnOffType.ON)) sendMuteCommand(itemName, SonanceConsts.MUTE_OFF + group, outToServer, i); else logger.error( "I don't know what to do with this new state \"{}\"", newState); if (provider.isPower(itemName)) if (newState.equals(OnOffType.OFF)) sendPowerCommand(itemName, SonanceConsts.POWER_OFF, outToServer, i); else if (newState.equals(OnOffType.ON)) sendPowerCommand(itemName, SonanceConsts.POWER_ON, outToServer, i); else logger.error( "I don't know what to do with this new state \"{}\"", newState); else if (provider.isVolume(itemName)) if (newState.equals(IncreaseDecreaseType.INCREASE)) sendVolumeCommand(itemName, SonanceConsts.VOLUME_UP + group, outToServer, i); else if (newState.equals(IncreaseDecreaseType.DECREASE)) sendVolumeCommand(itemName, SonanceConsts.VOLUME_DOWN + group, outToServer, i); else logger.error( "I don't know what to do with this new state \"{}\"", newState); s.close(); } catch (IOException e) { logger.error( "IO Exception when received internal command. Message: {}", e.getMessage()); } finally { closeSilently(s); } }