Source:
<code>static public InitialMessage parse(Long protocolVersion, DataInputStream din) throws InitialMessageException, IOException { Long sid; if (protocolVersion != PROTOCOL_VERSION) { throw new InitialMessageException( "Got unrecognized protocol version %s", protocolVersion); } sid = din.readLong(); int remaining = din.readInt(); if (remaining <= 0 || remaining > maxBuffer) { throw new InitialMessageException( "Unreasonable buffer length: %s", remaining); } byte[] b = new byte[remaining]; int num_read = din.read(b); if (num_read != remaining) { throw new InitialMessageException( "Read only %s bytes out of %s sent by server %s", num_read, remaining, sid); } <START> String[] addressStrings = new String(b).split(","); <END> List<InetSocketAddress> addresses = new ArrayList<>(addressStrings.length); for(String addr : addressStrings) { String[] host_port; try { host_port = ConfigUtils.getHostAndPort(addr); } catch (ConfigException e) { throw new InitialMessageException("Badly formed address: %s", addr); } if (host_port.length != 2) { throw new InitialMessageException("Badly formed address: %s", addr); } int port; try { port = Integer.parseInt(host_port[1]); } catch (NumberFormatException e) { throw new InitialMessageException("Bad port number: %s", host_port[1]); } catch (ArrayIndexOutOfBoundsException e) { throw new InitialMessageException("No port number in: %s", addr); } addresses.add(new InetSocketAddress(host_port[0], port)); } return new InitialMessage(sid, addresses); }</code><technical_language>discussed offline, need 2 here: - Increment PROTOCOL_VERSION, patch introduces new InitialMessage format, - JSON format add Jackson JSON serialiser enable compatibility for future changes</technical_language>

Target:
public static InitialMessage parse(Long protocolVersion, DataInputStream din) throws InitialMessageException, IOException { Long sid; if (protocolVersion != PROTOCOL_VERSION) { throw new InitialMessageException("Got unrecognized protocol version %s", protocolVersion); } sid = din.readLong(); int remaining = din.readInt(); if (remaining <= 0 || remaining > maxBuffer) { throw new InitialMessageException("Unreasonable buffer length: %s", remaining); } byte[] b = new byte[remaining]; int num_read = din.read(b); if (num_read != remaining) { throw new InitialMessageException("Read only %s bytes out of %s sent by server %s", num_read, remaining, sid); } String[] addressStrings = new String(b).split("\\|"); List<InetSocketAddress> addresses = new ArrayList<>(addressStrings.length); for (String addr : addressStrings) { String[] host_port; try { host_port = ConfigUtils.getHostAndPort(addr); } catch (ConfigException e) { throw new InitialMessageException("Badly formed address: %s", addr); } if (host_port.length != 2) { throw new InitialMessageException("Badly formed address: %s", addr); } int port; try { port = Integer.parseInt(host_port[1]); } catch (NumberFormatException e) { throw new InitialMessageException("Bad port number: %s", host_port[1]); } catch (ArrayIndexOutOfBoundsException e) { throw new InitialMessageException("No port number in: %s", addr); } addresses.add(new InetSocketAddress(host_port[0], port)); } return new InitialMessage(sid, addresses); }