camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r835276 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/builder/ main/java/org/apache/camel/component/bean/ main/java/org/apache/camel/util/ test/java/org/apache/camel/component/bean/
Date Thu, 12 Nov 2009 07:15:05 GMT
Author: hadrian
Date: Thu Nov 12 07:15:04 2009
New Revision: 835276

URL: http://svn.apache.org/viewvc?rev=835276&view=rev
Log:
Removing more warnings

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/AmbiguousMethodCallException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/DefaultParameterMappingStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodBean.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodNotFoundException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterInfo.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterMappingStrategy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/RegistryBean.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/XPathAnnotationExpressionFactory.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanRegistryBeanTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/CustomParameterMappingStrategyTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/Builder.java Thu Nov 12
07:15:04 2009
@@ -67,7 +67,7 @@
      * @param method   name of method to invoke
      * @return the builder
      */
-    public static ValueBuilder bean(Class beanType, String method) {
+    public static ValueBuilder bean(Class<?> beanType, String method) {
         Expression expression = ExpressionBuilder.beanExpression(beanType, method);
         return new ValueBuilder(expression);
     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/BuilderSupport.java Thu
Nov 12 07:15:04 2009
@@ -158,7 +158,7 @@
      * @param beanType the Class of the bean which we want to invoke
      * @return the builder
      */
-    public ValueBuilder bean(Class beanType) {
+    public ValueBuilder bean(Class<?> beanType) {
         return Builder.bean(beanType, null);
     }
     
@@ -170,7 +170,7 @@
      * @param method   name of method to invoke
      * @return the builder
      */
-    public ValueBuilder bean(Class beanType, String method) {
+    public ValueBuilder bean(Class<?> beanType, String method) {
         return Builder.bean(beanType, method);
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java Thu
Nov 12 07:15:04 2009
@@ -46,7 +46,7 @@
  *
  * @version $Revision$
  */
-public class DataFormatClause<T extends ProcessorDefinition> {
+public class DataFormatClause<T extends ProcessorDefinition<?>> {
     private final T processorType;
     private final Operation operation;
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DeadLetterChannelBuilder.java
Thu Nov 12 07:15:04 2009
@@ -74,10 +74,6 @@
             } else {
                 // use a recipient list since we only have an uri for the endpoint
                 failureProcessor = new RecipientList(new Expression() {
-                    public Object evaluate(Exchange exchange) {
-                        return deadLetterUri;
-                    }
-
                     public <T> T evaluate(Exchange exchange, Class<T> type) {
                         return exchange.getContext().getTypeConverter().convertTo(type, deadLetterUri);
                     }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DefaultErrorHandlerBuilder.java
Thu Nov 12 07:15:04 2009
@@ -208,7 +208,7 @@
      * @param log the log class
      * @return the builder
      */
-    public DefaultErrorHandlerBuilder log(Class log) {
+    public DefaultErrorHandlerBuilder log(Class<?> log) {
         return log(LogFactory.getLog(log));
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java Thu
Nov 12 07:15:04 2009
@@ -905,7 +905,7 @@
         };
     }
     
-    public static Expression beanExpression(final Class beanType, final String methodName)
{
+    public static Expression beanExpression(final Class<?> beanType, final String methodName)
{
         return BeanLanguage.bean(beanType, methodName);        
     }
 
@@ -952,6 +952,4 @@
             }
         };
     }
-
-
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java Thu
Nov 12 07:15:04 2009
@@ -95,7 +95,7 @@
     /**
      * An expression of an inbound message body converted to the expected type
      */
-    public T body(Class expectedType) {
+    public T body(Class<?> expectedType) {
         return expression(ExpressionBuilder.bodyExpression(expectedType));
     }
 
@@ -183,7 +183,7 @@
      * @param beanType the Class of the bean which we want to invoke
      * @return the builder to continue processing the DSL
      */
-    public T method(Class beanType) {
+    public T method(Class<?> beanType) {
         MethodCallExpression expression = new MethodCallExpression(beanType);
         setExpressionType(expression);
         return result;
@@ -215,7 +215,7 @@
      * @param method the name of the method to invoke on the bean
      * @return the builder to continue processing the DSL
      */
-    public T method(Class beanType, String method) {
+    public T method(Class<?> beanType, String method) {
         MethodCallExpression expression = new MethodCallExpression(beanType, method);
         setExpressionType(expression);
         return result;
@@ -362,7 +362,7 @@
      * @param resultType the return type expected by the expressiopn
      * @return the builder to continue processing the DSL
      */
-    public T xpath(String text, Class resultType) {
+    public T xpath(String text, Class<?> resultType) {
         XPathExpression expression = new XPathExpression(text);
         expression.setResultType(resultType);
         setExpressionType(expression);
@@ -379,7 +379,7 @@
      * @param namespaces the namespace prefix and URIs to use
      * @return the builder to continue processing the DSL
      */
-    public T xpath(String text, Class resultType, Namespaces namespaces) {
+    public T xpath(String text, Class<?> resultType, Namespaces namespaces) {
         return xpath(text, resultType, namespaces.getNamespaces());
     }
 
@@ -393,7 +393,7 @@
      * @param namespaces the namespace prefix and URIs to use
      * @return the builder to continue processing the DSL
      */
-    public T xpath(String text, Class resultType, Map<String, String> namespaces) {
+    public T xpath(String text, Class<?> resultType, Map<String, String> namespaces)
{
         XPathExpression expression = new XPathExpression(text);
         expression.setResultType(resultType);
         expression.setNamespaces(namespaces);
@@ -448,7 +448,7 @@
      * @param resultType the return type expected by the expressiopn
      * @return the builder to continue processing the DSL
      */
-    public T xquery(String text, Class resultType) {
+    public T xquery(String text, Class<?> resultType) {
         XQueryExpression expression = new XQueryExpression(text);
         expression.setResultType(resultType);
         setExpressionType(expression);
@@ -465,7 +465,7 @@
      * @param namespaces the namespace prefix and URIs to use
      * @return the builder to continue processing the DSL
      */
-    public T xquery(String text, Class resultType, Namespaces namespaces) {
+    public T xquery(String text, Class<?> resultType, Namespaces namespaces) {
         return xquery(text, resultType, namespaces.getNamespaces());
     }
 
@@ -479,7 +479,7 @@
      * @param namespaces the namespace prefix and URIs to use
      * @return the builder to continue processing the DSL
      */
-    public T xquery(String text, Class resultType, Map<String, String> namespaces)
{
+    public T xquery(String text, Class<?> resultType, Map<String, String> namespaces)
{
         XQueryExpression expression = new XQueryExpression(text);
         expression.setResultType(resultType);
         expression.setNamespaces(namespaces);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java Thu Nov
12 07:15:04 2009
@@ -190,7 +190,7 @@
      * @param exception exception to catch
      * @return the builder
      */
-    public OnExceptionDefinition onException(Class exception) {
+    public OnExceptionDefinition onException(Class<?> exception) {
         routeCollection.setCamelContext(getContext());
         return routeCollection.onException(exception);
     }
@@ -202,9 +202,9 @@
      * @param exceptions list of exceptions to catch
      * @return the builder
      */
-    public OnExceptionDefinition onException(Class... exceptions) {
+    public OnExceptionDefinition onException(Class<?>... exceptions) {
         OnExceptionDefinition last = null;
-        for (Class ex : exceptions) {
+        for (Class<?> ex : exceptions) {
             last = last == null ? onException(ex) : last.onException(ex);
         }
         return last != null ? last : onException(Exception.class);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ValueBuilder.java Thu Nov
12 07:15:04 2009
@@ -86,7 +86,7 @@
         return onNewPredicate(PredicateBuilder.isGreaterThanOrEqualTo(expression, right));
     }
 
-    public Predicate isInstanceOf(Class type) {
+    public Predicate isInstanceOf(Class<?> type) {
         return onNewPredicate(PredicateBuilder.isInstanceOf(expression, type));
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/AmbiguousMethodCallException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/AmbiguousMethodCallException.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/AmbiguousMethodCallException.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/AmbiguousMethodCallException.java
Thu Nov 12 07:15:04 2009
@@ -28,6 +28,8 @@
  * @version $Revision$
  */
 public class AmbiguousMethodCallException extends CamelExchangeException {
+    private static final long serialVersionUID = -8867010485101806951L;
+
     private final Collection<MethodInfo> methods;
 
     public AmbiguousMethodCallException(Exchange exchange, Collection<MethodInfo> methods)
{

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java Thu
Nov 12 07:15:04 2009
@@ -43,6 +43,7 @@
 import org.apache.camel.builder.ExpressionBuilder;
 import org.apache.camel.language.LanguageAnnotation;
 import org.apache.camel.spi.Registry;
+import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.logging.Log;
@@ -60,7 +61,7 @@
     private static final transient Log LOG = LogFactory.getLog(BeanInfo.class);
     private static final List<Method> EXCLUDED_METHODS = new ArrayList<Method>();
     private final CamelContext camelContext;
-    private final Class type;
+    private final Class<?> type;
     private final ParameterMappingStrategy strategy;
     private final Map<String, List<MethodInfo>> operations = new ConcurrentHashMap<String,
List<MethodInfo>>();
     private final List<MethodInfo> operationsWithBody = new ArrayList<MethodInfo>();
@@ -70,11 +71,11 @@
     private MethodInfo defaultMethod;
     private BeanInfo superBeanInfo;
 
-    public BeanInfo(CamelContext camelContext, Class type) {
+    public BeanInfo(CamelContext camelContext, Class<?> type) {
         this(camelContext, type, createParameterMappingStrategy(camelContext));
     }
 
-    public BeanInfo(CamelContext camelContext, Class type, ParameterMappingStrategy strategy)
{
+    public BeanInfo(CamelContext camelContext, Class<?> type, ParameterMappingStrategy
strategy) {
         this.camelContext = camelContext;
         this.type = type;
         this.strategy = strategy;
@@ -101,7 +102,7 @@
         }
     }
 
-    public Class getType() {
+    public Class<?> getType() {
         return type;
     }
 
@@ -177,7 +178,7 @@
      *
      * @param clazz the class
      */
-    protected void introspect(Class clazz) {
+    protected void introspect(Class<?> clazz) {
         if (LOG.isTraceEnabled()) {
             LOG.trace("Introspecting class: " + clazz);
         }
@@ -187,7 +188,7 @@
                 introspect(clazz, method);
             }
         }
-        Class superclass = clazz.getSuperclass();
+        Class<?> superclass = clazz.getSuperclass();
         if (superclass != null && !superclass.equals(Object.class)) {
             introspect(superclass);
         }
@@ -200,7 +201,7 @@
      * @param method the method
      * @return the method info, is newer <tt>null</tt>
      */
-    protected MethodInfo introspect(Class clazz, Method method) {
+    protected MethodInfo introspect(Class<?> clazz, Method method) {
         if (LOG.isTraceEnabled()) {
             LOG.trace("Introspecting class: " + clazz + ", method: " + method);
         }
@@ -261,7 +262,7 @@
         if (answer == null) {
             // maybe the method is defined on a base class?
             if (superBeanInfo == null && type != Object.class) {
-                Class superclass = type.getSuperclass();
+                Class<?> superclass = type.getSuperclass();
                 if (superclass != null && superclass != Object.class) {
                     superBeanInfo = new BeanInfo(camelContext, superclass, strategy);
                     return superBeanInfo.getMethodInfo(method);
@@ -511,7 +512,7 @@
      * @param method  the method
      * @return true if valid, false to skip the method
      */
-    protected boolean isValidMethod(Class clazz, Method method) {
+    protected boolean isValidMethod(Class<?> clazz, Method method) {
         // must not be in the excluded list
         for (Method excluded : EXCLUDED_METHODS) {
             if (ObjectHelper.isOverridingMethod(excluded, method)) {
@@ -580,8 +581,8 @@
      * insufficient annotations or not fitting with the default type
      * conventions.
      */
-    private Expression createParameterUnmarshalExpression(Class clazz, Method method, Class
parameterType,
-                                                          Annotation[] parameterAnnotation)
{
+    private Expression createParameterUnmarshalExpression(Class<?> clazz, Method method,

+            Class<?> parameterType, Annotation[] parameterAnnotation) {
 
         // look for a parameter annotation that converts into an expression
         for (Annotation annotation : parameterAnnotation) {
@@ -594,8 +595,9 @@
         return strategy.getDefaultParameterTypeExpression(parameterType);
     }
 
-    private Expression createParameterUnmarshalExpressionForAnnotation(Class clazz, Method
method, Class parameterType,
-                                                                       Annotation annotation)
{
+    private Expression createParameterUnmarshalExpressionForAnnotation(Class<?> clazz,
Method method, 
+            Class<?> parameterType, Annotation annotation) {
+
         if (annotation instanceof Property) {
             Property propertyAnnotation = (Property)annotation;
             return ExpressionBuilder.propertyExpression(propertyAnnotation.value());
@@ -609,7 +611,7 @@
         } else if (annotation instanceof OutHeaders) {
             return ExpressionBuilder.outHeadersExpression();
         } else if (annotation instanceof ExchangeException) {
-            return ExpressionBuilder.exchangeExceptionExpression(parameterType);
+            return ExpressionBuilder.exchangeExceptionExpression(CastUtils.cast(parameterType,
Exception.class));
         } else {
             LanguageAnnotation languageAnnotation = annotation.annotationType().getAnnotation(LanguageAnnotation.class);
             if (languageAnnotation != null) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/DefaultParameterMappingStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/DefaultParameterMappingStrategy.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/DefaultParameterMappingStrategy.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/DefaultParameterMappingStrategy.java
Thu Nov 12 07:15:04 2009
@@ -33,20 +33,20 @@
  * @version $Revision$
  */
 public class DefaultParameterMappingStrategy implements ParameterMappingStrategy {
-    private final Map<Class, Expression> parameterTypeToExpressionMap = new ConcurrentHashMap<Class,
Expression>();
+    private final Map<Class<?>, Expression> parameterTypeToExpressionMap = new
ConcurrentHashMap<Class<?>, Expression>();
 
     public DefaultParameterMappingStrategy() {
         loadDefaultRegistry();
     }
 
-    public Expression getDefaultParameterTypeExpression(Class parameterType) {
+    public Expression getDefaultParameterTypeExpression(Class<?> parameterType) {
         return parameterTypeToExpressionMap.get(parameterType);
     }
 
     /**
      * Adds a default parameter type mapping to an expression
      */
-    public void addParameterMapping(Class parameterType, Expression expression) {
+    public void addParameterMapping(Class<?> parameterType, Expression expression)
{
         parameterTypeToExpressionMap.put(parameterType, expression);
     }
 
@@ -58,5 +58,4 @@
         addParameterMapping(Registry.class, ExpressionBuilder.registryExpression());
         addParameterMapping(CamelContext.class, ExpressionBuilder.camelContextExpression());
     }
-
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodBean.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodBean.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodBean.java Thu
Nov 12 07:15:04 2009
@@ -25,6 +25,8 @@
  * @version $Revision$
  */
 public class MethodBean implements Serializable {
+    private static final long serialVersionUID = -789408217201706532L;
+
     private String name;
     private Class<?> type;
     private Class<?>[] parameterTypes;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java Thu
Nov 12 07:15:04 2009
@@ -47,7 +47,7 @@
     private static final transient Log LOG = LogFactory.getLog(MethodInfo.class);
 
     private CamelContext camelContext;
-    private Class type;
+    private Class<?> type;
     private Method method;
     private final List<ParameterInfo> parameters;
     private final List<ParameterInfo> bodyParameters;
@@ -57,7 +57,7 @@
     private ExchangePattern pattern = ExchangePattern.InOut;
     private RecipientList recipientList;
 
-    public MethodInfo(CamelContext camelContext, Class type, Method method, List<ParameterInfo>
parameters, List<ParameterInfo> bodyParameters,
+    public MethodInfo(CamelContext camelContext, Class<?> type, Method method, List<ParameterInfo>
parameters, List<ParameterInfo> bodyParameters,
                       boolean hasCustomAnnotation, boolean hasHandlerAnnotation) {
         this.camelContext = camelContext;
         this.type = type;
@@ -129,7 +129,7 @@
         };
     }
 
-    public Class getType() {
+    public Class<?> getType() {
         return type;
     }
 
@@ -156,7 +156,7 @@
         return bodyParameters;
     }
 
-    public Class getBodyParameterType() {
+    public Class<?> getBodyParameterType() {
         if (bodyParameters.isEmpty()) {
             return null;
         }
@@ -164,8 +164,8 @@
         return parameterInfo.getType();
     }
 
-    public boolean bodyParameterMatches(Class bodyType) {
-        Class actualType = getBodyParameterType();
+    public boolean bodyParameterMatches(Class<?> bodyType) {
+        Class<?> actualType = getBodyParameterType();
         return actualType != null && ObjectHelper.isAssignableFrom(bodyType, actualType);
     }
 
@@ -271,8 +271,8 @@
             // lets create the search order of types to scan
             List<Class<?>> typesToSearch = new ArrayList<Class<?>>();
             addTypeAndSuperTypes(type, typesToSearch);
-            Class[] interfaces = type.getInterfaces();
-            for (Class anInterface : interfaces) {
+            Class<?>[] interfaces = type.getInterfaces();
+            for (Class<?> anInterface : interfaces) {
                 addTypeAndSuperTypes(anInterface, typesToSearch);
             }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfoCache.java
Thu Nov 12 07:15:04 2009
@@ -20,6 +20,7 @@
 import java.util.Map;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.LRUCache;
 
 /**
@@ -31,7 +32,7 @@
 public class MethodInfoCache {
     private final CamelContext camelContext;
     private Map<Method, MethodInfo> methodCache;
-    private Map<Class, BeanInfo> classCache;
+    private Map<Class<?>, BeanInfo> classCache;
 
     public MethodInfoCache(CamelContext camelContext) {
         this(camelContext, 1000, 10000);
@@ -39,10 +40,10 @@
 
     @SuppressWarnings("unchecked")
     public MethodInfoCache(CamelContext camelContext, int classCacheSize, int methodCacheSize)
{
-        this(camelContext, createLruCache(classCacheSize), createLruCache(methodCacheSize));
+        this(camelContext, createClassCache(classCacheSize), createMethodCache(methodCacheSize));
     }
 
-    public MethodInfoCache(CamelContext camelContext, Map<Class, BeanInfo> classCache,
Map<Method, MethodInfo> methodCache) {
+    public MethodInfoCache(CamelContext camelContext, Map<Class<?>, BeanInfo>
classCache, Map<Method, MethodInfo> methodCache) {
         this.camelContext = camelContext;
         this.classCache = classCache;
         this.methodCache = methodCache;
@@ -76,7 +77,15 @@
         return new BeanInfo(camelContext, declaringClass);
     }
 
-    protected static Map createLruCache(int size) {
-        return new LRUCache(size);
+    protected static Map<Object, Object> createLruCache(int size) {
+        return new LRUCache<Object, Object>(size);
+    }
+
+    private static Map<Class<?>, BeanInfo> createClassCache(int size) {
+        return CastUtils.cast(createLruCache(size));
+    }
+
+    private static Map<Method, MethodInfo> createMethodCache(int size) {
+        return CastUtils.cast(createLruCache(size));
     }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodNotFoundException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodNotFoundException.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodNotFoundException.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/MethodNotFoundException.java
Thu Nov 12 07:15:04 2009
@@ -23,6 +23,7 @@
  * @version $Revision$
  */
 public class MethodNotFoundException extends CamelExchangeException {
+    private static final long serialVersionUID = -7411465307141051012L;
 
     private final String methodName;
     private final Object bean;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterInfo.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterInfo.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterInfo.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterInfo.java
Thu Nov 12 07:15:04 2009
@@ -28,11 +28,11 @@
  */
 public class ParameterInfo {
     private final int index;
-    private final Class type;
+    private final Class<?> type;
     private final Annotation[] annotations;
     private Expression expression;
 
-    public ParameterInfo(int index, Class type, Annotation[] annotations, Expression expression)
{
+    public ParameterInfo(int index, Class<?> type, Annotation[] annotations, Expression
expression) {
         this.index = index;
         this.type = type;
         this.annotations = annotations;
@@ -51,7 +51,7 @@
         return index;
     }
 
-    public Class getType() {
+    public Class<?> getType() {
         return type;
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterMappingStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterMappingStrategy.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterMappingStrategy.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/ParameterMappingStrategy.java
Thu Nov 12 07:15:04 2009
@@ -32,5 +32,5 @@
      * @param parameterType the parameter type
      * @return the expression to evaluate as value
      */
-    Expression getDefaultParameterTypeExpression(Class parameterType);
+    Expression getDefaultParameterTypeExpression(Class<?> parameterType);
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/RegistryBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/RegistryBean.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/RegistryBean.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/RegistryBean.java
Thu Nov 12 07:15:04 2009
@@ -67,7 +67,7 @@
             // could be a class then create an instance of it
             if (bean instanceof Class) {
                 // bean is a class so create an instance of it
-                bean = context.getInjector().newInstance((Class<Object>) bean);
+                bean = context.getInjector().newInstance((Class<?>)bean);
                 value = bean;
             }
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/XPathAnnotationExpressionFactory.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/XPathAnnotationExpressionFactory.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/XPathAnnotationExpressionFactory.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/XPathAnnotationExpressionFactory.java
Thu Nov 12 07:15:04 2009
@@ -34,7 +34,7 @@
 public class XPathAnnotationExpressionFactory extends DefaultAnnotationExpressionFactory
{
 
     @Override
-    public Expression createExpression(CamelContext camelContext, Annotation annotation,
LanguageAnnotation languageAnnotation, Class expressionReturnType) {
+    public Expression createExpression(CamelContext camelContext, Annotation annotation,
LanguageAnnotation languageAnnotation, Class<?> expressionReturnType) {
         String xpath = getExpressionFromAnnotation(annotation);
         XPathBuilder builder = XPathBuilder.xpath(xpath, getResultType(annotation));
         NamespacePrefix[] namespaces = getExpressionNameSpacePrefix(annotation);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/CastUtils.java Thu Nov 12 07:15:04
2009
@@ -89,6 +89,13 @@
         return (Enumeration<T>)p;
     }
 
+    public static <T> Class<T> cast(Class<?> p) {
+        return (Class<T>)p;
+    }
+    public static <T> Class<T> cast(Class<?> p, Class<T> cls) {
+        return (Class<T>)p;
+    }
+
     public static <T> Future<T> cast(Future<?> p) {
         return (Future<T>)p;
     }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanRegistryBeanTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanRegistryBeanTest.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanRegistryBeanTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanRegistryBeanTest.java
Thu Nov 12 07:15:04 2009
@@ -58,7 +58,7 @@
     public void testParameterMappingStrategy() {
         RegistryBean rb = new RegistryBean(context, "foo");
         ParameterMappingStrategy myStrategy = new ParameterMappingStrategy() {
-            public Expression getDefaultParameterTypeExpression(Class parameterType) {
+            public Expression getDefaultParameterTypeExpression(Class<?> parameterType)
{
                 return null;
             }
         };

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/CustomParameterMappingStrategyTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/CustomParameterMappingStrategyTest.java?rev=835276&r1=835275&r2=835276&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/CustomParameterMappingStrategyTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/CustomParameterMappingStrategyTest.java
Thu Nov 12 07:15:04 2009
@@ -60,7 +60,7 @@
 
     public static class MyCustomStrategy implements ParameterMappingStrategy {
 
-        public Expression getDefaultParameterTypeExpression(Class parameterType) {
+        public Expression getDefaultParameterTypeExpression(Class<?> parameterType)
{
             if (String.class.isAssignableFrom(parameterType)) {
                 return new ExpressionAdapter() {
                     @Override
@@ -72,5 +72,4 @@
             return null;
         }
     }
-
 }
\ No newline at end of file



Mime
View raw message