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

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

commit 04b01caad141065a5bf85a2546cad1282557d9dd
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon Dec 14 18:55:19 2020 +0100

    CAMEL-15945: Fixed compile error
---
 .../component/salesforce/SalesforceConsumer.java   | 35 +++++++++++-----------
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java
 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java
index e054b6f..5299505 100644
--- 
a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java
+++ 
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java
@@ -103,30 +103,29 @@ public class SalesforceConsumer extends DefaultConsumer {
 
         rawPayload = endpoint.getConfiguration().isRawPayload();
 
-        if (rawPayload) {
-            return;
-        }
-
         // get sObjectClass to convert to
-        final String sObjectName = 
endpoint.getConfiguration().getSObjectName();
-        if (sObjectName != null) {
-            sObjectClass = 
endpoint.getComponent().getClassMap().get(sObjectName);
-            if (sObjectClass == null) {
-                throw new IllegalArgumentException(String.format("SObject 
Class not found for %s", sObjectName));
-            }
-        } else {
-            final String className = 
endpoint.getConfiguration().getSObjectClass();
-            if (className != null) {
-                sObjectClass = 
endpoint.getComponent().getCamelContext().getClassResolver().resolveClass(className);
+        if (!rawPayload) {
+            final String sObjectName = 
endpoint.getConfiguration().getSObjectName();
+            if (sObjectName != null) {
+                sObjectClass = 
endpoint.getComponent().getClassMap().get(sObjectName);
                 if (sObjectClass == null) {
-                    throw new IllegalArgumentException(String.format("SObject 
Class not found %s", className));
+                    throw new IllegalArgumentException(String.format("SObject 
Class not found for %s", sObjectName));
                 }
             } else {
-                LOG.warn("Property sObjectName or sObjectClass NOT set, 
messages will be of type java.lang.Map");
-                sObjectClass = null;
+                final String className = 
endpoint.getConfiguration().getSObjectClass();
+                if (className != null) {
+                    sObjectClass = 
endpoint.getComponent().getCamelContext().getClassResolver().resolveClass(className);
+                    if (sObjectClass == null) {
+                        throw new 
IllegalArgumentException(String.format("SObject Class not found %s", 
className));
+                    }
+                } else {
+                    LOG.warn("Property sObjectName or sObjectClass NOT set, 
messages will be of type java.lang.Map");
+                    sObjectClass = null;
+                }
             }
+        } else {
+            sObjectClass = null;
         }
-
     }
 
     public String getTopicName() {

Reply via email to