[tomcat] 02/02: Code cleanup (format) - no functional change

2023-02-15 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 2c922ab78d6cccbfc37efe89418804c9b69554fd
Author: Mark Thomas 
AuthorDate: Wed Feb 15 15:02:57 2023 +

Code cleanup (format) - no functional change
---
 test/org/apache/catalina/valves/Benchmarks.java|  78 ++---
 .../apache/catalina/valves/TestAccessLogValve.java |  11 +-
 .../valves/TestCrawlerSessionManagerValve.java |  10 +-
 .../catalina/valves/TestErrorReportValve.java  |  23 +-
 .../valves/TestLoadBalancerDrainingValve.java  |  74 +++--
 .../apache/catalina/valves/TestRemoteIpValve.java  |  99 +++---
 .../catalina/valves/TestRequestFilterValve.java| 340 ++---
 .../valves/TestStuckThreadDetectionValve.java  |  21 +-
 .../catalina/valves/TesterAccessLogValve.java  |   9 +-
 9 files changed, 316 insertions(+), 349 deletions(-)

diff --git a/test/org/apache/catalina/valves/Benchmarks.java 
b/test/org/apache/catalina/valves/Benchmarks.java
index 3aca51c419..f02b7f43d3 100644
--- a/test/org/apache/catalina/valves/Benchmarks.java
+++ b/test/org/apache/catalina/valves/Benchmarks.java
@@ -22,20 +22,17 @@ import java.util.Date;
 import org.junit.Test;
 
 /**
- * Some simple micro-benchmarks to help determine best approach for thread
- * safety in valves, particularly the {@link AccessLogValve}. Implemented as
- * JUnit tests to make the simple to execute but does not used Test* as the
- * class name to avoid being included in the automated unit tests.
+ * Some simple micro-benchmarks to help determine best approach for thread 
safety in valves, particularly the
+ * {@link AccessLogValve}. Implemented as JUnit tests to make the simple to 
execute but does not used Test* as the class
+ * name to avoid being included in the automated unit tests.
  */
 public class Benchmarks {
 @Test
 public void testAccessLogGetDate() throws Exception {
 // Is it better to use a sync or a thread local here?
 BenchmarkTest benchmark = new BenchmarkTest();
-Runnable[] tests = new Runnable[] { new GetDateBenchmarkTest_Sync(),
-new GetDateBenchmarkTest_Local(),
-new GetDateBenchmarkTest_LocalMutableLong(),
-new GetDateBenchmarkTest_LocalStruct() };
+Runnable[] tests = new Runnable[] { new GetDateBenchmarkTest_Sync(), 
new GetDateBenchmarkTest_Local(),
+new GetDateBenchmarkTest_LocalMutableLong(), new 
GetDateBenchmarkTest_LocalStruct() };
 benchmark.doTest(5, tests);
 }
 
@@ -99,8 +96,7 @@ public class Benchmarks {
 }
 }
 
