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

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new d294f920ec SonarQube bug fixes
d294f920ec is described below

commit d294f920ec1c3843d8f12e75a2e2925037b3b365
Author: James Bognar <[email protected]>
AuthorDate: Thu Feb 5 15:42:03 2026 -0500

    SonarQube bug fixes
---
 .../src/main/java/org/apache/juneau/bean/LinkString.java           | 2 +-
 .../juneau/bean/jsonschema/JsonSchemaPropertySimpleArray.java      | 1 +
 .../src/main/java/org/apache/juneau/commons/utils/StringUtils.java | 2 +-
 .../src/main/java/org/apache/juneau/httppart/HttpPartSchema.java   | 2 +-
 .../src/main/java/org/apache/juneau/svl/VarResolverSession.java    | 2 +-
 .../src/main/java/org/apache/juneau/rest/client/RestClient.java    | 1 +
 juneau-utest/src/test/java/org/apache/juneau/BeanConfig_Test.java  | 3 ++-
 .../test/java/org/apache/juneau/commons/utils/IoUtils_Test.java    | 5 +++--
 scripts/check-fluent-setter-overrides.py                           | 7 ++-----
 9 files changed, 13 insertions(+), 12 deletions(-)

diff --git 
a/juneau-bean/juneau-bean-common/src/main/java/org/apache/juneau/bean/LinkString.java
 
