Source:
<code>public StompFrame onConnect(StompFrame frame) { StompFrame response = null; Map<String, String> headers = frame.getHeadersMap(); String login = headers.get(Stomp.Headers.Connect.LOGIN); String passcode = headers.get(Stomp.Headers.Connect.PASSCODE); String clientID = headers.get(Stomp.Headers.Connect.CLIENT_ID); String requestID = headers.get(Stomp.Headers.Connect.REQUEST_ID); try { connection.setClientID(clientID); connection.setLogin(login); connection.setPasscode(passcode); connection.getSession(); connection.setValid(true); response = this.createStompFrame(Stomp.Responses.CONNECTED); response.addHeader(Stomp.Headers.Connected.VERSION, connection.getVersion()); response.addHeader(Stomp.Headers.Connected.SESSION, connection.getID().toString()); Object disableServerHeader = connection.getAcceptorUsed().getConfiguration().get(TransportConstants.DISABLE_STOMP_SERVER_HEADER); <START> if (disableServerHeader == null || (disableServerHeader != null && !Boolean.parseBoolean(disableServerHeader.toString()))) { <END> response.addHeader(Stomp.Headers.Connected.SERVER, connection.getActiveMQServerName()); } if (requestID != null) { response.addHeader(Stomp.Headers.Connected.RESPONSE_ID, requestID); } String heartBeat = headers.get(Stomp.Headers.Connect.HEART_BEAT); if (heartBeat != null) { handleHeartBeat(heartBeat); if (heartBeater == null) { response.addHeader(Stomp.Headers.Connected.HEART_BEAT, "0,0"); } else { response.addHeader(Stomp.Headers.Connected.HEART_BEAT, heartBeater.serverPingPeriod + "," + heartBeater.clientPingResponse); } } } catch (ActiveMQSecurityException e) { response = getFailedAuthenticationResponse(login); } catch (ActiveMQStompException e) { response = e.getFrame(); } return response; }</code><technical_language>Is disableServerHeader != null check necessary</technical_language>

Target:
public StompFrame onConnect(StompFrame frame) { StompFrame response = null; Map<String, String> headers = frame.getHeadersMap(); String login = headers.get(Stomp.Headers.Connect.LOGIN); String passcode = headers.get(Stomp.Headers.Connect.PASSCODE); String clientID = headers.get(Stomp.Headers.Connect.CLIENT_ID); String requestID = headers.get(Stomp.Headers.Connect.REQUEST_ID); try { connection.setClientID(clientID); connection.setLogin(login); connection.setPasscode(passcode); connection.getSession(); connection.setValid(true); response = this.createStompFrame(Stomp.Responses.CONNECTED); response.addHeader(Stomp.Headers.Connected.VERSION, connection.getVersion()); response.addHeader(Stomp.Headers.Connected.SESSION, connection.getID().toString()); Object disableServerHeader = connection.getAcceptorUsed().getConfiguration().get(TransportConstants.DISABLE_STOMP_SERVER_HEADER); if (disableServerHeader == null || !Boolean.parseBoolean(disableServerHeader.toString())) { response.addHeader(Stomp.Headers.Connected.SERVER, connection.getActiveMQServerName()); } if (requestID != null) { response.addHeader(Stomp.Headers.Connected.RESPONSE_ID, requestID); } String heartBeat = headers.get(Stomp.Headers.Connect.HEART_BEAT); if (heartBeat != null) { handleHeartBeat(heartBeat); if (heartBeater == null) { response.addHeader(Stomp.Headers.Connected.HEART_BEAT, "0,0"); } else { response.addHeader(Stomp.Headers.Connected.HEART_BEAT, heartBeater.serverPingPeriod + "," + heartBeater.clientPingResponse); } } } catch (ActiveMQSecurityException e) { response = getFailedAuthenticationResponse(login); } catch (ActiveMQStompException e) { response = e.getFrame(); } return response; }