camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [4/4] git commit: CAMEL-6676 Fixed some CS errors and eclipse warnings of camel-facebook
Date Sun, 01 Sep 2013 07:48:21 GMT
CAMEL-6676 Fixed some CS errors and eclipse warnings of camel-facebook


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

Branch: refs/heads/master
Commit: 124c0e3445d33399dec1976ae4783e464f6af380
Parents: 1c29340
Author: Willem Jiang <ningjiang@apache.org>
Authored: Sun Sep 1 15:47:15 2013 +0800
Committer: Willem Jiang <ningjiang@apache.org>
Committed: Sun Sep 1 15:47:15 2013 +0800

----------------------------------------------------------------------
 components/camel-facebook/pom.xml               |  5 ++-
 .../component/facebook/FacebookConsumer.java    | 16 ++++++--
 .../facebook/config/FacebookConfiguration.java  |  9 ++---
 .../config/FacebookEndpointConfiguration.java   | 14 ++++++-
 .../facebook/data/FacebookMethodsType.java      | 41 ++++++++++++++++++--
 .../data/FacebookMethodsTypeHelper.java         | 17 ++++++--
 .../facebook/data/FacebookPropertiesHelper.java | 11 ++++--
 .../component/facebook/data/ReadingBuilder.java | 11 ++++--
 .../facebook/CamelFacebookTestSupport.java      |  6 +--
 .../facebook/FacebookComponentConsumerTest.java | 11 ++++--
 .../facebook/FacebookComponentProducerTest.java | 23 +++++------
 .../data/FacebookMethodsTypeHelperTest.java     | 40 ++++++++++++++-----
 .../facebook/data/FacebookMethodsTypeTest.java  |  8 ++--
 .../facebook/data/ReadingBuilderTest.java       | 24 +++++++++++-
 14 files changed, 178 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-facebook/pom.xml b/components/camel-facebook/pom.xml
index 940d539..b3745a3 100644
--- a/components/camel-facebook/pom.xml
+++ b/components/camel-facebook/pom.xml
@@ -21,7 +21,7 @@
   <parent>
     <artifactId>components</artifactId>
     <groupId>org.apache.camel</groupId>
-    <version>2.12.1-SNAPSHOT</version>
+    <version>2.13-SNAPSHOT</version>
   </parent>
 
   <artifactId>camel-facebook</artifactId>
@@ -79,7 +79,8 @@
           <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
           <includes>
             <!-- Here we only run test of  -->
-            <include>**/*UriConfigurationTest.java</include>
+            <include>**/ReadingBuilderTest.java</include>
+            <include>**/FacebookMethodsType*Test.java</include>
           </includes>
         </configuration>
       </plugin>

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookConsumer.java
b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookConsumer.java
index 4980d3c..854214c 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookConsumer.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/FacebookConsumer.java
@@ -18,11 +18,22 @@ package org.apache.camel.component.facebook;
 
 import java.lang.reflect.Array;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
+
+import facebook4j.Reading;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.component.facebook.data.FacebookMethodsType;
+import org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.MatchType;
 import org.apache.camel.component.facebook.data.FacebookPropertiesHelper;
 import org.apache.camel.component.facebook.data.ReadingBuilder;
 import org.apache.camel.impl.ScheduledPollConsumer;
@@ -30,12 +41,9 @@ import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import facebook4j.Reading;
-
 import static org.apache.camel.component.facebook.FacebookConstants.FACEBOOK_DATE_FORMAT;
 import static org.apache.camel.component.facebook.FacebookConstants.READING_PPROPERTY;
 import static org.apache.camel.component.facebook.FacebookConstants.READING_PREFIX;
-import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.MatchType;
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.filterMethods;
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.getHighestPriorityMethod;
 import static org.apache.camel.component.facebook.data.FacebookMethodsTypeHelper.getMissingProperties;

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookConfiguration.java
b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookConfiguration.java
index 5285423..20a2ebb 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookConfiguration.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookConfiguration.java
@@ -16,17 +16,16 @@
  */
 package org.apache.camel.component.facebook.config;
 
