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
The following commit(s) were added to refs/heads/10.1.x by this push:
new c61a4dc748 Code clean-up. Formatting. No functional change.
c61a4dc748 is described below
commit c61a4dc7488930bd6e6a157c1201419addbaceeb
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Jan 16 15:54:42 2025 +0000
Code clean-up. Formatting. No functional change.
---
java/org/apache/tomcat/util/compat/Jre16Compat.java | 10 ++++------
java/org/apache/tomcat/util/compat/Jre19Compat.java | 8 +++-----
java/org/apache/tomcat/util/compat/JreCompat.java | 9 ++++++---
java/org/apache/tomcat/util/compat/JrePlatform.java | 13 ++++++-------
java/org/apache/tomcat/util/compat/JreVendor.java | 8 +++-----
5 files changed, 22 insertions(+), 26 deletions(-)
diff --git a/java/org/apache/tomcat/util/compat/Jre16Compat.java
b/java/org/apache/tomcat/util/compat/Jre16Compat.java
index fd05da4830..c4d6f3f1d1 100644
--- a/java/org/apache/tomcat/util/compat/Jre16Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre16Compat.java
@@ -70,8 +70,7 @@ class Jre16Compat extends JreCompat {
public SocketAddress getUnixDomainSocketAddress(String path) {
try {
return (SocketAddress)
unixDomainSocketAddressOfMethod.invoke(null, path);
- } catch (IllegalAccessException | IllegalArgumentException
- | InvocationTargetException e) {
+ } catch (IllegalAccessException | IllegalArgumentException |
InvocationTargetException e) {
throw new UnsupportedOperationException(e);
}
}
@@ -80,8 +79,8 @@ class Jre16Compat extends JreCompat {
@Override
public ServerSocketChannel openUnixDomainServerSocketChannel() {
try {
- return (ServerSocketChannel)
openServerSocketChannelFamilyMethod.invoke
- (null, StandardProtocolFamily.valueOf("UNIX"));
+ return (ServerSocketChannel)
openServerSocketChannelFamilyMethod.invoke(null,
+ StandardProtocolFamily.valueOf("UNIX"));
} catch (IllegalAccessException | IllegalArgumentException |
InvocationTargetException e) {
throw new UnsupportedOperationException(e);
}
@@ -91,8 +90,7 @@ class Jre16Compat extends JreCompat {
@Override
public SocketChannel openUnixDomainSocketChannel() {
try {
- return (SocketChannel) openSocketChannelFamilyMethod.invoke
- (null, StandardProtocolFamily.valueOf("UNIX"));
+ return (SocketChannel) openSocketChannelFamilyMethod.invoke(null,
StandardProtocolFamily.valueOf("UNIX"));
} catch (IllegalAccessException | IllegalArgumentException |
InvocationTargetException e) {
throw new UnsupportedOperationException(e);
}
diff --git a/java/org/apache/tomcat/util/compat/Jre19Compat.java
b/java/org/apache/tomcat/util/compat/Jre19Compat.java
index 45ce68b666..587ad39dcb 100644
--- a/java/org/apache/tomcat/util/compat/Jre19Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre19Compat.java
@@ -68,11 +68,9 @@ public class Jre19Compat extends Jre16Compat {
return null;
}
- if (task!= null && task.getClass().getCanonicalName() != null &&
- (task.getClass().getCanonicalName().equals(
-
"org.apache.tomcat.util.threads.ThreadPoolExecutor.Worker") ||
- task.getClass().getCanonicalName().equals(
-
"java.util.concurrent.ThreadPoolExecutor.Worker"))) {
+ if (task != null && task.getClass().getCanonicalName() != null &&
(task.getClass().getCanonicalName()
+
.equals("org.apache.tomcat.util.threads.ThreadPoolExecutor.Worker") ||
+
task.getClass().getCanonicalName().equals("java.util.concurrent.ThreadPoolExecutor.Worker")))
{
Field executorField =
task.getClass().getDeclaredField("this$0");
executorField.setAccessible(true);
result = executorField.get(task);
diff --git a/java/org/apache/tomcat/util/compat/JreCompat.java
b/java/org/apache/tomcat/util/compat/JreCompat.java
index efb9e024a9..4e4666d95e 100644
--- a/java/org/apache/tomcat/util/compat/JreCompat.java
+++ b/java/org/apache/tomcat/util/compat/JreCompat.java
@@ -29,9 +29,8 @@ import javax.security.auth.Subject;
import org.apache.tomcat.util.res.StringManager;
/**
- * This is the base implementation class for JRE compatibility and provides an
- * implementation based on Java 11. Sub-classes may extend this class and
provide
- * alternative implementations for later JRE versions
+ * This is the base implementation class for JRE compatibility and provides an
implementation based on Java 11.
+ * Sub-classes may extend this class and provide alternative implementations
for later JRE versions
*/
public class JreCompat {
@@ -125,7 +124,9 @@ public class JreCompat {
/**
* Return Unix domain socket address for given path.
+ *
* @param path The path
+ *
* @return the socket address
*/
public SocketAddress getUnixDomainSocketAddress(String path) {
@@ -135,6 +136,7 @@ public class JreCompat {
/**
* Create server socket channel using the Unix domain socket
ProtocolFamily.
+ *
* @return the server socket channel
*/
public ServerSocketChannel openUnixDomainServerSocketChannel() {
@@ -144,6 +146,7 @@ public class JreCompat {
/**
* Create socket channel using the Unix domain socket ProtocolFamily.
+ *
* @return the socket channel
*/
public SocketChannel openUnixDomainSocketChannel() {
diff --git a/java/org/apache/tomcat/util/compat/JrePlatform.java
b/java/org/apache/tomcat/util/compat/JrePlatform.java
index 66717d664f..089751d16f 100644
--- a/java/org/apache/tomcat/util/compat/JrePlatform.java
+++ b/java/org/apache/tomcat/util/compat/JrePlatform.java
@@ -26,12 +26,11 @@ public class JrePlatform {
static {
/*
- * There are a few places where a) the behaviour of the Java API
depends
- * on the underlying platform and b) those behavioural differences have
- * an impact on Tomcat.
+ * There are a few places where a) the behaviour of the Java API
depends on the underlying platform and b) those
+ * behavioural differences have an impact on Tomcat.
*
- * Tomcat therefore needs to be able to determine the platform it is
- * running on to account for those differences.
+ * Tomcat therefore needs to be able to determine the platform it is
running on to account for those
+ * differences.
*
* In an ideal world this code would not exist.
*/
@@ -41,8 +40,8 @@ public class JrePlatform {
if (System.getSecurityManager() == null) {
osName = System.getProperty(OS_NAME_PROPERTY);
} else {
- osName = AccessController.doPrivileged(
- (PrivilegedAction<String>) () ->
System.getProperty(OS_NAME_PROPERTY));
+ osName = AccessController
+ .doPrivileged((PrivilegedAction<String>) () ->
System.getProperty(OS_NAME_PROPERTY));
}
IS_MAC_OS = osName.toLowerCase(Locale.ENGLISH).startsWith("mac os x");
diff --git a/java/org/apache/tomcat/util/compat/JreVendor.java
b/java/org/apache/tomcat/util/compat/JreVendor.java
index caa0823ea8..2aea102bd6 100644
--- a/java/org/apache/tomcat/util/compat/JreVendor.java
+++ b/java/org/apache/tomcat/util/compat/JreVendor.java
@@ -22,11 +22,9 @@ public class JreVendor {
static {
/*
- * There are a few places where Tomcat either accesses JVM internals
- * (e.g. the memory leak protection) or where feature support varies
- * between JVMs (e.g. SPNEGO). These flags exist to enable Tomcat to
- * adjust its behaviour based on the vendor of the JVM. In an ideal
- * world this code would not exist.
+ * There are a few places where Tomcat either accesses JVM internals
(e.g. the memory leak protection) or where
+ * feature support varies between JVMs (e.g. SPNEGO). These flags
exist to enable Tomcat to adjust its behaviour
+ * based on the vendor of the JVM. In an ideal world this code would
not exist.
*/
String vendor = System.getProperty("java.vendor", "");
vendor = vendor.toLowerCase(Locale.ENGLISH);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]