camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/8] git commit: CAMEL-6839 Fixed the issue that Facebook endpoint incorrectly sets the nameStyle field to GET_AND_SEARCH even when no search* candidate methods are found with thanks to Dhiraj
Date Wed, 09 Oct 2013 04:27:17 GMT
Updated Branches:
  refs/heads/camel-2.11.x b1a7eafe9 -> 22447cbb0
  refs/heads/camel-2.12.x 5b87e18ac -> 0a803b960
  refs/heads/master 8fe10ab57 -> 12f00ef8e


CAMEL-6839 Fixed the issue that Facebook endpoint incorrectly sets the nameStyle field to
GET_AND_SEARCH even when no search* candidate methods are found with thanks to Dhiraj


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

Branch: refs/heads/master
Commit: a5e82add99d0f4702977c502d4f818045c436a92
Parents: 8fe10ab
Author: Willem Jiang <ningjiang@apache.org>
Authored: Wed Oct 9 11:33:44 2013 +0800
Committer: Willem Jiang <ningjiang@apache.org>
Committed: Wed Oct 9 11:33:44 2013 +0800

----------------------------------------------------------------------
 .../camel/component/facebook/FacebookEndpoint.java      | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a5e82add/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
index 02e9245..da2b0a7 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookEndpoint.java
@@ -16,7 +16,13 @@
  */
 package org.apache.camel.component.facebook;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
@@ -31,7 +37,6 @@ import org.apache.camel.util.EndpointHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.convertToGetMethod;
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.convertToSearchMethod;
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.getCandidateMethods;
@@ -135,6 +140,7 @@ public class FacebookEndpoint extends DefaultEndpoint implements FacebookConstan
                 this.nameStyle = FacebookNameStyle.GET;
             }
 
+            int nGetMethods = candidates.size();
             candidates.addAll(getCandidateMethods(convertToSearchMethod(methodName), argNames));
             // error if there are no candidates
             if (candidates.isEmpty()) {
@@ -145,7 +151,7 @@ public class FacebookEndpoint extends DefaultEndpoint implements FacebookConstan
             if (nameStyle == null) {
                 // no get* methods found
                 nameStyle = FacebookNameStyle.SEARCH;
-            } else {
+            } else if (candidates.size() > nGetMethods) {
                 // get* and search* methods found
                 nameStyle = FacebookNameStyle.GET_AND_SEARCH;
             }


Mime
View raw message