-import org.apache.camel.spi.UriParam;
-import org.apache.camel.spi.UriParams;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import facebook4j.Facebook;
 import facebook4j.FacebookException;
 import facebook4j.FacebookFactory;
 import facebook4j.auth.OAuthAuthorization;
 import facebook4j.conf.Configuration;
 import facebook4j.conf.ConfigurationBuilder;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Facebook component configuration.

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookEndpointConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookEndpointConfiguration.java
b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookEndpointConfiguration.java
index 1705630..66c8127 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookEndpointConfiguration.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/config/FacebookEndpointConfiguration.java
@@ -22,13 +22,23 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+
+import facebook4j.AlbumCreate;
+import facebook4j.CheckinCreate;
+import facebook4j.EventUpdate;
+import facebook4j.GeoLocation;
+import facebook4j.Media;
+import facebook4j.PictureSize;
+import facebook4j.PostUpdate;
+import facebook4j.Reading;
+import facebook4j.TagUpdate;
+import facebook4j.TestUser;
+
 import org.apache.camel.component.facebook.FacebookConstants;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
 import org.apache.camel.util.ObjectHelper;
 
-import facebook4j.*;
-
 @UriParams
 public class FacebookEndpointConfiguration extends FacebookConfiguration {
 

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsType.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsType.java
b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsType.java
index 02ef2fd..f35fb1a 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsType.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsType.java
@@ -18,12 +18,45 @@ package org.apache.camel.component.facebook.data;
 
 import java.lang.reflect.Method;
 import java.net.URL;
-import java.util.*;
-import org.apache.camel.component.facebook.FacebookConstants;
-
-import facebook4j.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import facebook4j.Album;
+import facebook4j.AlbumCreate;
+import facebook4j.Checkin;
+import facebook4j.CheckinCreate;
+import facebook4j.Comment;
+import facebook4j.Domain;
+import facebook4j.Event;
+import facebook4j.EventUpdate;
+import facebook4j.Facebook;
+import facebook4j.Friendlist;
+import facebook4j.GeoLocation;
+import facebook4j.Group;
+import facebook4j.InboxResponseList;
+import facebook4j.Link;
+import facebook4j.Media;
+import facebook4j.Message;
+import facebook4j.Note;
+import facebook4j.Photo;
+import facebook4j.PictureSize;
+import facebook4j.Post;
+import facebook4j.PostUpdate;
+import facebook4j.Question;
+import facebook4j.Reading;
+import facebook4j.ResponseList;
+import facebook4j.TagUpdate;
+import facebook4j.TestUser;
+import facebook4j.User;
+import facebook4j.Video;
 import facebook4j.internal.org.json.JSONArray;
 
+import org.apache.camel.component.facebook.FacebookConstants;
+
 /**
  * Enum for Facebook4J *Method interfaces.
  * The methods are ordered by the number and nature of arguments.

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelper.java
b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelper.java
index 1e78dac..0779d71 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelper.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelper.java
@@ -17,16 +17,25 @@
 package org.apache.camel.component.facebook.data;
 
 import java.lang.reflect.Array;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import facebook4j.Facebook;
+import facebook4j.FacebookException;
+
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.component.facebook.FacebookConstants;
 import org.apache.camel.component.facebook.config.FacebookNameStyle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import facebook4j.Facebook;
-import facebook4j.FacebookException;
-
 
 /**
  * Helper class for working with {@link FacebookMethodsType}.

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookPropertiesHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookPropertiesHelper.java
b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookPropertiesHelper.java
index 5a61d2c..b17a120 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookPropertiesHelper.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookPropertiesHelper.java
@@ -17,7 +17,14 @@
 package org.apache.camel.component.facebook.data;
 
 import java.lang.reflect.Field;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import facebook4j.Reading;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.component.facebook.FacebookConstants;
 import org.apache.camel.component.facebook.config.FacebookConfiguration;
@@ -26,8 +33,6 @@ import org.apache.camel.util.IntrospectionSupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import facebook4j.Reading;
-
 /**
  * Helper class to work with Facebook component properties.
  */

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/ReadingBuilder.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/ReadingBuilder.java
b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/ReadingBuilder.java
index 1e44887..40c4b2f 100644
--- a/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/ReadingBuilder.java
+++ b/components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/ReadingBuilder.java
@@ -22,14 +22,19 @@ import java.text.SimpleDateFormat;
 import java.util.LinkedHashMap;
 import java.util.Locale;
 import java.util.Map;
-import org.apache.camel.component.facebook.FacebookConstants;
 
 import facebook4j.Reading;
 
+import org.apache.camel.component.facebook.FacebookConstants;
+
 /**
  * Builds {@link facebook4j.Reading} instances.
  */
-public class ReadingBuilder {
+public final class ReadingBuilder {
+    
+    private ReadingBuilder() {
+        // Helper class
+    }
 
 
     public static Reading copy(Reading reading, boolean skipSinceUtil) throws NoSuchFieldException,
IllegalAccessException {
@@ -39,7 +44,7 @@ public class ReadingBuilder {
         final LinkedHashMap<String, String> source = (LinkedHashMap<String, String>)
field.get(reading);
         // create another reading, and add all fields from source
         Reading copy = new Reading();
-        final LinkedHashMap copyMap = new LinkedHashMap();
+        final LinkedHashMap<String, String> copyMap = new LinkedHashMap<String,
String>();
         copyMap.putAll(source);
         if (skipSinceUtil) {
             copyMap.remove("since");

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/CamelFacebookTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/CamelFacebookTestSupport.java
b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/CamelFacebookTestSupport.java
index 1dc0f17..98d28fb 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/CamelFacebookTestSupport.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/CamelFacebookTestSupport.java
@@ -64,9 +64,9 @@ public class CamelFacebookTestSupport extends CamelTestSupport {
     }
 
     public String getOauthParams() {
-        return "oAuthAppId=" + properties.get("oAuthAppId") + "&oAuthAppSecret=" + properties.get("oAuthAppSecret")
+
-            (properties.get("oAuthAccessToken") != null ?
-                ("&oAuthAccessToken=" + properties.get("oAuthAccessToken")) : "");
+        return "oAuthAppId=" + properties.get("oAuthAppId") + "&oAuthAppSecret=" + properties.get("oAuthAppSecret")
+            + (properties.get("oAuthAccessToken") != null
+            ? ("&oAuthAccessToken=" + properties.get("oAuthAccessToken")) : "");
     }
 
     protected String getShortName(String name) {

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentConsumerTest.java
b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentConsumerTest.java
index 80476fc..b64832b 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentConsumerTest.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentConsumerTest.java
@@ -18,14 +18,19 @@ package org.apache.camel.component.facebook;
 
 import java.lang.reflect.Method;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 import java.util.concurrent.TimeUnit;
+
+import facebook4j.api.SearchMethods;
+
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.Test;
 
-import facebook4j.api.SearchMethods;
-
 public class FacebookComponentConsumerTest extends CamelFacebookTestSupport {
 
     private final Set<String> searchNames = new HashSet<String>();

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentProducerTest.java
b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentProducerTest.java
index bc8b65b..21e4709 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentProducerTest.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentProducerTest.java
@@ -21,12 +21,13 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+
+import facebook4j.Facebook;
+
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.junit.Test;
 
-import facebook4j.Facebook;
-
 public class FacebookComponentProducerTest extends CamelFacebookTestSupport {
 
     private final Set<String> noArgNames = new HashSet<String>();
@@ -35,7 +36,7 @@ public class FacebookComponentProducerTest extends CamelFacebookTestSupport
{
     private final List<String> readingExcludes;
 
     public FacebookComponentProducerTest() throws Exception {
-        for (Class clazz : Facebook.class.getInterfaces()) {
+        for (Class<?> clazz : Facebook.class.getInterfaces()) {
             final String clazzName = clazz.getSimpleName();
             if (clazzName.endsWith("Methods") && !clazzName.equals("GameMethods"))
{
                 for (Method method : clazz.getDeclaredMethods()) {
@@ -94,28 +95,28 @@ public class FacebookComponentProducerTest extends CamelFacebookTestSupport
{
                 // generate test routes for all methods with no args
                 for (String name : noArgNames) {
                     from("direct://test" + name)
-                      .to("facebook://" + name + "?" + getOauthParams())
-                      .to("mock:result" + name);
+                        .to("facebook://" + name + "?" + getOauthParams())
+                        .to("mock:result" + name);
 
                     // with user id
                     if (!idExcludes.contains(name)) {
                         from("direct://testId" + name)
-                          .to("facebook://" + name + "?userId=me&" + getOauthParams())
-                          .to("mock:resultId" + name);
+                            .to("facebook://" + name + "?userId=me&" + getOauthParams())
+                            .to("mock:resultId" + name);
                     }
 
                     // reading options
                     if (!readingExcludes.contains(name)) {
                         from("direct://testReading" + name)
-                          .to("facebook://" + name + "?reading.limit=10&reading.locale=en,US&"
+ getOauthParams())
-                          .to("mock:resultReading" + name);
+                            .to("facebook://" + name + "?reading.limit=10&reading.locale=en,US&"
+ getOauthParams())
+                            .to("mock:resultReading" + name);
                     }
 
                     // with id and reading options
                     if (!(idExcludes.contains(name) || readingExcludes.contains(name))) {
                         from("direct://testIdReading" + name)
-                          .to("facebook://" + name + "?userId=me&reading.limit=10&reading.locale=en,US&"
+ getOauthParams())
-                          .to("mock:resultIdReading" + name);
+                            .to("facebook://" + name + "?userId=me&reading.limit=10&reading.locale=en,US&"
+ getOauthParams())
+                            .to("mock:resultIdReading" + name);
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
index 0cdc15f..a4a43fd 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
@@ -1,17 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.facebook.data;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
-import java.util.*;
-import org.apache.camel.component.facebook.config.FacebookEndpointConfiguration;
-import org.junit.Test;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 import facebook4j.Facebook;
 
+import org.apache.camel.component.facebook.config.FacebookEndpointConfiguration;
+import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
+
 /**
  * Test {@link FacebookMethodsTypeHelper}.
  */
@@ -78,16 +100,16 @@ public class FacebookMethodsTypeHelperTest {
     @Test
     public void testGetArguments() throws Exception {
         final Class<?>[] interfaces = Facebook.class.getInterfaces();
-        for (Class clazz : interfaces) {
+        for (Class<?> clazz : interfaces) {
             if (clazz.getName().endsWith("Methods")) {
                 // check all methods of this *Methods interface
                 for (Method method : clazz.getDeclaredMethods()) {
                     // will throw an exception if can't be found
                     final List<Object> arguments = FacebookMethodsTypeHelper.getArguments(method.getName());
                     final int nArgs = arguments.size() / 2;
-                    List<Class> types = new ArrayList<Class>(nArgs);
+                    List<Class<?>> types = new ArrayList<Class<?>>(nArgs);
                     for (int i = 0; i < nArgs; i++) {
-                        types.add((Class) arguments.get(2 * i));
+                        types.add((Class<?>) arguments.get(2 * i));
                     }
                     assertTrue("Missing parameters for " + method,
                         types.containsAll(Arrays.asList(method.getParameterTypes())));
@@ -104,11 +126,11 @@ public class FacebookMethodsTypeHelperTest {
     @Test
     public void testGetType() throws Exception {
         for (Field field : FacebookEndpointConfiguration.class.getDeclaredFields()) {
-            Class expectedType = field.getType();
-            final Class actualType = FacebookMethodsTypeHelper.getType(field.getName());
+            Class<?> expectedType = field.getType();
+            final Class<?> actualType = FacebookMethodsTypeHelper.getType(field.getName());
             // test for auto boxing, un-boxing
             if (actualType.isPrimitive()) {
-                expectedType = (Class) expectedType.getField("TYPE").get(null);
+                expectedType = (Class<?>) expectedType.getField("TYPE").get(null);
             } else if (List.class.isAssignableFrom(expectedType) && actualType.isArray())
{
                 // skip lists, since they will be converted in invokeMethod()
                 expectedType = actualType;

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeTest.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeTest.java
b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeTest.java
index 1f390e4..8c3c523 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeTest.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeTest.java
@@ -18,11 +18,13 @@ package org.apache.camel.component.facebook.data;
 
 import java.lang.reflect.Method;
 
+import facebook4j.Facebook;
+
+import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import facebook4j.Facebook;
-import org.junit.Test;
 
 /**
  * Test that all *Methods methods are mapped in {@link FacebookMethodsType}.
@@ -32,7 +34,7 @@ public class FacebookMethodsTypeTest {
     @Test
     public void areAllMethodsMapped() throws Exception {
         final Class<?>[] interfaces = Facebook.class.getInterfaces();
-        for (Class clazz : interfaces) {
+        for (Class<?> clazz : interfaces) {
             if (clazz.getName().endsWith("Methods")) {
                 // check all methods of this *Methods interface
                 for (Method method : clazz.getDeclaredMethods()) {

http://git-wip-us.apache.org/repos/asf/camel/blob/124c0e34/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/ReadingBuilderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/ReadingBuilderTest.java
b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/ReadingBuilderTest.java
index e58d0d7..1856228 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/ReadingBuilderTest.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/ReadingBuilderTest.java
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.facebook.data;
 
 import java.text.SimpleDateFormat;
@@ -6,12 +22,16 @@ import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
 
-import static org.junit.Assert.*;
-
 import facebook4j.Reading;
+
 import org.apache.camel.component.facebook.FacebookConstants;
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+
 /**
  * Test {@link ReadingBuilder}. 
  */


Mime
View raw message