@@ -362,7 +362,7 @@ private void closeConnection(HttpConnection conn) {
362362
363363 /* per exchange task */
364364 class Exchange implements Runnable {
365- HttpConnection connection ;
365+ final HttpConnection connection ;
366366 InputStream rawin ;
367367 OutputStream rawout ;
368368 String protocol ;
@@ -379,7 +379,7 @@ public void run() {
379379 this .rawin = connection .getInputStream ();
380380 this .rawout = connection .getOutputStream ();
381381
382- logger .log (Level .TRACE , "exchange started " +connection .toString ());
382+ logger .log (Level .TRACE , () -> "exchange started " +connection .toString ());
383383
384384 while (true ) {
385385 try {
@@ -412,7 +412,7 @@ public void run() {
412412 throw t ;
413413 }
414414 }
415- logger .log (Level .TRACE , "exchange finished " +connection .toString ());
415+ logger .log (Level .TRACE , () -> "exchange finished " +connection .toString ());
416416 }
417417
418418 private void runPerRequest () throws IOException {
@@ -422,7 +422,7 @@ private void runPerRequest() throws IOException {
422422
423423 connection .inRequest = false ;
424424 Request req = new Request (rawin , rawout );
425- String requestLine = req .requestLine ();
425+ final String requestLine = req .requestLine ();
426426 connection .inRequest = true ;
427427
428428 if (requestLine == null ) {
@@ -431,7 +431,7 @@ private void runPerRequest() throws IOException {
431431 closeConnection (connection );
432432 return ;
433433 }
434- logger .log (Level .DEBUG , "Exchange request line: {0}" , requestLine );
434+ logger .log (Level .DEBUG , () -> "Exchange request line: " + requestLine );
435435 int space = requestLine .indexOf (' ' );
436436 if (space == -1 ) {
437437 reject (Code .HTTP_BAD_REQUEST ,
@@ -504,7 +504,7 @@ private void runPerRequest() throws IOException {
504504 }
505505 }
506506 }
507- logger .log (Level .INFO , "protocol " +protocol +" uri " +uri +" headers " +headers );
507+ logger .log (Level .TRACE ,() -> "protocol " +protocol +" uri " +uri +" headers " +headers );
508508 String uriPath = Optional .ofNullable (uri .getPath ()).orElse ("/" );
509509 ctx = contexts .findContext (protocol , uriPath );
510510 if (ctx == null ) {
0 commit comments