This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new e1eed7a588 Code clean-up - formatting. No functional change.
e1eed7a588 is described below

commit e1eed7a5881fca46593988589e9f30df07826981
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Aug 29 11:41:40 2025 +0100

    Code clean-up - formatting. No functional change.
---
 java/org/apache/tomcat/util/Diagnostics.java       | 166 +++++++++++----------
 java/org/apache/tomcat/util/ExceptionUtils.java    |  17 +--
 .../org/apache/tomcat/util/IntrospectionUtils.java | 155 +++++++++----------
 java/org/apache/tomcat/util/MultiThrowable.java    |  17 +--
 .../tomcat/util/XReflectionIntrospectionUtils.java |   4 +-
 5 files changed, 175 insertions(+), 184 deletions(-)

diff --git a/java/org/apache/tomcat/util/Diagnostics.java 
b/java/org/apache/tomcat/util/Diagnostics.java
index 3b832e99f9..bf1891534e 100644
--- a/java/org/apache/tomcat/util/Diagnostics.java
+++ b/java/org/apache/tomcat/util/Diagnostics.java
@@ -76,34 +76,25 @@ public class Diagnostics {
 
     private static final Log log = LogFactory.getLog(Diagnostics.class);
 
-    private static final SimpleDateFormat timeformat =
-        new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+    private static final SimpleDateFormat timeformat = new 
SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
 
     /* Some platform MBeans */
-    private static final ClassLoadingMXBean classLoadingMXBean =
-        ManagementFactory.getClassLoadingMXBean();
-    private static final CompilationMXBean compilationMXBean =
-        ManagementFactory.getCompilationMXBean();
-    private static final OperatingSystemMXBean operatingSystemMXBean =
-        ManagementFactory.getOperatingSystemMXBean();
-    private static final RuntimeMXBean runtimeMXBean =
-        ManagementFactory.getRuntimeMXBean();
-    private static final ThreadMXBean threadMXBean =
-        ManagementFactory.getThreadMXBean();
+    private static final ClassLoadingMXBean classLoadingMXBean = 
ManagementFactory.getClassLoadingMXBean();
+    private static final CompilationMXBean compilationMXBean = 
ManagementFactory.getCompilationMXBean();
+    private static final OperatingSystemMXBean operatingSystemMXBean = 
ManagementFactory.getOperatingSystemMXBean();
+    private static final RuntimeMXBean runtimeMXBean = 
ManagementFactory.getRuntimeMXBean();
+    private static final ThreadMXBean threadMXBean = 
ManagementFactory.getThreadMXBean();
 
     // XXX Not sure whether the following MBeans should better
     // be retrieved on demand, i.e. whether they can change
     // dynamically in the MBeanServer.
     private static final PlatformLoggingMXBean loggingMXBean =
-        ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class);
-    private static final MemoryMXBean memoryMXBean =
-        ManagementFactory.getMemoryMXBean();
+            ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class);
+    private static final MemoryMXBean memoryMXBean = 
ManagementFactory.getMemoryMXBean();
     private static final List<GarbageCollectorMXBean> garbageCollectorMXBeans =
-        ManagementFactory.getGarbageCollectorMXBeans();
-    private static final List<MemoryManagerMXBean> memoryManagerMXBeans =
-        ManagementFactory.getMemoryManagerMXBeans();
-    private static final List<MemoryPoolMXBean> memoryPoolMXBeans =
-        ManagementFactory.getMemoryPoolMXBeans();
+            ManagementFactory.getGarbageCollectorMXBeans();
+    private static final List<MemoryManagerMXBean> memoryManagerMXBeans = 
ManagementFactory.getMemoryManagerMXBeans();
+    private static final List<MemoryPoolMXBean> memoryPoolMXBeans = 
ManagementFactory.getMemoryPoolMXBeans();
 
     /**
      * Check whether thread contention monitoring is enabled.
@@ -146,8 +137,8 @@ public class Diagnostics {
         threadMXBean.setThreadCpuTimeEnabled(enable);
         boolean checkValue = threadMXBean.isThreadCpuTimeEnabled();
         if (enable != checkValue) {
-            log.error(sm.getString("diagnostics.setPropertyFail", 
"threadCpuTimeEnabled",
-                    Boolean.valueOf(enable), Boolean.valueOf(checkValue)));
+            log.error(sm.getString("diagnostics.setPropertyFail", 
"threadCpuTimeEnabled", Boolean.valueOf(enable),
+                    Boolean.valueOf(checkValue)));
         }
     }
 
@@ -167,8 +158,8 @@ public class Diagnostics {
         classLoadingMXBean.setVerbose(verbose);
         boolean checkValue = classLoadingMXBean.isVerbose();
         if (verbose != checkValue) {
-            log.error(sm.getString("diagnostics.setPropertyFail", 
"verboseClassLoading",
-                    Boolean.valueOf(verbose), Boolean.valueOf(checkValue)));
+            log.error(sm.getString("diagnostics.setPropertyFail", 
"verboseClassLoading", Boolean.valueOf(verbose),
+                    Boolean.valueOf(checkValue)));
         }
     }
 
@@ -176,15 +167,14 @@ public class Diagnostics {
      * Set logger level
      *
      * @param loggerName the name of the logger
-     * @param levelName the level to set
+     * @param levelName  the level to set
      */
     public static void setLoggerLevel(String loggerName, String levelName) {
         loggingMXBean.setLoggerLevel(loggerName, levelName);
         String checkValue = loggingMXBean.getLoggerLevel(loggerName);
         if (!checkValue.equals(levelName)) {
             String propertyName = "loggerLevel[" + loggerName + "]";
-            log.error(sm.getString("diagnostics.setPropertyFail", propertyName,
-                    levelName, checkValue));
+            log.error(sm.getString("diagnostics.setPropertyFail", 
propertyName, levelName, checkValue));
         }
     }
 
