You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2013/09/01 10:30:50 UTC
git commit: CAMEL-6676 Fixed bunch of eclipse warnings
Updated Branches:
refs/heads/master 124c0e344 -> e5773a469
CAMEL-6676 Fixed bunch of eclipse warnings
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e5773a46
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e5773a46
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e5773a46
Branch: refs/heads/master
Commit: e5773a469474da64aaf27ed9e5f49397aaef895c
Parents: 124c0e3
Author: Willem Jiang <ni...@apache.org>
Authored: Sun Sep 1 16:28:32 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Sun Sep 1 16:28:32 2013 +0800
----------------------------------------------------------------------
.../component/facebook/FacebookConsumer.java | 2 +-
.../config/FacebookEndpointConfiguration.java | 6 ++---
.../facebook/data/FacebookMethodsType.java | 16 ++++++-------
.../data/FacebookMethodsTypeHelper.java | 25 ++++++++++----------
4 files changed, 24 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/e5773a46/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 854214c..2666167 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
@@ -175,7 +175,7 @@ public class FacebookConsumer extends ScheduledPollConsumer {
}
// must be a Collection
// TODO add support for Paging using ResponseList
- Collection collection = (Collection) result;
+ Collection<?> collection = (Collection<?>) result;
return collection.toArray(new Object[collection.size()]);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/e5773a46/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 66c8127..812d4eb 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
@@ -133,7 +133,7 @@ public class FacebookEndpointConfiguration extends FacebookConfiguration {
@UriParam
private PostUpdate postUpdate;
@UriParam
- private Map queries;
+ private Map<String, String> queries;
@UriParam
private String query;
@UriParam
@@ -537,11 +537,11 @@ public class FacebookEndpointConfiguration extends FacebookConfiguration {
this.postUpdate = postUpdate;
}
- public Map getQueries() {
+ public Map<String, String> getQueries() {
return queries;
}
- public void setQueries(Map queries) {
+ public void setQueries(Map<String, String> queries) {
this.queries = queries;
}
http://git-wip-us.apache.org/repos/asf/camel/blob/e5773a46/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 f35fb1a..f5273d8 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
@@ -520,12 +520,12 @@ public enum FacebookMethodsType {
// name, result class, ordered argument names and classes, and Method to invoke
private final String name;
- private final Class resultType;
+ private final Class<?> resultType;
private final List<String> argNames;
- private final List<Class> argTypes;
+ private final List<Class<?>> argTypes;
private final Method method;
- private FacebookMethodsType(Class resultType, String name, Object... args) throws IllegalArgumentException {
+ private FacebookMethodsType(Class<?> resultType, String name, Object... args) throws IllegalArgumentException {
this.name = name;
this.resultType = resultType;
@@ -535,9 +535,9 @@ public enum FacebookMethodsType {
}
int nArgs = args.length / 2;
this.argNames = new ArrayList<String>(nArgs);
- this.argTypes = new ArrayList<Class>(nArgs);
+ this.argTypes = new ArrayList<Class<?>>(nArgs);
for (int i = 0; i < nArgs; i++) {
- this.argTypes.add((Class) args[i * 2]);
+ this.argTypes.add((Class<?>) args[i * 2]);
this.argNames.add((String) args[i * 2 + 1]);
}
@@ -557,7 +557,7 @@ public enum FacebookMethodsType {
* @param args ordered argument types
* @return matching method, null if not found
*/
- public static FacebookMethodsType findMethod(String name, Class... args) {
+ public static FacebookMethodsType findMethod(String name, Class<?>... args) {
for (FacebookMethodsType method : values()) {
if (method.name.equals(name)) {
if ((method.argTypes.isEmpty() && (args == null || args.length == 0))
@@ -574,7 +574,7 @@ public enum FacebookMethodsType {
return name;
}
- public Class getResultType() {
+ public Class<?> getResultType() {
return resultType;
}
@@ -582,7 +582,7 @@ public enum FacebookMethodsType {
return Collections.unmodifiableList(argNames);
}
- public List<Class> getArgTypes() {
+ public List<Class<?>> getArgTypes() {
return Collections.unmodifiableList(argTypes);
}
http://git-wip-us.apache.org/repos/asf/camel/blob/e5773a46/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 0779d71..aaf1685 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
@@ -53,8 +53,8 @@ public final class FacebookMethodsTypeHelper {
new HashMap<String, List<Object>>();
// maps argument name to argument type
- private static final Map<String, Class> VALID_ARGUMENTS =
- new HashMap<String, Class>();
+ private static final Map<String, Class<?>> VALID_ARGUMENTS =
+ new HashMap<String, Class<?>>();
static {
final FacebookMethodsType[] methods = FacebookMethodsType.values();
@@ -80,17 +80,17 @@ public final class FacebookMethodsTypeHelper {
// process all arguments for this method
final int nArgs = method.getArgNames().size();
final String[] argNames = method.getArgNames().toArray(new String[nArgs]);
- final Class[] argTypes = method.getArgTypes().toArray(new Class[nArgs]);
+ final Class<?>[] argTypes = method.getArgTypes().toArray(new Class[nArgs]);
for (int i = 0; i < nArgs; i++) {
final String argName = argNames[i];
- final Class argType = argTypes[i];
+ final Class<?> argType = argTypes[i];
if (!arguments.contains(argName)) {
arguments.add(argType);
arguments.add(argName);
}
// also collect argument names for all methods, also detect clashes here
- final Class previousType = VALID_ARGUMENTS.get(argName);
+ final Class<?> previousType = VALID_ARGUMENTS.get(argName);
if (previousType != null && previousType != argType) {
throw new ExceptionInInitializerError(String.format(
"Argument %s has ambiguous types (%s, %s) across methods!",
@@ -253,7 +253,7 @@ public final class FacebookMethodsTypeHelper {
* Get argument types and names used by all methods.
* @return map with argument names as keys, and types as values
*/
- public static Map<String, Class> allArguments() {
+ public static Map<String, Class<?>> allArguments() {
return Collections.unmodifiableMap(VALID_ARGUMENTS);
}
@@ -262,8 +262,8 @@ public final class FacebookMethodsTypeHelper {
* @param argName argument name
* @return argument type
*/
- public static Class getType(String argName) throws IllegalArgumentException {
- final Class type = VALID_ARGUMENTS.get(argName);
+ public static Class<?> getType(String argName) throws IllegalArgumentException {
+ final Class<?> type = VALID_ARGUMENTS.get(argName);
if (type == null) {
throw new IllegalArgumentException(argName);
}
@@ -303,7 +303,6 @@ public final class FacebookMethodsTypeHelper {
* @return result of method invocation
* @throws RuntimeCamelException on errors
*/
- @SuppressWarnings("unchecked")
public static Object invokeMethod(Facebook facebook, FacebookMethodsType method, Map<String, Object> properties)
throws RuntimeCamelException {
@@ -311,19 +310,19 @@ public final class FacebookMethodsTypeHelper {
final List<String> argNames = method.getArgNames();
final Object[] values = new Object[argNames.size()];
- final List<Class> argTypes = method.getArgTypes();
- final Class[] types = argTypes.toArray(new Class[argTypes.size()]);
+ final List<Class<?>> argTypes = method.getArgTypes();
+ final Class<?>[] types = argTypes.toArray(new Class[argTypes.size()]);
int index = 0;
for (String name : argNames) {
Object value = properties.get(name);
// is the parameter an array type?
if (value != null && types[index].isArray()) {
- Class type = types[index];
+ Class<?> type = types[index];
if (value instanceof Collection) {
// convert collection to array
- Collection collection = (Collection) value;
+ Collection<?> collection = (Collection<?>) value;
Object array = Array.newInstance(type.getComponentType(), collection.size());
if (array instanceof Object[]) {
collection.toArray((Object[]) array);