Claus Ibsen created CAMEL-26160:
-----------------------------------

             Summary: camel-servicenow - AbstractServiceNowProcessor.unwrap 
uses model.isInstance(Map.class), which is always false
                 Key: CAMEL-26160
                 URL: https://issues.apache.org/jira/browse/CAMEL-26160
             Project: Camel
          Issue Type: Bug
          Components: camel-servicenow
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while adding the catalog body types of servicenow (CAMEL-24961, PR 
#28410).

h4. 1. unwrap checks model.isInstance(Map.class), which is always false

{{AbstractServiceNowProcessor.unwrap}} (main 2a465aa4814c, line 170) tests 
{{model.isInstance(Map.class)}} to read an array response with a Map model as a 
plain {{List}}. That asks whether the {{Class}} object {{Map.class}} is an 
instance of {{model}}, which is never true for a Map model, so the branch is 
dead and the array is always read with the {{javaTypeCache}} type. The fallback 
gives the same result for a Map model, so no wrong output was seen. Read in the 
code, not run.

Proposed: use {{Map.class.isAssignableFrom(model)}}, or remove the dead branch.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to