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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new ced5d3a5a6 Fix IDE warnings in Java package
ced5d3a5a6 is described below

commit ced5d3a5a6cb9789a2adf2ecec056e43c7c34eee
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Oct 20 12:06:33 2026 +0100

    Fix IDE warnings in Java package
    
    Re-apply code formatting
---
 .../catalina/tribes/transport/nio/NioReceiver.java |  1 +
 java/org/apache/el/lang/ELArithmetic.java          | 24 ++++++++++++++++------
 .../tomcat/util/collections/SynchronizedQueue.java | 10 ++++-----
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java 
b/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java
index 00f8b8bd55..acaa25742b 100644
--- a/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java
+++ b/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java
@@ -367,6 +367,7 @@ public class NioReceiver extends ReceiverBase implements 
Runnable, NioReceiverMB
                 try {
                     events();
                     socketTimeouts();
+                    @SuppressWarnings("null") // Suppress IDE false positive 
for selector
                     int n = selector.select(getSelectorTimeout());
                     if (n == 0) {
                         // there is a good chance that we got here
diff --git a/java/org/apache/el/lang/ELArithmetic.java 
b/java/org/apache/el/lang/ELArithmetic.java
index c47a502427..e86c2f9d41 100644
--- a/java/org/apache/el/lang/ELArithmetic.java
+++ b/java/org/apache/el/lang/ELArithmetic.java
@@ -307,7 +307,7 @@ public abstract class ELArithmetic {
      * @return The result of the addition
      *
      * @throws ELException if the operands cannot be coerced to numbers or if 
the addition cannot be computed, for
-     *                     example overflow with extreme BigDecimal values
+     *                         example overflow with extreme BigDecimal values
      */
     public static Number add(final Object obj0, final Object obj1) {
         final ELArithmetic delegate = findDelegate(obj0, obj1);
@@ -333,8 +333,8 @@ public abstract class ELArithmetic {
      *
      * @return The result of the modulo operation
      *
-     * @throws ELException if the operands cannot be coerced to numbers or if 
the modulo cannot be computed, for
-     *                     example division by zero with integer operands
+     * @throws ELException if the operands cannot be coerced to numbers or if 
the modulo cannot be computed, for example
+     *                         division by zero with integer operands
      */
     public static Number mod(final Object obj0, final Object obj1) {
         if (obj0 == null && obj1 == null) {
@@ -371,7 +371,7 @@ public abstract class ELArithmetic {
      * @return The result of the subtraction
      *
      * @throws ELException if the operands cannot be coerced to numbers or if 
the subtraction cannot be computed, for
-     *                     example overflow with extreme BigDecimal values
+     *                         example overflow with extreme BigDecimal values
      */
     public static Number subtract(final Object obj0, final Object obj1) {
         final ELArithmetic delegate = findDelegate(obj0, obj1);
@@ -398,7 +398,7 @@ public abstract class ELArithmetic {
      * @return The result of the division
      *
      * @throws ELException if the operands cannot be coerced to numbers or if 
the division cannot be computed, for
-     *                     example division by zero with BigDecimal or 
BigInteger operands
+     *                         example division by zero with BigDecimal or 
BigInteger operands
      */
     public static Number divide(final Object obj0, final Object obj1) {
         if (obj0 == null && obj1 == null) {
@@ -429,6 +429,7 @@ public abstract class ELArithmetic {
      *
      * @param obj0 The first factor
      * @param obj1 The second factor
+     *
      * @return The result of the multiplication
      */
     public static Number multiply(final Object obj0, final Object obj1) {
@@ -467,6 +468,7 @@ public abstract class ELArithmetic {
      * Check if the given object is a number.
      *
      * @param obj The object to check
+     *
      * @return true if the object is a number
      */
     public static boolean isNumber(final Object obj) {
@@ -477,6 +479,7 @@ public abstract class ELArithmetic {
      * Check if the given class is a number type.
      *
      * @param type The class to check
+     *
      * @return true if the class is a number type
      */
     public static boolean isNumberType(final Class<?> type) {
@@ -496,6 +499,7 @@ public abstract class ELArithmetic {
      *
      * @param num0 The first number
      * @param num1 The second number
+     *
      * @return The sum
      */
     protected abstract Number add(Number num0, Number num1);
@@ -505,6 +509,7 @@ public abstract class ELArithmetic {
      *
      * @param num0 The first number
      * @param num1 The second number
+     *
      * @return The product
      */
     protected abstract Number multiply(Number num0, Number num1);
@@ -514,6 +519,7 @@ public abstract class ELArithmetic {
      *
      * @param num0 The minuend
      * @param num1 The subtrahend
+     *
      * @return The difference
      */
     protected abstract Number subtract(Number num0, Number num1);
@@ -523,6 +529,7 @@ public abstract class ELArithmetic {
      *
      * @param num0 The dividend
      * @param num1 The divisor
+     *
      * @return The remainder
      */
     protected abstract Number mod(Number num0, Number num1);
@@ -531,6 +538,7 @@ public abstract class ELArithmetic {
      * Coerce a number to the delegate's preferred type.
      *
      * @param num The number to coerce
+     *
      * @return The coerced number
      */
     protected abstract Number coerce(Number num);
@@ -559,7 +567,8 @@ public abstract class ELArithmetic {
                 return coerce(Short.valueOf((short) ((Character) 
obj).charValue()));
             }
         } catch (NumberFormatException nfe) {
-            throw new ELException(MessageFactory.get("error.convert", obj, 
obj.getClass(), "Number"), nfe);
+            throw new ELException(
+                    MessageFactory.get("error.convert", obj, obj == null ? 
null : obj.getClass(), "Number"), nfe);
         }
 
         throw new ELException(MessageFactory.get("error.convert", obj, 
obj.getClass(), "Number"));
@@ -569,6 +578,7 @@ public abstract class ELArithmetic {
      * Coerce a string to a number.
      *
      * @param str The string to coerce
+     *
      * @return The coerced number
      */
     protected abstract Number coerce(String str);
@@ -578,6 +588,7 @@ public abstract class ELArithmetic {
      *
      * @param num0 The dividend
      * @param num1 The divisor
+     *
      * @return The quotient
      */
     protected abstract Number divide(Number num0, Number num1);
@@ -587,6 +598,7 @@ public abstract class ELArithmetic {
      *
      * @param obj0 The first operand
      * @param obj1 The second operand
+     *
      * @return true if this delegate should handle these types
      */
     protected abstract boolean matches(Object obj0, Object obj1);
diff --git a/java/org/apache/tomcat/util/collections/SynchronizedQueue.java 
b/java/org/apache/tomcat/util/collections/SynchronizedQueue.java
index d541fa15fc..1adf766c7c 100644
--- a/java/org/apache/tomcat/util/collections/SynchronizedQueue.java
+++ b/java/org/apache/tomcat/util/collections/SynchronizedQueue.java
@@ -66,14 +66,12 @@ public class SynchronizedQueue<T> {
      *
      * @param initialSize the initial capacity, which must be positive
      *
-     * @throws IllegalArgumentException if the specified initial capacity is
-     *         not positive
+     * @throws IllegalArgumentException if the specified initial capacity is 
not positive
      */
     public SynchronizedQueue(int initialSize) {
         if (initialSize <= 0) {
             throw new IllegalArgumentException(
-                    sm.getString("synchronizedQueue.invalidInitialSize",
-                            initialSize));
+                    sm.getString("synchronizedQueue.invalidInitialSize", 
Integer.valueOf(initialSize)));
         }
         queue = new Object[initialSize];
         size = initialSize;
@@ -83,6 +81,7 @@ public class SynchronizedQueue<T> {
      * Adds the specified element to the tail of this queue.
      *
      * @param t the element to add
+     *
      * @return true (as specified by {@link java.util.Queue#offer})
      */
     public synchronized boolean offer(T t) {
@@ -100,8 +99,7 @@ public class SynchronizedQueue<T> {
     }
 
     /**
-     * Retrieves and removes the head of this queue, or returns null
-     * if this queue is empty.
+     * Retrieves and removes the head of this queue, or returns null if this 
queue is empty.
      *
      * @return the head of this queue, or null if empty
      */


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

Reply via email to