You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/10/14 17:25:23 UTC

camel git commit: Fix the problem of instanceof test always return true.

Repository: camel
Updated Branches:
  refs/heads/master 97502f399 -> 2355265a5


Fix the problem of instanceof test always return true.

This instanceof test will always return true because AbstractSObjectBase is the return type of method node.getObject().
 The return value of method node.getObject() might be null, it would be better to do a null test rather than an instanceof test.
http://findbugs.sourceforge.net/bugDescriptions.html#BC_VACUOUS_INSTANCEOF


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2355265a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2355265a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2355265a

Branch: refs/heads/master
Commit: 2355265a5e1085bc3cd1a045bd6a090025776677
Parents: 97502f3
Author: Kui LIU <br...@gmail.com>
Authored: Thu Oct 12 11:12:32 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Oct 14 19:24:41 2017 +0200

----------------------------------------------------------------------
 .../camel/component/salesforce/api/dto/composite/SObjectTree.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2355265a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTree.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTree.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTree.java
index 8b99b13..57eb367 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTree.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTree.java
@@ -247,7 +247,7 @@ public final class SObjectTree implements Serializable {
         if (Objects.equals(attributesReferenceId, referenceId)) {
             final Object object = node.getObject();
 
-            if (object instanceof AbstractSObjectBase) {
+            if (object != null) {
                 return updateBaseObjectId(id, (AbstractSObjectBase) object);
             } else {
                 return updateGeneralObjectId(id, object);