@@ -197,8 +187,8 @@ public class Diagnostics {
         memoryMXBean.setVerbose(verbose);
         boolean checkValue = memoryMXBean.isVerbose();
         if (verbose != checkValue) {
-            log.error(sm.getString("diagnostics.setPropertyFail", 
"verboseGarbageCollection",
-                    Boolean.valueOf(verbose), Boolean.valueOf(checkValue)));
+            log.error(sm.getString("diagnostics.setPropertyFail", 
"verboseGarbageCollection", Boolean.valueOf(verbose),
+                    Boolean.valueOf(checkValue)));
         }
     }
 
@@ -215,7 +205,7 @@ public class Diagnostics {
      * @param name name of the MemoryPoolMXBean or "all"
      */
     public static void resetPeakUsage(String name) {
-        for (MemoryPoolMXBean mbean: memoryPoolMXBeans) {
+        for (MemoryPoolMXBean mbean : memoryPoolMXBeans) {
             if (name.equals("all") || name.equals(mbean.getName())) {
                 mbean.resetPeakUsage();
             }
@@ -225,12 +215,13 @@ public class Diagnostics {
     /**
      * Set usage threshold in MemoryPoolMXBean
      *
-     * @param name name of the MemoryPoolMXBean
+     * @param name      name of the MemoryPoolMXBean
      * @param threshold the threshold to set
+     *
      * @return true if setting the threshold succeeded
      */
     public static boolean setUsageThreshold(String name, long threshold) {
-        for (MemoryPoolMXBean mbean: memoryPoolMXBeans) {
+        for (MemoryPoolMXBean mbean : memoryPoolMXBeans) {
             if (name.equals(mbean.getName())) {
                 try {
                     mbean.setUsageThreshold(threshold);
@@ -247,12 +238,13 @@ public class Diagnostics {
     /**
      * Set collection usage threshold in MemoryPoolMXBean
      *
-     * @param name name of the MemoryPoolMXBean
+     * @param name      name of the MemoryPoolMXBean
      * @param threshold the collection threshold to set
+     *
      * @return true if setting the threshold succeeded
      */
     public static boolean setCollectionUsageThreshold(String name, long 
threshold) {
-        for (MemoryPoolMXBean mbean: memoryPoolMXBeans) {
+        for (MemoryPoolMXBean mbean : memoryPoolMXBeans) {
             if (name.equals(mbean.getName())) {
                 try {
                     mbean.setCollectionUsageThreshold(threshold);
@@ -270,6 +262,7 @@ public class Diagnostics {
      * Formats the thread dump header for one thread.
      *
      * @param ti the ThreadInfo describing the thread
+     *
      * @return the formatted thread dump header
      */
     private static String getThreadDumpHeader(ThreadInfo ti) {
@@ -297,6 +290,7 @@ public class Diagnostics {
      * Formats the thread dump for one thread.
      *
      * @param ti the ThreadInfo describing the thread
+     *
      * @return the formatted thread dump
      */
     private static String getThreadDump(ThreadInfo ti) {
@@ -318,14 +312,15 @@ public class Diagnostics {
                 if (ti.getLockName() != null) {
                     sb.append(INDENT2 + "- waiting on (a 
").append(ti.getLockName()).append(")");
                     if (ti.getLockOwnerName() != null) {
-                        sb.append(" owned by 
").append(ti.getLockOwnerName()).append(" Id=").append(ti.getLockOwnerId());
+                        sb.append(" owned by 
").append(ti.getLockOwnerName()).append(" Id=")
+                                .append(ti.getLockOwnerId());
                     }
                     sb.append(CRLF);
                 }
                 start = false;
             }
             if (monitorDepths[i] != null) {
-                MonitorInfo mi = (MonitorInfo)monitorDepths[i];
+                MonitorInfo mi = (MonitorInfo) monitorDepths[i];
                 sb.append(INDENT2 + "- locked (a 
").append(mi.toString()).append(")").append(" index ");
                 sb.append(mi.getLockedStackDepth()).append(" frame 
").append(mi.getLockedStackFrame().toString());
                 sb.append(CRLF);
@@ -339,6 +334,7 @@ public class Diagnostics {
      * Formats the thread dump for a list of threads.
      *
      * @param tinfos the ThreadInfo array describing the thread list
+     *
      * @return the formatted thread dump
      */
     private static String getThreadDump(ThreadInfo[] tinfos) {
@@ -351,17 +347,14 @@ public class Diagnostics {
     }
 
     /**
-     * Check if any threads are deadlocked. If any, print
-     * the thread dump for those threads.
+     * Check if any threads are deadlocked. If any, print the thread dump for 
those threads.
      *
-     * @return a deadlock message and the formatted thread dump
-     *         of the deadlocked threads
+     * @return a deadlock message and the formatted thread dump of the 
deadlocked threads
      */
     public static String findDeadlock() {
         long[] ids = threadMXBean.findDeadlockedThreads();
         if (ids != null) {
-            ThreadInfo[] tinfos = 
threadMXBean.getThreadInfo(threadMXBean.findDeadlockedThreads(),
-                                                true, true);
+            ThreadInfo[] tinfos = 
threadMXBean.getThreadInfo(threadMXBean.findDeadlockedThreads(), true, true);
             if (tinfos != null) {
                 return sm.getString("diagnostics.deadlockFound") + CRLF + 
getThreadDump(tinfos);
             }
@@ -370,8 +363,7 @@ public class Diagnostics {
     }
 
     /**
-     * Retrieves a formatted JVM thread dump.
-     * The default StringManager will be used.
+     * Retrieves a formatted JVM thread dump. The default StringManager will 
be used.
      *
      * @return the formatted JVM thread dump
      */
@@ -380,29 +372,27 @@ public class Diagnostics {
     }
 
     /**
-     * Retrieves a formatted JVM thread dump.
-     * The given list of locales will be used
-     * to retrieve a StringManager.
+     * Retrieves a formatted JVM thread dump. The given list of locales will 
be used to retrieve a StringManager.
      *
      * @param requestedLocales list of locales to use
+     *
      * @return the formatted JVM thread dump
      */
     public static String getThreadDump(Enumeration<Locale> requestedLocales) {
-        return getThreadDump(
-                StringManager.getManager(PACKAGE, requestedLocales));
+        return getThreadDump(StringManager.getManager(PACKAGE, 
requestedLocales));
     }
 
     /**
-     * Retrieve a JVM thread dump formatted
-     * using the given StringManager.
+     * Retrieve a JVM thread dump formatted using the given StringManager.
      *
      * @param requestedSm the StringManager to use
+     *
      * @return the formatted JVM thread dump
      */
     public static String getThreadDump(StringManager requestedSm) {
         StringBuilder sb = new StringBuilder();
 
-        synchronized(timeformat) {
+        synchronized (timeformat) {
             sb.append(timeformat.format(new Date()));
         }
         sb.append(CRLF);
@@ -428,8 +418,10 @@ public class Diagnostics {
 
     /**
      * Format contents of a MemoryUsage object.
-     * @param name a text prefix used in formatting
+     *
+     * @param name  a text prefix used in formatting
      * @param usage the MemoryUsage object to format
+     *
      * @return the formatted contents
      */
     private static String formatMemoryUsage(String name, MemoryUsage usage) {
@@ -445,8 +437,7 @@ public class Diagnostics {
     }
 
     /**
-     * Retrieves a formatted JVM information text.
-     * The default StringManager will be used.
+     * Retrieves a formatted JVM information text. The default StringManager 
will be used.
      *
      * @return the formatted JVM information text
      */
@@ -455,11 +446,10 @@ public class Diagnostics {
     }
 
     /**
-     * Retrieves a formatted JVM information text.
-     * The given list of locales will be used
-     * to retrieve a StringManager.
+     * Retrieves a formatted JVM information text. The given list of locales 
will be used to retrieve a StringManager.
      *
      * @param requestedLocales list of locales to use
+     *
      * @return the formatted JVM information text
      */
     public static String getVMInfo(Enumeration<Locale> requestedLocales) {
@@ -467,17 +457,17 @@ public class Diagnostics {
     }
 
     /**
-     * Retrieve a JVM information text formatted
-     * using the given StringManager.
+     * Retrieve a JVM information text formatted using the given StringManager.
      *
      * @param requestedSm the StringManager to use
+     *
      * @return the formatted JVM information text
      */
     @SuppressWarnings("deprecation")
     public static String getVMInfo(StringManager requestedSm) {
         StringBuilder sb = new StringBuilder();
 
-        synchronized(timeformat) {
+        synchronized (timeformat) {
             sb.append(timeformat.format(new Date()));
         }
         sb.append(CRLF);
@@ -502,19 +492,25 @@ public class Diagnostics {
         sb.append(INDENT1 + "name: 
").append(operatingSystemMXBean.getName()).append(CRLF);
         sb.append(INDENT1 + "version: 
").append(operatingSystemMXBean.getVersion()).append(CRLF);
         sb.append(INDENT1 + "architecture: 
").append(operatingSystemMXBean.getArch()).append(CRLF);
-        sb.append(INDENT1 + "availableProcessors: 
").append(operatingSystemMXBean.getAvailableProcessors()).append(CRLF);
+        sb.append(INDENT1 + "availableProcessors: 
").append(operatingSystemMXBean.getAvailableProcessors())
+                .append(CRLF);
         sb.append(INDENT1 + "systemLoadAverage: 
").append(operatingSystemMXBean.getSystemLoadAverage()).append(CRLF);
         sb.append(CRLF);
 
         sb.append(requestedSm.getString("diagnostics.vmInfoThreadMxBean"));
         sb.append(":" + CRLF);
-        sb.append(INDENT1 + "isCurrentThreadCpuTimeSupported: 
").append(threadMXBean.isCurrentThreadCpuTimeSupported()).append(CRLF);
+        sb.append(INDENT1 + "isCurrentThreadCpuTimeSupported: 
").append(threadMXBean.isCurrentThreadCpuTimeSupported())
+                .append(CRLF);
         sb.append(INDENT1 + "isThreadCpuTimeSupported: 
").append(threadMXBean.isThreadCpuTimeSupported()).append(CRLF);
         sb.append(INDENT1 + "isThreadCpuTimeEnabled: 
").append(threadMXBean.isThreadCpuTimeEnabled()).append(CRLF);
-        sb.append(INDENT1 + "isObjectMonitorUsageSupported: 
").append(threadMXBean.isObjectMonitorUsageSupported()).append(CRLF);
-        sb.append(INDENT1 + "isSynchronizerUsageSupported: 
").append(threadMXBean.isSynchronizerUsageSupported()).append(CRLF);
-        sb.append(INDENT1 + "isThreadContentionMonitoringSupported: 
").append(threadMXBean.isThreadContentionMonitoringSupported()).append(CRLF);
-        sb.append(INDENT1 + "isThreadContentionMonitoringEnabled: 
").append(threadMXBean.isThreadContentionMonitoringEnabled()).append(CRLF);
+        sb.append(INDENT1 + "isObjectMonitorUsageSupported: 
").append(threadMXBean.isObjectMonitorUsageSupported())
+                .append(CRLF);
+        sb.append(INDENT1 + "isSynchronizerUsageSupported: 
").append(threadMXBean.isSynchronizerUsageSupported())
+                .append(CRLF);
+        sb.append(INDENT1 + "isThreadContentionMonitoringSupported: ")
+                
.append(threadMXBean.isThreadContentionMonitoringSupported()).append(CRLF);
+        sb.append(INDENT1 + "isThreadContentionMonitoringEnabled: ")
+                
.append(threadMXBean.isThreadContentionMonitoringEnabled()).append(CRLF);
         sb.append(CRLF);
 
         sb.append(requestedSm.getString("diagnostics.vmInfoThreadCounts"));
@@ -527,7 +523,7 @@ public class Diagnostics {
 
         sb.append(requestedSm.getString("diagnostics.vmInfoStartup"));
         sb.append(":" + CRLF);
-        for (String arg: runtimeMXBean.getInputArguments()) {
+        for (String arg : runtimeMXBean.getInputArguments()) {
             sb.append(INDENT1).append(arg).append(CRLF);
         }
         sb.append(CRLF);
@@ -553,30 +549,31 @@ public class Diagnostics {
         sb.append(":" + CRLF);
         sb.append(INDENT1 + "name: 
").append(compilationMXBean.getName()).append(CRLF);
         sb.append(INDENT1 + "totalCompilationTime: 
").append(compilationMXBean.getTotalCompilationTime()).append(CRLF);
-        sb.append(INDENT1 + "isCompilationTimeMonitoringSupported: 
").append(compilationMXBean.isCompilationTimeMonitoringSupported()).append(CRLF);
+        sb.append(INDENT1 + "isCompilationTimeMonitoringSupported: ")
+                
.append(compilationMXBean.isCompilationTimeMonitoringSupported()).append(CRLF);
         sb.append(CRLF);
 
-        for (MemoryManagerMXBean mbean: memoryManagerMXBeans) {
+        for (MemoryManagerMXBean mbean : memoryManagerMXBeans) {
             
sb.append(requestedSm.getString("diagnostics.vmInfoMemoryManagers", 
mbean.getName()));
             sb.append(":" + CRLF);
             sb.append(INDENT1 + "isValid: 
").append(mbean.isValid()).append(CRLF);
             sb.append(INDENT1 + "mbean.getMemoryPoolNames: " + CRLF);
             String[] names = mbean.getMemoryPoolNames();
             Arrays.sort(names);
-            for (String name: names) {
+            for (String name : names) {
                 sb.append(INDENT2).append(name).append(CRLF);
             }
             sb.append(CRLF);
         }
 
-        for (GarbageCollectorMXBean mbean: garbageCollectorMXBeans) {
+        for (GarbageCollectorMXBean mbean : garbageCollectorMXBeans) {
             
sb.append(requestedSm.getString("diagnostics.vmInfoGarbageCollectors", 
mbean.getName()));
             sb.append(":" + CRLF);
             sb.append(INDENT1 + "isValid: 
").append(mbean.isValid()).append(CRLF);
             sb.append(INDENT1 + "mbean.getMemoryPoolNames: " + CRLF);
             String[] names = mbean.getMemoryPoolNames();
             Arrays.sort(names);
-            for (String name: names) {
+            for (String name : names) {
                 sb.append(INDENT2).append(name).append(CRLF);
             }
             sb.append(INDENT1 + "getCollectionCount: 
").append(mbean.getCollectionCount()).append(CRLF);
@@ -587,12 +584,13 @@ public class Diagnostics {
         sb.append(requestedSm.getString("diagnostics.vmInfoMemory"));
         sb.append(":" + CRLF);
         sb.append(INDENT1 + "isVerbose: 
").append(memoryMXBean.isVerbose()).append(CRLF);
-        sb.append(INDENT1 + "getObjectPendingFinalizationCount: 
").append(memoryMXBean.getObjectPendingFinalizationCount()).append(CRLF);
+        sb.append(INDENT1 + "getObjectPendingFinalizationCount: ")
+                
.append(memoryMXBean.getObjectPendingFinalizationCount()).append(CRLF);
         sb.append(formatMemoryUsage("heap", 
memoryMXBean.getHeapMemoryUsage()));
         sb.append(formatMemoryUsage("non-heap", 
memoryMXBean.getNonHeapMemoryUsage()));
         sb.append(CRLF);
 
-        for (MemoryPoolMXBean mbean: memoryPoolMXBeans) {
+        for (MemoryPoolMXBean mbean : memoryPoolMXBeans) {
             sb.append(requestedSm.getString("diagnostics.vmInfoMemoryPools", 
mbean.getName()));
             sb.append(":" + CRLF);
             sb.append(INDENT1 + "isValid: 
").append(mbean.isValid()).append(CRLF);
@@ -600,7 +598,7 @@ public class Diagnostics {
             sb.append(INDENT1 + "mbean.getMemoryManagerNames: " + CRLF);
             String[] names = mbean.getMemoryManagerNames();
             Arrays.sort(names);
-            for (String name: names) {
+            for (String name : names) {
                 sb.append(INDENT2).append(name).append(CRLF);
             }
             sb.append(INDENT1 + "isUsageThresholdSupported: 
").append(mbean.isUsageThresholdSupported()).append(CRLF);
@@ -609,9 +607,11 @@ public class Diagnostics {
             } catch (UnsupportedOperationException ex) {
                 // IGNORE
             }
-            sb.append(INDENT1 + "isCollectionUsageThresholdSupported: 
").append(mbean.isCollectionUsageThresholdSupported()).append(CRLF);
+            sb.append(INDENT1 + "isCollectionUsageThresholdSupported: ")
+                    
.append(mbean.isCollectionUsageThresholdSupported()).append(CRLF);
             try {
-                sb.append(INDENT1 + "isCollectionUsageThresholdExceeded: 
").append(mbean.isCollectionUsageThresholdExceeded()).append(CRLF);
+                sb.append(INDENT1 + "isCollectionUsageThresholdExceeded: ")
+                        
.append(mbean.isCollectionUsageThresholdExceeded()).append(CRLF);
             } catch (UnsupportedOperationException ex) {
                 // IGNORE
             }
@@ -626,12 +626,14 @@ public class Diagnostics {
                 // IGNORE
             }
             try {
-                sb.append(INDENT1 + "getCollectionUsageThreshold: 
").append(mbean.getCollectionUsageThreshold()).append(CRLF);
+                sb.append(INDENT1 + "getCollectionUsageThreshold: 
").append(mbean.getCollectionUsageThreshold())
+                        .append(CRLF);
             } catch (UnsupportedOperationException ex) {
                 // IGNORE
             }
             try {
-                sb.append(INDENT1 + "getCollectionUsageThresholdCount: 
").append(mbean.getCollectionUsageThresholdCount()).append(CRLF);
+                sb.append(INDENT1 + "getCollectionUsageThresholdCount: ")
+                        
.append(mbean.getCollectionUsageThresholdCount()).append(CRLF);
             } catch (UnsupportedOperationException ex) {
                 // IGNORE
             }
@@ -647,7 +649,7 @@ public class Diagnostics {
         Map<String,String> props = runtimeMXBean.getSystemProperties();
         ArrayList<String> keys = new ArrayList<>(props.keySet());
         Collections.sort(keys);
-        for (String prop: keys) {
+        for (String prop : keys) {
             sb.append(INDENT1).append(prop).append(": 
").append(props.get(prop)).append(CRLF);
         }
         sb.append(CRLF);
@@ -656,7 +658,7 @@ public class Diagnostics {
         sb.append(":" + CRLF);
         List<String> loggers = loggingMXBean.getLoggerNames();
         Collections.sort(loggers);
-        for (String logger: loggers) {
+        for (String logger : loggers) {
             sb.append(INDENT1).append(logger).append(": 
level=").append(loggingMXBean.getLoggerLevel(logger));
             sb.append(", 
parent=").append(loggingMXBean.getParentLoggerName(logger)).append(CRLF);
         }
diff --git a/java/org/apache/tomcat/util/ExceptionUtils.java 
b/java/org/apache/tomcat/util/ExceptionUtils.java
index 057f4321db..c7b252d8e3 100644
--- a/java/org/apache/tomcat/util/ExceptionUtils.java
+++ b/java/org/apache/tomcat/util/ExceptionUtils.java
@@ -25,8 +25,8 @@ import java.lang.reflect.InvocationTargetException;
 public class ExceptionUtils {
 
     /**
-     * Checks whether the supplied Throwable is one that needs to be
-     * rethrown and swallows all others.
+     * Checks whether the supplied Throwable is one that needs to be rethrown 
and swallows all others.
+     *
      * @param t the Throwable to check
      */
     public static void handleThrowable(Throwable t) {
@@ -41,11 +41,11 @@ public class ExceptionUtils {
     }
 
     /**
-     * Checks whether the supplied Throwable is an instance of
-     * <code>InvocationTargetException</code> and returns the throwable that is
-     * wrapped by it, if there is any.
+     * Checks whether the supplied Throwable is an instance of 
<code>InvocationTargetException</code> and returns the
+     * throwable that is wrapped by it, if there is any.
      *
      * @param t the Throwable to check
+     *
      * @return <code>t</code> or <code>t.getCause()</code>
      */
     public static Throwable unwrapInvocationTargetException(Throwable t) {
@@ -57,10 +57,9 @@ public class ExceptionUtils {
 
 
     /**
-     * NO-OP method provided to enable simple preloading of this class. Since
-     * the class is used extensively in error handling, it is prudent to
-     * preload it to avoid any failure to load this class masking the true
-     * problem during error handling.
+     * NO-OP method provided to enable simple preloading of this class. Since 
the class is used extensively in error
+     * handling, it is prudent to preload it to avoid any failure to load this 
class masking the true problem during
+     * error handling.
      */
     public static void preload() {
         // NO-OP
diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java 
b/java/org/apache/tomcat/util/IntrospectionUtils.java
index 647ad2e128..9a4c644e20 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -37,29 +37,28 @@ public final class IntrospectionUtils {
     private static final StringManager sm = 
StringManager.getManager(IntrospectionUtils.class);
 
     /**
-     * Find a method with the right name If found, call the method ( if param 
is
-     * int or boolean we'll convert value to the right type before) - that 
means
-     * you can have setDebug(1).
-     * @param o The object to set a property on
-     * @param name The property name
+     * Find a method with the right name If found, call the method ( if param 
is int or boolean we'll convert value to
+     * the right type before) - that means you can have setDebug(1).
+     *
+     * @param o     The object to set a property on
+     * @param name  The property name
      * @param value The property value
+     *
      * @return <code>true</code> if operation was successful
      */
     public static boolean setProperty(Object o, String name, String value) {
         return setProperty(o, name, value, true, null);
     }
 
-    public static boolean setProperty(Object o, String name, String value,
-            boolean invokeSetProperty) {
+    public static boolean setProperty(Object o, String name, String value, 
boolean invokeSetProperty) {
         return setProperty(o, name, value, invokeSetProperty, null);
     }
 
     @SuppressWarnings("null") // setPropertyMethodVoid is not null when used
-    public static boolean setProperty(Object o, String name, String value,
-            boolean invokeSetProperty, StringBuilder actualMethod) {
+    public static boolean setProperty(Object o, String name, String value, 
boolean invokeSetProperty,
+            StringBuilder actualMethod) {
         if (log.isTraceEnabled()) {
-            log.trace("IntrospectionUtils: setProperty(" +
-                    o.getClass() + " " + name + "=" + value + ")");
+            log.trace("IntrospectionUtils: setProperty(" + o.getClass() + " " 
+ name + "=" + value + ")");
         }
 
         if (actualMethod == null && XReflectionIntrospectionUtils.isEnabled()) 
{
@@ -76,8 +75,8 @@ public final class IntrospectionUtils {
             // First, the ideal case - a setFoo( String ) method
             for (Method item : methods) {
                 Class<?>[] paramT = item.getParameterTypes();
-                if (setter.equals(item.getName()) && paramT.length == 1
-                        && "java.lang.String".equals(paramT[0].getName())) {
+                if (setter.equals(item.getName()) && paramT.length == 1 &&
+                        "java.lang.String".equals(paramT[0].getName())) {
                     item.invoke(o, value);
                     if (actualMethod != null) {
                         
actualMethod.append(item.getName()).append("(\"").append(escape(value)).append("\")");
@@ -89,8 +88,7 @@ public final class IntrospectionUtils {
             // Try a setFoo ( int ) or ( boolean )
             for (Method method : methods) {
                 boolean ok = true;
-                if (setter.equals(method.getName())
-                        && method.getParameterTypes().length == 1) {
+                if (setter.equals(method.getName()) && 
method.getParameterTypes().length == 1) {
 
                     // match - find the type and invoke it
                     Class<?> paramType = method.getParameterTypes()[0];
@@ -106,9 +104,11 @@ public final class IntrospectionUtils {
                             }
                             if (actualMethod != null) {
                                 if 
("java.lang.Integer".equals(paramType.getName())) {
-                                    
actualMethod.append(method.getName()).append("(Integer.valueOf(\"").append(value).append("\"))");
+                                    
actualMethod.append(method.getName()).append("(Integer.valueOf(\"").append(value)
+                                            .append("\"))");
                                 } else {
-                                    
actualMethod.append(method.getName()).append("(Integer.parseInt(\"").append(value).append("\"))");
+                                    
actualMethod.append(method.getName()).append("(Integer.parseInt(\"").append(value)
+                                            .append("\"))");
                                 }
                             }
                             // Try a setFoo ( long )
@@ -121,9 +121,11 @@ public final class IntrospectionUtils {
                             }
                             if (actualMethod != null) {
                                 if 
("java.lang.Long".equals(paramType.getName())) {
-                                    
actualMethod.append(method.getName()).append("(Long.valueOf(\"").append(value).append("\"))");
+                                    
actualMethod.append(method.getName()).append("(Long.valueOf(\"").append(value)
+                                            .append("\"))");
                                 } else {
-                                    
actualMethod.append(method.getName()).append("(Long.parseLong(\"").append(value).append("\"))");
+                                    
actualMethod.append(method.getName()).append("(Long.parseLong(\"").append(value)
+                                            .append("\"))");
                                 }
                             }
                             // Try a setFoo ( boolean )
@@ -132,9 +134,11 @@ public final class IntrospectionUtils {
                             params[0] = Boolean.valueOf(value);
                             if (actualMethod != null) {
                                 if 
("java.lang.Boolean".equals(paramType.getName())) {
-                                    
actualMethod.append(method.getName()).append("(Boolean.valueOf(\"").append(value).append("\"))");
+                                    
actualMethod.append(method.getName()).append("(Boolean.valueOf(\"").append(value)
+                                            .append("\"))");
                                 } else {
-                                    
actualMethod.append(method.getName()).append("(Boolean.parseBoolean(\"").append(value).append("\"))");
+                                    
actualMethod.append(method.getName()).append("(Boolean.parseBoolean(\"")
+                                            .append(value).append("\"))");
                                 }
                             }
                             // Try a setFoo ( InetAddress )
@@ -149,14 +153,14 @@ public final class IntrospectionUtils {
                                 ok = false;
                             }
                             if (actualMethod != null) {
-                                
actualMethod.append(method.getName()).append("(InetAddress.getByName(\"").append(value).append("\"))");
+                                
actualMethod.append(method.getName()).append("(InetAddress.getByName(\"").append(value)
+                                        .append("\"))");
                             }
                             // Unknown type
                         }
                         default -> {
                             if (log.isTraceEnabled()) {
-                                log.trace("IntrospectionUtils: Unknown type " +
-                                    paramType.getName());
+                                log.trace("IntrospectionUtils: Unknown type " 
+ paramType.getName());
                             }
                         }
                     }
@@ -179,25 +183,24 @@ public final class IntrospectionUtils {
             }
 
             // Ok, no setXXX found, try a setProperty("name", "value")
-            if (invokeSetProperty && (setPropertyMethodBool != null ||
-                    setPropertyMethodVoid != null)) {
+            if (invokeSetProperty && (setPropertyMethodBool != null || 
setPropertyMethodVoid != null)) {
                 if (actualMethod != null) {
-                    
actualMethod.append("setProperty(\"").append(name).append("\", 
\"").append(escape(value)).append("\")");
+                    
actualMethod.append("setProperty(\"").append(name).append("\", 
\"").append(escape(value))
+                            .append("\")");
                 }
                 Object[] params = new Object[2];
                 params[0] = name;
                 params[1] = value;
                 if (setPropertyMethodBool != null) {
                     try {
-                        return ((Boolean) setPropertyMethodBool.invoke(o,
-                                params)).booleanValue();
-                    }catch (IllegalArgumentException biae) {
-                        //the boolean method had the wrong
-                        //parameter types. let's try the other
-                        if (setPropertyMethodVoid!=null) {
+                        return ((Boolean) setPropertyMethodBool.invoke(o, 
params)).booleanValue();
+                    } catch (IllegalArgumentException biae) {
+                        // the boolean method had the wrong
+                        // parameter types. let's try the other
+                        if (setPropertyMethodVoid != null) {
                             setPropertyMethodVoid.invoke(o, params);
                             return true;
-                        }else {
+                        } else {
                             throw biae;
                         }
                     }
@@ -217,8 +220,8 @@ public final class IntrospectionUtils {
     }
 
     /**
-     * @param s
-     *            the input string
+     * @param s the input string
+     *
      * @return escaped string, per Java rule
      */
     public static String escape(String s) {
@@ -292,36 +295,29 @@ public final class IntrospectionUtils {
     }
 
     /**
-     * Replaces ${NAME} in the value with the value of the property 'NAME'.
-     * Replaces ${NAME:DEFAULT} with the value of the property 'NAME:DEFAULT',
-     * if the property 'NAME:DEFAULT' is not set,
-     * the expression is replaced with the value of the property 'NAME',
-     * if the property 'NAME' is not set,
-     * the expression is replaced with 'DEFAULT'.
-     * If the property is not set and there is no default the value will be
-     * returned unmodified.
+     * Replaces ${NAME} in the value with the value of the property 'NAME'. 
Replaces ${NAME:DEFAULT} with the value of
+     * the property 'NAME:DEFAULT', if the property 'NAME:DEFAULT' is not set, 
the expression is replaced with the value
+     * of the property 'NAME', if the property 'NAME' is not set, the 
expression is replaced with 'DEFAULT'. If the
+     * property is not set and there is no default the value will be returned 
unmodified.
      *
-     * @param value The value
-     * @param staticProp Replacement properties
+     * @param value       The value
+     * @param staticProp  Replacement properties
      * @param dynamicProp Replacement properties
-     * @param classLoader Class loader associated with the code requesting the
-     *                    property
+     * @param classLoader Class loader associated with the code requesting the 
property
      *
      * @return the replacement value
      */
-    public static String replaceProperties(String value,
-                                           Hashtable<Object,Object> 
staticProp, PropertySource[] dynamicProp,
-                                           ClassLoader classLoader) {
-            return replaceProperties(value, staticProp, dynamicProp, 
classLoader, 0);
+    public static String replaceProperties(String value, 
Hashtable<Object,Object> staticProp,
+            PropertySource[] dynamicProp, ClassLoader classLoader) {
+        return replaceProperties(value, staticProp, dynamicProp, classLoader, 
0);
     }
 
-    private static String replaceProperties(String value,
-                                            Hashtable<Object,Object> 
staticProp, PropertySource[] dynamicProp,
-                                            ClassLoader classLoader, int 
iterationCount) {
+    private static String replaceProperties(String value, 
Hashtable<Object,Object> staticProp,
+            PropertySource[] dynamicProp, ClassLoader classLoader, int 
iterationCount) {
         if (value == null || !value.contains("${")) {
             return value;
         }
-        if (iterationCount >=20) {
+        if (iterationCount >= 20) {
             log.warn(sm.getString("introspectionUtils.tooManyIterations", 
value));
             return value;
         }
@@ -379,10 +375,10 @@ public final class IntrospectionUtils {
         if (log.isTraceEnabled()) {
             log.trace("IntrospectionUtils.replaceProperties iter on: " + 
newval);
         }
-        return replaceProperties(newval, staticProp, dynamicProp, classLoader, 
iterationCount+1);
+        return replaceProperties(newval, staticProp, dynamicProp, classLoader, 
iterationCount + 1);
     }
 
-    private static String getProperty(String name, Hashtable<Object, Object> 
staticProp, PropertySource[] dynamicProp) {
+    private static String getProperty(String name, Hashtable<Object,Object> 
staticProp, PropertySource[] dynamicProp) {
         String v = null;
         if (staticProp != null) {
             v = (String) staticProp.get(name);
@@ -400,7 +396,9 @@ public final class IntrospectionUtils {
 
     /**
      * Reverse of Introspector.decapitalize.
+     *
      * @param name The name
+     *
      * @return the capitalized string
      */
     public static String capitalize(String name) {
@@ -430,8 +428,7 @@ public final class IntrospectionUtils {
         return methods;
     }
 
-    public static Method findMethod(Class<?> c, String name,
-                                    Class<?>[] params) {
+    public static Method findMethod(Class<?> c, String name, Class<?>[] 
params) {
         Method[] methods = findMethods(c);
         for (Method method : methods) {
             if (method.getName().equals(name)) {
@@ -461,14 +458,13 @@ public final class IntrospectionUtils {
         return null;
     }
 
-    public static Object callMethod1(Object target, String methodN,
-            Object param1, String typeParam1, ClassLoader cl) throws Exception 
{
+    public static Object callMethod1(Object target, String methodN, Object 
param1, String typeParam1, ClassLoader cl)
+            throws Exception {
         if (target == null || methodN == null || param1 == null) {
             throw new 
IllegalArgumentException(sm.getString("introspectionUtils.nullParameter"));
         }
         if (log.isTraceEnabled()) {
-            log.trace("IntrospectionUtils: callMethod1 " +
-                    target.getClass().getName() + " " +
+            log.trace("IntrospectionUtils: callMethod1 " + 
target.getClass().getName() + " " +
                     param1.getClass().getName() + " " + typeParam1);
         }
 
@@ -480,7 +476,8 @@ public final class IntrospectionUtils {
         }
         Method m = findMethod(target.getClass(), methodN, params);
         if (m == null) {
-            throw new 
NoSuchMethodException(sm.getString("introspectionUtils.noMethod", methodN, 
target, target.getClass()));
+            throw new NoSuchMethodException(
+                    sm.getString("introspectionUtils.noMethod", methodN, 
target, target.getClass()));
         }
         try {
             return m.invoke(target, param1);
@@ -490,8 +487,8 @@ public final class IntrospectionUtils {
         }
     }
 
-    public static Object callMethodN(Object target, String methodN,
-                                     Object[] params, Class<?>[] typeParams) 
throws Exception {
+    public static Object callMethodN(Object target, String methodN, Object[] 
params, Class<?>[] typeParams)
+            throws Exception {
         Method m = findMethod(target.getClass(), methodN, typeParams);
         if (m == null) {
             if (log.isDebugEnabled()) {
@@ -550,33 +547,29 @@ public final class IntrospectionUtils {
             }
             default -> {
                 if (log.isTraceEnabled()) {
-                    log.trace("IntrospectionUtils: Unknown type " +
-                        paramType.getName());
+                    log.trace("IntrospectionUtils: Unknown type " + 
paramType.getName());
                 }
             }
         }
         if (result == null) {
-            throw new 
IllegalArgumentException(sm.getString("introspectionUtils.conversionError", 
object, paramType.getName()));
+            throw new IllegalArgumentException(
+                    sm.getString("introspectionUtils.conversionError", object, 
paramType.getName()));
         }
         return result;
     }
 
 
     /**
-     * Checks to see if the specified class is an instance of or assignable 
from
-     * the specified type. The class <code>clazz</code>, all its superclasses,
-     * interfaces and those superinterfaces are tested for a match against
-     * the type name <code>type</code>.
-     * This is similar to <code>instanceof</code> or {@link 
Class#isAssignableFrom}
-     * except that the target type will not be resolved into a Class
-     * object, which provides some security and memory benefits.
+     * Checks to see if the specified class is an instance of or assignable 
from the specified type. The class
+     * <code>clazz</code>, all its superclasses, interfaces and those 
superinterfaces are tested for a match against the
+     * type name <code>type</code>. This is similar to <code>instanceof</code> 
or {@link Class#isAssignableFrom} except
+     * that the target type will not be resolved into a Class object, which 
provides some security and memory benefits.
      *
      * @param clazz The class to test for a match.
-     * @param type The name of the type that <code>clazz</code> must be.
+     * @param type  The name of the type that <code>clazz</code> must be.
      *
-     * @return <code>true</code> if the <code>clazz</code> tested is an
-     *         instance of the specified <code>type</code>,
-     *         <code>false</code> otherwise.
+     * @return <code>true</code> if the <code>clazz</code> tested is an 
instance of the specified <code>type</code>,
+     *             <code>false</code> otherwise.
      */
     public static boolean isInstance(Class<?> clazz, String type) {
         if (type.equals(clazz.getName())) {
diff --git a/java/org/apache/tomcat/util/MultiThrowable.java 
b/java/org/apache/tomcat/util/MultiThrowable.java
index 7dac7f3e61..553998b560 100644
--- a/java/org/apache/tomcat/util/MultiThrowable.java
+++ b/java/org/apache/tomcat/util/MultiThrowable.java
@@ -22,9 +22,8 @@ import java.util.Collections;
 import java.util.List;
 
 /**
- * Wraps a list of throwables as a single throwable. This is intended to be 
used
- * when multiple actions are taken where each may throw an exception but all
- * actions are taken before any errors are reported.
+ * Wraps a list of throwables as a single throwable. This is intended to be 
used when multiple actions are taken where
+ * each may throw an exception but all actions are taken before any errors are 
reported.
  * <p>
  * This class is <b>NOT</b> threadsafe.
  */
@@ -54,9 +53,8 @@ public class MultiThrowable extends Throwable {
 
 
     /**
-     * @return {@code null} if there are no wrapped throwables, the Throwable 
if
-     *         there is a single wrapped throwable or the current instance of
-     *         there are multiple wrapped throwables
+     * @return {@code null} if there are no wrapped throwables, the Throwable 
if there is a single wrapped throwable or
+     *             the current instance of there are multiple wrapped 
throwables
      */
     public Throwable getThrowable() {
         if (size() == 0) {
@@ -78,10 +76,9 @@ public class MultiThrowable extends Throwable {
 
 
     /**
-     * Overrides the default implementation to provide a concatenation of the
-     * messages associated with each of the wrapped throwables. Note that the
-     * format of the returned String is not guaranteed to be fixed and may
-     * change in a future release.
+     * Overrides the default implementation to provide a concatenation of the 
messages associated with each of the
+     * wrapped throwables. Note that the format of the returned String is not 
guaranteed to be fixed and may change in a
+     * future release.
      */
     @Override
     public String toString() {
diff --git a/java/org/apache/tomcat/util/XReflectionIntrospectionUtils.java 
b/java/org/apache/tomcat/util/XReflectionIntrospectionUtils.java
index 021c90e6c6..a59388dbd6 100644
--- a/java/org/apache/tomcat/util/XReflectionIntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/XReflectionIntrospectionUtils.java
@@ -25,8 +25,8 @@ final class XReflectionIntrospectionUtils {
     /**
      * Always throws {@link UnsupportedOperationException}
      *
-     * @param o     Unused
-     * @param name  Unused
+     * @param o    Unused
+     * @param name Unused
      *
      * @return Never returns normally
      */


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to