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

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 1e473d36a6a4 chore(components): jsonpath minor compilation warnings 
clearing
1e473d36a6a4 is described below

commit 1e473d36a6a44b89c1619e7d1dd3c20b86969d73
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Thu Dec 11 10:31:59 2025 +0100

    chore(components): jsonpath minor compilation warnings clearing
---
 .../main/java/org/apache/camel/jsonpath/JsonPathEngine.java    | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathEngine.java
 
b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathEngine.java
index 8e4a2bb59cc5..603ef1192320 100644
--- 
a/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathEngine.java
+++ 
b/components/camel-jsonpath/src/main/java/org/apache/camel/jsonpath/JsonPathEngine.java
@@ -106,8 +106,8 @@ public class JsonPathEngine {
     private ObjectMapper findRegisteredMapper(CamelContext context) {
         if (context != null) {
             ObjectMapper mapper = 
context.getRegistry().findSingleByType(ObjectMapper.class);
-            // do not use XML mapper
-            if (mapper != null && 
!mapper.getClass().getSimpleName().equals("XmlMapper")) {
+            // do not use XML mapper: the object can be registered by the user.
+            if (mapper != null && 
!mapper.getClass().getSimpleName().equals("XmlMapper")) { // NOSONAR
                 return mapper;
             }
         }
@@ -199,13 +199,11 @@ public class JsonPathEngine {
             LOG.trace("JSonPath: {} is read as String: {}", path, json);
             String str = (String) json;
             return JsonPath.using(configuration).parse(str).read(path);
-        } else if (json instanceof Map) {
+        } else if (json instanceof Map map) {
             LOG.trace("JSonPath: {} is read as Map: {}", path, json);
-            Map map = (Map) json;
             return JsonPath.using(configuration).parse(map).read(path);
-        } else if (json instanceof List) {
+        } else if (json instanceof List list) {
             LOG.trace("JSonPath: {} is read as List: {}", path, json);
-            List list = (List) json;
             return JsonPath.using(configuration).parse(list).read(path);
         } else {
             //try to auto convert into inputStream

Reply via email to