-private static class GetDateBenchmarkTest_LocalMutableLong implements
-Runnable {
+private static class GetDateBenchmarkTest_LocalMutableLong implements 
Runnable {
 
 @Override
 public String toString() {
@@ -175,17 +171,15 @@ public class Benchmarks {
 public void testAccessLogTimeDateElement() throws Exception {
 // Is it better to use a sync or a thread local here?
 BenchmarkTest benchmark = new BenchmarkTest();
-Runnable[] tests = new Runnable[] {
-new TimeDateElementBenchmarkTest_Sync(),
-new TimeDateElementBenchmarkTest_Local(),
-new TimeDateElementBenchmarkTest_LocalStruct(),
+Runnable[] tests = new Runnable[] { new 
TimeDateElementBenchmarkTest_Sync(),
+new TimeDateElementBenchmarkTest_Local(), new 
TimeDateElementBenchmarkTest_LocalStruct(),
 new TimeDateElementBenchmarkTest_LocalStruct_SBuilder() };
 benchmark.doTest(5, tests);
 }
 
 private abstract static class TimeDateElementBenchmarkTestBase {
-protected static final String months[] = { "Jan", "Feb", "Mar", "Apr",
-"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+protected static final String months[] = { "Jan", "Feb", "Mar", "Apr", 
"May", "Jun", "Jul", "Aug", "Sep", "Oct",
+"Nov", "Dec" };
 
 protected String lookup(String month) {
 int index;
@@ -198,8 +192,8 @@ public class Benchmarks {
 }
 }
 
-private static class TimeDateElementBenchmarkTest_Sync extends
-TimeDateElementBenchmarkTestBase implements Runnable {
+private static class TimeDateElementBenchmarkTest_Sync extends 
TimeDateElementBenchmarkTestBase
+implements Runnable {
 
 @Override
 public String toString() {
@@ -211,8 +205,7 @@ public class Benchmarks {
 private SimpleDateFormat dayFormatter = new SimpleDateFormat("dd");
 private SimpleDateFormat monthFormatter = new SimpleDateFormat("MM");
 private SimpleDateFormat yearFormatter = new SimpleDateFormat("");
-private SimpleDateFormat timeFormatter = new SimpleDateFormat(
-"hh:mm:ss");
+private SimpleDateFormat timeFormatter 

[tomcat] 02/02: Code cleanup (format) - no functional change

2023-02-15 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit c4bfd4e82befc294d9c1abfd69a0144c8165
Author: Mark Thomas 
AuthorDate: Wed Feb 15 15:01:51 2023 +

Code cleanup (format) - no functional change
---
 test/org/apache/catalina/valves/Benchmarks.java|  78 ++---
 .../apache/catalina/valves/TestAccessLogValve.java |  11 +-
 .../valves/TestCrawlerSessionManagerValve.java |  13 +-
 .../catalina/valves/TestErrorReportValve.java  |  31 +-
 .../valves/TestLoadBalancerDrainingValve.java  |  74 +++--
 .../apache/catalina/valves/TestRemoteIpValve.java  |  99 +++---
 .../catalina/valves/TestRequestFilterValve.java| 340 ++---
 .../valves/TestStuckThreadDetectionValve.java  |  21 +-
 .../catalina/valves/TesterAccessLogValve.java  |   9 +-
 9 files changed, 322 insertions(+), 354 deletions(-)

diff --git a/test/org/apache/catalina/valves/Benchmarks.java 
b/test/org/apache/catalina/valves/Benchmarks.java
index 3aca51c419..f02b7f43d3 100644
--- a/test/org/apache/catalina/valves/Benchmarks.java
+++ b/test/org/apache/catalina/valves/Benchmarks.java
@@ -22,20 +22,17 @@ import java.util.Date;
 import org.junit.Test;
 
 /**
- * Some simple micro-benchmarks to help determine best approach for thread
- * safety in valves, particularly the {@link AccessLogValve}. Implemented as
- * JUnit tests to make the simple to execute but does not used Test* as the
- * class name to avoid being included in the automated unit tests.
+ * Some simple micro-benchmarks to help determine best approach for thread 
safety in valves, particularly the
+ * {@link AccessLogValve}. Implemented as JUnit tests to make the simple to 
execute but does not used Test* as the class
+ * name to avoid being included in the automated unit tests.
  */
 public class Benchmarks {
 @Test
 public void testAccessLogGetDate() throws Exception {
 // Is it better to use a sync or a thread local here?
 BenchmarkTest benchmark = new BenchmarkTest();
-Runnable[] tests = new Runnable[] { new GetDateBenchmarkTest_Sync(),
-new GetDateBenchmarkTest_Local(),
-new GetDateBenchmarkTest_LocalMutableLong(),
-new GetDateBenchmarkTest_LocalStruct() };
+Runnable[] tests = new Runnable[] { new GetDateBenchmarkTest_Sync(), 
new GetDateBenchmarkTest_Local(),
+new GetDateBenchmarkTest_LocalMutableLong(), new 
GetDateBenchmarkTest_LocalStruct() };
 benchmark.doTest(5, tests);
 }
 
@@ -99,8 +96,7 @@ public class Benchmarks {
 }
 }
 
-private static class GetDateBenchmarkTest_LocalMutableLong implements
-Runnable {
+private static class GetDateBenchmarkTest_LocalMutableLong implements 
Runnable {
 
 @Override
 public String toString() {
@@ -175,17 +171,15 @@ public class Benchmarks {
 public void testAccessLogTimeDateElement() throws Exception {
 // Is it better to use a sync or a thread local here?
 BenchmarkTest benchmark = new BenchmarkTest();
-Runnable[] tests = new Runnable[] {
-new TimeDateElementBenchmarkTest_Sync(),
-new TimeDateElementBenchmarkTest_Local(),
-new TimeDateElementBenchmarkTest_LocalStruct(),
+Runnable[] tests = new Runnable[] { new 
TimeDateElementBenchmarkTest_Sync(),
+new TimeDateElementBenchmarkTest_Local(), new 
TimeDateElementBenchmarkTest_LocalStruct(),
 new TimeDateElementBenchmarkTest_LocalStruct_SBuilder() };
 benchmark.doTest(5, tests);
 }
 
 private abstract static class TimeDateElementBenchmarkTestBase {
-protected static final String months[] = { "Jan", "Feb", "Mar", "Apr",
-"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+protected static final String months[] = { "Jan", "Feb", "Mar", "Apr", 
"May", "Jun", "Jul", "Aug", "Sep", "Oct",
+"Nov", "Dec" };
 
 protected String lookup(String month) {
 int index;
@@ -198,8 +192,8 @@ public class Benchmarks {
 }
 }
 
-private static class TimeDateElementBenchmarkTest_Sync extends
-TimeDateElementBenchmarkTestBase implements Runnable {
+private static class TimeDateElementBenchmarkTest_Sync extends 
TimeDateElementBenchmarkTestBase
+implements Runnable {
 
 @Override
 public String toString() {
@@ -211,8 +205,7 @@ public class Benchmarks {
 private SimpleDateFormat dayFormatter = new SimpleDateFormat("dd");
 private SimpleDateFormat monthFormatter = new SimpleDateFormat("MM");
 private SimpleDateFormat yearFormatter = new SimpleDateFormat("");
-private SimpleDateFormat timeFormatter = new SimpleDateFormat(
-"hh:mm:ss");
+private SimpleDateFormat timeFormatter 

[tomcat] 02/02: Code cleanup (format) - no functional change

2023-02-15 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 63839291b4ad44a303593ba0ed13035d00b6e364
Author: Mark Thomas 
AuthorDate: Wed Feb 15 15:01:06 2023 +

Code cleanup (format) - no functional change
---
 test/org/apache/catalina/valves/Benchmarks.java|  78 ++---
 .../apache/catalina/valves/TestAccessLogValve.java |  11 +-
 .../valves/TestCrawlerSessionManagerValve.java |  13 +-
 .../catalina/valves/TestErrorReportValve.java  |  31 +-
 .../valves/TestLoadBalancerDrainingValve.java  |  79 +++--
 .../apache/catalina/valves/TestRemoteIpValve.java  |  99 +++---
 .../catalina/valves/TestRequestFilterValve.java| 340 ++---
 .../valves/TestStuckThreadDetectionValve.java  |  21 +-
 .../catalina/valves/TesterAccessLogValve.java  |   9 +-
 9 files changed, 326 insertions(+), 355 deletions(-)

diff --git a/test/org/apache/catalina/valves/Benchmarks.java 
b/test/org/apache/catalina/valves/Benchmarks.java
index 973df0b946..431c73bc0c 100644
--- a/test/org/apache/catalina/valves/Benchmarks.java
+++ b/test/org/apache/catalina/valves/Benchmarks.java
@@ -22,20 +22,17 @@ import java.util.Date;
 import org.junit.Test;
 
 /**
- * Some simple micro-benchmarks to help determine best approach for thread
- * safety in valves, particularly the {@link AccessLogValve}. Implemented as
- * JUnit tests to make the simple to execute but does not used Test* as the
- * class name to avoid being included in the automated unit tests.
+ * Some simple micro-benchmarks to help determine best approach for thread 
safety in valves, particularly the
+ * {@link AccessLogValve}. Implemented as JUnit tests to make the simple to 
execute but does not used Test* as the class
+ * name to avoid being included in the automated unit tests.
  */
 public class Benchmarks {
 @Test
 public void testAccessLogGetDate() throws Exception {
 // Is it better to use a sync or a thread local here?
 BenchmarkTest benchmark = new BenchmarkTest();
-Runnable[] tests = new Runnable[] { new GetDateBenchmarkTest_Sync(),
-new GetDateBenchmarkTest_Local(),
-new GetDateBenchmarkTest_LocalMutableLong(),
-new GetDateBenchmarkTest_LocalStruct() };
+Runnable[] tests = new Runnable[] { new GetDateBenchmarkTest_Sync(), 
new GetDateBenchmarkTest_Local(),
+new GetDateBenchmarkTest_LocalMutableLong(), new 
GetDateBenchmarkTest_LocalStruct() };
 benchmark.doTest(5, tests);
 }
 
@@ -99,8 +96,7 @@ public class Benchmarks {
 }
 }
 
-private static class GetDateBenchmarkTest_LocalMutableLong implements
-Runnable {
+private static class GetDateBenchmarkTest_LocalMutableLong implements 
Runnable {
 
 @Override
 public String toString() {
@@ -175,17 +171,15 @@ public class Benchmarks {
 public void testAccessLogTimeDateElement() throws Exception {
 // Is it better to use a sync or a thread local here?
 BenchmarkTest benchmark = new BenchmarkTest();
-Runnable[] tests = new Runnable[] {
-new TimeDateElementBenchmarkTest_Sync(),
-new TimeDateElementBenchmarkTest_Local(),
-new TimeDateElementBenchmarkTest_LocalStruct(),
+Runnable[] tests = new Runnable[] { new 
TimeDateElementBenchmarkTest_Sync(),
+new TimeDateElementBenchmarkTest_Local(), new 
TimeDateElementBenchmarkTest_LocalStruct(),
 new TimeDateElementBenchmarkTest_LocalStruct_SBuilder() };
 benchmark.doTest(5, tests);
 }
 
 private abstract static class TimeDateElementBenchmarkTestBase {
-protected static final String months[] = { "Jan", "Feb", "Mar", "Apr",
-"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+protected static final String months[] = { "Jan", "Feb", "Mar", "Apr", 
"May", "Jun", "Jul", "Aug", "Sep", "Oct",
+"Nov", "Dec" };
 
 protected String lookup(String month) {
 int index;
@@ -198,8 +192,8 @@ public class Benchmarks {
 }
 }
 
-private static class TimeDateElementBenchmarkTest_Sync extends
-TimeDateElementBenchmarkTestBase implements Runnable {
+private static class TimeDateElementBenchmarkTest_Sync extends 
TimeDateElementBenchmarkTestBase
+implements Runnable {
 
 @Override
 public String toString() {
@@ -211,8 +205,7 @@ public class Benchmarks {
 private SimpleDateFormat dayFormatter = new SimpleDateFormat("dd");
 private SimpleDateFormat monthFormatter = new SimpleDateFormat("MM");
 private SimpleDateFormat yearFormatter = new SimpleDateFormat("");
-private SimpleDateFormat timeFormatter = new SimpleDateFormat(
-"hh:mm:ss");
+private SimpleDateFormat timeFormatter