Source:
<code>public void testRestartZooKeeperServer() throws Exception { final int[] clientPorts = new int[SERVER_COUNT]; StringBuilder sb = new StringBuilder(); String server; for (int i = 0; i < SERVER_COUNT; i++) { clientPorts[i] = PortAssignment.unique(); <START> server = "server." <END> + i + "=127.0.0.1:" + PortAssignment.unique() + ":" + PortAssignment.unique() + ":participant;127.0.0.1:" + clientPorts[i]; sb.append(server + "\n"); } String currentQuorumCfgSection = sb.toString(); MainThread[] mt = new MainThread[SERVER_COUNT]; for (int i = 0; i < SERVER_COUNT; i++) { mt[i] = new MainThread(i, clientPorts[i], currentQuorumCfgSection, false); mt[i].start(); } for (int i = 0; i < SERVER_COUNT; i++) { Assert.assertTrue("waiting for server " + i + " being up", ClientBase.waitForServerUp("127.0.0.1:" + clientPorts[i], CONNECTION_TIMEOUT)); } ZooKeeper zk = ClientBase.createZKClient("127.0.0.1:" + clientPorts[0]); String zNodePath = "/serverRestartTest"; String data = "originalData"; zk.create(zNodePath, data.getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.close(); mt[0].shutdown(); mt[1].shutdown(); mt[0].start(); mt[1].start(); for (int i = 0; i < SERVER_COUNT; i++) { Assert.assertTrue("waiting for server " + i + " being up", ClientBase.waitForServerUp("127.0.0.1:" + clientPorts[i], CONNECTION_TIMEOUT)); } zk = ClientBase.createZKClient("127.0.0.1:" + clientPorts[0]); byte[] dataBytes = zk.getData(zNodePath, null, null); String receivedData = new String(dataBytes); assertEquals(data, receivedData); for (int i = 0; i < SERVER_COUNT; i++) { mt[i].shutdown(); } }</code><technical_language>is worth reverting</technical_language>

Target:
public void testRestartZooKeeperServer() throws Exception { final int[] clientPorts = new int[SERVER_COUNT]; StringBuilder sb = new StringBuilder(); String server; for (int i = 0; i < SERVER_COUNT; i++) { clientPorts[i] = PortAssignment.unique(); server = "server." + i + "=127.0.0.1:" + PortAssignment.unique() + ":" + PortAssignment.unique() + ":participant;127.0.0.1:" + clientPorts[i]; sb.append(server + "\n"); } String currentQuorumCfgSection = sb.toString(); MainThread[] mt = new MainThread[SERVER_COUNT]; for (int i = 0; i < SERVER_COUNT; i++) { mt[i] = new MainThread(i, clientPorts[i], currentQuorumCfgSection, false); mt[i].start(); } for (int i = 0; i < SERVER_COUNT; i++) { assertTrue( "waiting for server " + i + " being up", ClientBase.waitForServerUp("127.0.0.1:" + clientPorts[i], CONNECTION_TIMEOUT)); } ZooKeeper zk = ClientBase.createZKClient("127.0.0.1:" + clientPorts[0]); String zNodePath = "/serverRestartTest"; String data = "originalData"; zk.create(zNodePath, data.getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.close(); mt[0].shutdown(); mt[1].shutdown(); mt[0].start(); mt[1].start(); for (int i = 0; i < SERVER_COUNT; i++) { assertTrue( "waiting for server " + i + " being up", ClientBase.waitForServerUp("127.0.0.1:" + clientPorts[i], CONNECTION_TIMEOUT)); } zk = ClientBase.createZKClient("127.0.0.1:" + clientPorts[0]); byte[] dataBytes = zk.getData(zNodePath, null, null); String receivedData = new String(dataBytes); assertEquals(data, receivedData); for (int i = 0; i < SERVER_COUNT; i++) { mt[i].shutdown(); } }