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

acosentino pushed a commit to branch camel-4.8.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.8.x by this push:
     new 6418bfe18ee fix body comparison - model is the parent/super type of 
body
6418bfe18ee is described below

commit 6418bfe18eedcf640bd30a12af2c5969a871f83d
Author: Shantanu Kumar <[email protected]>
AuthorDate: Mon Mar 17 13:39:25 2025 +0530

    fix body comparison - model is the parent/super type of body
---
 .../apache/camel/component/servicenow/AbstractServiceNowProcessor.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/components/camel-servicenow/camel-servicenow-component/src/main/java/org/apache/camel/component/servicenow/AbstractServiceNowProcessor.java
 
b/components/camel-servicenow/camel-servicenow-component/src/main/java/org/apache/camel/component/servicenow/AbstractServiceNowProcessor.java
index 3e28c0eb6ed..27ba88f6935 100644
--- 
a/components/camel-servicenow/camel-servicenow-component/src/main/java/org/apache/camel/component/servicenow/AbstractServiceNowProcessor.java
+++ 
b/components/camel-servicenow/camel-servicenow-component/src/main/java/org/apache/camel/component/servicenow/AbstractServiceNowProcessor.java
@@ -151,7 +151,7 @@ public abstract class AbstractServiceNowProcessor 
implements Processor {
     protected AbstractServiceNowProcessor validateBody(Object body, Class<?> 
model) {
         ObjectHelper.notNull(body, "body");
 
-        if (!body.getClass().isAssignableFrom(model)) {
+        if (!model.isAssignableFrom(body.getClass())) {
             throw new IllegalArgumentException(
                     "Body is not compatible with model (body=" + 
body.getClass() + ", model=" + model);
         }

Reply via email to