@@ -29,7 +29,7 @@ public class NatsServerRunner implements AutoCloseable {
2929
3030 private static final Logger LOGGER = Logger .getLogger (NatsServerRunner .class .getName ());
3131
32- private final int port ;
32+ private final int _port ;
3333
3434 private Process process ;
3535 private final String cmdLine ;
@@ -232,7 +232,7 @@ public NatsServerRunner(String[] customArgs, int port, boolean debug) throws IOE
232232 * @throws IOException thrown when the server cannot start
233233 */
234234 public NatsServerRunner (int port , boolean debug , boolean jetstream , String configFilePath , String [] configInserts , String [] customArgs ) throws IOException {
235- this . port = port <= 0 ? nextPort () : port ;
235+ _port = port <= 0 ? nextPort () : port ;
236236
237237 List <String > cmd = new ArrayList <>();
238238
@@ -260,9 +260,9 @@ public NatsServerRunner(int port, boolean debug, boolean jetstream, String confi
260260 portMatcher .reset (line );
261261
262262 if (portMatcher .find ()) {
263- line = line .replace (portMatcher .group (1 ), String .valueOf (port ));
263+ line = line .replace (portMatcher .group (1 ), String .valueOf (_port ));
264264 cmd .add ("--port" );
265- cmd .add (String .valueOf (port ));
265+ cmd .add (String .valueOf (_port ));
266266 }
267267
268268 writer .write (line );
@@ -292,7 +292,7 @@ public NatsServerRunner(int port, boolean debug, boolean jetstream, String confi
292292 }
293293 } else {
294294 cmd .add ("--port" );
295- cmd .add (String .valueOf (port ));
295+ cmd .add (String .valueOf (_port ));
296296 }
297297
298298 if (jetstream ) {
@@ -318,7 +318,7 @@ public NatsServerRunner(int port, boolean debug, boolean jetstream, String confi
318318
319319 process = pb .start ();
320320
321- NatsOutputLogger .logOutput (LOGGER , process , NATS_SERVER , port );
321+ NatsOutputLogger .logOutput (LOGGER , process , NATS_SERVER , _port );
322322
323323 int tries = 10 ;
324324 // wait at least 1x and maybe 10
@@ -331,7 +331,7 @@ public NatsServerRunner(int port, boolean debug, boolean jetstream, String confi
331331 tries --;
332332 } while (!process .isAlive () && tries > 0 );
333333
334- SocketAddress addr = new InetSocketAddress ("localhost" , port );
334+ SocketAddress addr = new InetSocketAddress ("localhost" , _port );
335335 SocketChannel socketChannel = SocketChannel .open ();
336336 socketChannel .configureBlocking (true );
337337 boolean scanning = true ;
@@ -361,7 +361,7 @@ public NatsServerRunner(int port, boolean debug, boolean jetstream, String confi
361361 * @return the port number
362362 */
363363 public int getPort () {
364- return port ;
364+ return _port ;
365365 }
366366
367367 /**
@@ -370,7 +370,7 @@ public int getPort() {
370370 * @return the uri string
371371 */
372372 public String getURI () {
373- return getURIForPort (port );
373+ return getURIForPort (_port );
374374 }
375375
376376 /**
0 commit comments