b/juneau-bean/juneau-bean-common/src/main/java/org/apache/juneau/bean/LinkString.java
index 3a9adb7dc0..89f8a12496 100644
--- 
a/juneau-bean/juneau-bean-common/src/main/java/org/apache/juneau/bean/LinkString.java
+++ 
b/juneau-bean/juneau-bean-common/src/main/java/org/apache/juneau/bean/LinkString.java
@@ -143,7 +143,7 @@ public class LinkString implements Comparable<LinkString> {
         * @return This object.
         */
        public LinkString setUri(String value) {
-               setUri(value, new Object[0]);
+               setUri(value, (Object[])new Object[0]);
                return this;
        }
 
diff --git 
a/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchemaPropertySimpleArray.java
 
b/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchemaPropertySimpleArray.java
index ea6b5d0be1..2888a0ac81 100644
--- 
a/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchemaPropertySimpleArray.java
+++ 
b/juneau-bean/juneau-bean-jsonschema/src/main/java/org/apache/juneau/bean/jsonschema/JsonSchemaPropertySimpleArray.java
@@ -245,6 +245,7 @@ public class JsonSchemaPropertySimpleArray extends 
JsonSchemaProperty {
        }
 
        @Override /* Overridden from JsonSchemaProperty */
+       @Deprecated(since = "10.0", forRemoval = true) // Parent method is 
deprecated
        public JsonSchemaPropertySimpleArray setId(Object value) {
                super.setId(value);
                return this;
diff --git 
a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/utils/StringUtils.java
 
b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/utils/StringUtils.java
index 7948e159c4..c599b9fa3c 100644
--- 
a/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/utils/StringUtils.java
+++ 
b/juneau-core/juneau-commons/src/main/java/org/apache/juneau/commons/utils/StringUtils.java
@@ -6697,7 +6697,7 @@ public class StringUtils {
         *      The results, or <jk>null</jk> if the input was <jk>null</jk>.
         *      <br>An empty string results in an empty array.
         */
-       @SuppressWarnings("java:S3776")
+       @SuppressWarnings({"java:S3776", "java:S2583"}) // State variables 
persist across loop iterations
        public static String[] splitQuoted(String s, boolean keepQuotes) {
 
                if (s == null)
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
index 43300afcbe..2d4ab4c009 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
@@ -3910,7 +3910,7 @@ public class HttpPartSchema {
                        errors.add("Cannot define an array of objects unless 
array format is 'uon'.");
 
                if (! errors.isEmpty())
-                       throw new ContextRuntimeException("Schema specification 
errors: \n\t" + StringUtils.join(errors, "\n\t"), new Object[0]);
+                       throw new ContextRuntimeException("Schema specification 
errors: \n\t" + StringUtils.join(errors, "\n\t"), (Object[])new Object[0]);
        }
 
        /**
diff --git 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverSession.java
 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverSession.java
index f3ea8a8515..50b16e5ce2 100644
--- 
a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverSession.java
+++ 
b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/svl/VarResolverSession.java
@@ -327,7 +327,7 @@ public class VarResolverSession {
         * @return The same writer.
         * @throws IOException Thrown by underlying stream.
         */
-       @SuppressWarnings({"java:S6541", "java:S3776"})
+       @SuppressWarnings({"java:S6541", "java:S3776", "java:S2583"}) // State 
variables persist across loop iterations
        public Writer resolveTo(String s, Writer out) throws IOException {
 
                // S1: Not in variable, looking for $
diff --git 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
index afd8589de0..5f5e188e6a 100644
--- 
a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
+++ 
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestClient.java
@@ -7755,6 +7755,7 @@ public class RestClient extends BeanContextable 
implements HttpClient, Closeable
        }
 
        @Override
+       @Deprecated(since = "9", forRemoval = true) // Object.finalize() is 
deprecated
        protected void finalize() throws Throwable {
                if (detectLeaks && ! isClosed.get() && ! keepHttpClientOpen) {
                        var sb = new StringBuilder("WARNING:  RestClient 
garbage collected before it was finalized.");  // NOT DEBUG
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BeanConfig_Test.java 
b/juneau-utest/src/test/java/org/apache/juneau/BeanConfig_Test.java
index ad7798b7a7..c17bd74b74 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/BeanConfig_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/BeanConfig_Test.java
@@ -72,11 +72,12 @@ class BeanConfig_Test extends TestBase {
                m3.put("address", p2.getAddress());
 
                var pm1 = bc.toBeanMap(p1);
+               Map<?,?> pm1AsMap = pm1; // Compare as Map to avoid dissimilar 
type comparison
 
                assertEquals(pm1.size(), m1.size(), fs("Bean Map size failed 
for: {0} / {1} / {2}", p1, pm1.size(), m1.size()));
                assertEquals(pm1.keySet(), m1.keySet(), fs("Bean Map key set 
equality failed for: {0} / {1} / {2}", p1, pm1.keySet() , m1.keySet()));
                assertEquals(m1.keySet(), pm1.keySet(), fs("Bean Map key set 
reverse equality failed for: {0} / {1} / {2}", p1, pm1.keySet(), m1.keySet()));
-               assertEquals(pm1, m1, fs("Bean Map equality failed for: {0} / 
{1} / {2}", p1, pm1, m1));
+               assertEquals(pm1AsMap, m1, fs("Bean Map equality failed for: 
{0} / {1} / {2}", p1, pm1, m1));
                assertThrows(BeanRuntimeException.class, 
()->bc.newBeanMap(Address.class));  // Address returned as a new bean type, but 
shouldn't be since it doesn't have a default constructor.
                assertNull(bc.newBeanMap(java.lang.Integer.class), 
"java.lang.Integer incorrectly designated as bean type.");
                assertNull(bc.newBeanMap(java.lang.Class.class), 
"java.lang.Class incorrectly designated as bean type.");
diff --git 
a/juneau-utest/src/test/java/org/apache/juneau/commons/utils/IoUtils_Test.java 
b/juneau-utest/src/test/java/org/apache/juneau/commons/utils/IoUtils_Test.java
index 0f1a3af5d5..dbf3a7ec0f 100644
--- 
a/juneau-utest/src/test/java/org/apache/juneau/commons/utils/IoUtils_Test.java
+++ 
b/juneau-utest/src/test/java/org/apache/juneau/commons/utils/IoUtils_Test.java
@@ -972,9 +972,10 @@ class IoUtils_Test extends TestBase {
                cleanupThreadLocals();
                // Should not throw
 
-               // Call again to ensure it's safe to call multiple times
+               // Call again to ensure it's safe to call multiple times 
(idempotency)
                cleanupThreadLocals();
-               // Should not throw
+               // Verify method completed successfully - if we reach here, no 
exception was thrown
+               assertDoesNotThrow(() -> cleanupThreadLocals());
        }
 
        
//====================================================================================================
diff --git a/scripts/check-fluent-setter-overrides.py 
b/scripts/check-fluent-setter-overrides.py
index a8b2d75f4a..79c4a22c44 100755
--- a/scripts/check-fluent-setter-overrides.py
+++ b/scripts/check-fluent-setter-overrides.py
@@ -255,11 +255,8 @@ def check_missing_overrides(classes, class_map):
         # Try to match parent classes from the same package or commonly 
imported packages
         filtered_parents = []
         for pc in parent_classes:
-            # If child and parent are in the same package, use it
-            if java_class.package == pc.package:
-                filtered_parents.append(pc)
-            # Otherwise, if there's only one parent class with this name, use 
it
-            elif len(parent_classes) == 1:
+            # If child and parent are in the same package, or there's only one 
parent class with this name, use it
+            if java_class.package == pc.package or len(parent_classes) == 1:
                 filtered_parents.append(pc)
         
         # If we couldn't filter by package, fall back to all parent classes

Reply via email to