camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r836037 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/builder/xml/ camel-core/src/main/java/org/apache/camel/model/ camel-core/src/main/java/org/apache/camel/processor/ camel-core/src/main/java/org/apache/camel/processor/exce...
Date Fri, 13 Nov 2009 22:38:38 GMT
Author: hadrian
Date: Fri Nov 13 22:38:37 2009
New Revision: 836037

URL: http://svn.apache.org/viewvc?rev=836037&view=rev
Log:
More cleanup

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/InvalidXPathExpression.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CatchProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelegateProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ErrorHandlerSupport.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SendAsyncProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Splitter.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/exceptionpolicy/ExceptionPolicyKey.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java
    camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CatchDefinitionRenderer.java
    camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/OnExceptionDefinitionRenderer.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java
Fri Nov 13 22:38:37 2009
@@ -69,8 +69,8 @@
     }
 
     public String getPrefix(String namespaceURI) {
-        for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
-            Map.Entry entry = (Map.Entry) iter.next();
+        for (Iterator<Map.Entry<String, String>> iter = map.entrySet().iterator();
iter.hasNext();) {
+            Map.Entry<String, String> entry = iter.next();
             if (namespaceURI.equals(entry.getValue())) {
                 return (String) entry.getKey();
             }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/InvalidXPathExpression.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/InvalidXPathExpression.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/InvalidXPathExpression.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/InvalidXPathExpression.java
Fri Nov 13 22:38:37 2009
@@ -26,6 +26,8 @@
  * @version $Revision$
  */
 public class InvalidXPathExpression extends RuntimeExpressionException {
+    private static final long serialVersionUID = 9171451033826915273L;
+
     private final String xpath;
 
     public InvalidXPathExpression(String xpath, XPathException e) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java Fri
Nov 13 22:38:37 2009
@@ -106,7 +106,7 @@
         return new XPathBuilder(text);
     }
 
-    public static XPathBuilder xpath(String text, Class resultType) {
+    public static XPathBuilder xpath(String text, Class<?> resultType) {
         XPathBuilder builder = new XPathBuilder(text);
         builder.setResultType(resultType);
         return builder;
@@ -259,7 +259,7 @@
      * @param documentType the document type
      * @return the current builder
      */
-    public XPathBuilder documentType(Class documentType) {
+    public XPathBuilder documentType(Class<?> documentType) {
         setDocumentType(documentType);
         return this;
     }
@@ -280,11 +280,11 @@
         this.xpathFactory = xpathFactory;
     }
 
-    public Class getDocumentType() {
+    public Class<?> getDocumentType() {
         return documentType;
     }
 
-    public void setDocumentType(Class documentType) {
+    public void setDocumentType(Class<?> documentType) {
         this.documentType = documentType;
     }
 
@@ -332,6 +332,7 @@
     public XPathFunction getBodyFunction() {
         if (bodyFunction == null) {
             bodyFunction = new XPathFunction() {
+                @SuppressWarnings("unchecked")
                 public Object evaluate(List list) throws XPathFunctionException {
                     if (exchange == null) {
                         return null;
@@ -350,6 +351,7 @@
     public XPathFunction getHeaderFunction() {
         if (headerFunction == null) {
             headerFunction = new XPathFunction() {
+                @SuppressWarnings("unchecked")
                 public Object evaluate(List list) throws XPathFunctionException {
                     if (exchange != null && !list.isEmpty()) {
                         Object value = list.get(0);
@@ -371,6 +373,7 @@
     public XPathFunction getOutBodyFunction() {
         if (outBodyFunction == null) {
             outBodyFunction = new XPathFunction() {
+                @SuppressWarnings("unchecked")
                 public Object evaluate(List list) throws XPathFunctionException {
                     if (exchange.get() != null && exchange.get().hasOut()) {
                         return exchange.get().getOut().getBody();
@@ -389,6 +392,7 @@
     public XPathFunction getOutHeaderFunction() {
         if (outHeaderFunction == null) {
             outHeaderFunction = new XPathFunction() {
+                @SuppressWarnings("unchecked")
                 public Object evaluate(List list) throws XPathFunctionException {
                     if (exchange.get() != null && !list.isEmpty()) {
                         Object value = list.get(0);
@@ -407,11 +411,11 @@
         this.outHeaderFunction = outHeaderFunction;
     }
 
-    public Class getResultType() {
+    public Class<?> getResultType() {
         return resultType;
     }
 
-    public void setResultType(Class resultType) {
+    public void setResultType(Class<?> resultType) {
         this.resultType = resultType;
         if (Number.class.isAssignableFrom(resultType)) {
             numberResult();

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/CatchDefinition.java Fri Nov
13 22:38:37 2009
@@ -33,6 +33,7 @@
 import org.apache.camel.builder.ExpressionClause;
 import org.apache.camel.processor.CatchProcessor;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import static org.apache.camel.builder.PredicateBuilder.toPredicate;
 
@@ -53,19 +54,19 @@
     @XmlElementRef
     private List<ProcessorDefinition> outputs = new ArrayList<ProcessorDefinition>();
     @XmlTransient
-    private List<Class> exceptionClasses;
+    private List<Class<Exception>> exceptionClasses;
     @XmlTransient
     private Predicate handledPolicy;
 
     public CatchDefinition() {
     }
 
-    public CatchDefinition(List<Class> exceptionClasses) {
+    public CatchDefinition(List<Class<Exception>> exceptionClasses) {
         this.exceptionClasses = exceptionClasses;
     }
 
-    public CatchDefinition(Class exceptionType) {
-        exceptionClasses = new ArrayList<Class>();
+    public CatchDefinition(Class<Exception> exceptionType) {
+        exceptionClasses = new ArrayList<Class<Exception>>();
         exceptionClasses.add(exceptionType);
     }
 
@@ -109,14 +110,14 @@
         this.outputs = outputs;
     }
 
-    public List<Class> getExceptionClasses() {
+    public List<Class<Exception>> getExceptionClasses() {
         if (exceptionClasses == null) {
             exceptionClasses = createExceptionClasses();
         }
         return exceptionClasses;
     }
 
-    public void setExceptionClasses(List<Class> exceptionClasses) {
+    public void setExceptionClasses(List<Class<Exception>> exceptionClasses)
{
         this.exceptionClasses = exceptionClasses;
     }
     
@@ -128,7 +129,7 @@
      * @param exceptionClasses  a list of the exception classes
      * @return the builder
      */
-    public CatchDefinition exceptionClasses(List<Class> exceptionClasses) {
+    public CatchDefinition exceptionClasses(List<Class<Exception>> exceptionClasses)
{
         setExceptionClasses(exceptionClasses);
         return this;
     }
@@ -202,8 +203,8 @@
      * @param exception  the exception of class
      * @return the builder
      */
-    public CatchDefinition exceptionClasses(Class exception) {
-        List<Class> list = getExceptionClasses();
+    public CatchDefinition exceptionClasses(Class<Exception> exception) {
+        List<Class<Exception>> list = getExceptionClasses();
         list.add(exception);
         return this;
     }
@@ -240,11 +241,11 @@
         this.handled = handled;
     }
 
-    protected List<Class> createExceptionClasses() {
+    protected List<Class<Exception>> createExceptionClasses() {
         List<String> list = getExceptions();
-        List<Class> answer = new ArrayList<Class>(list.size());
+        List<Class<Exception>> answer = new ArrayList<Class<Exception>>(list.size());
         for (String name : list) {
-            Class type = ObjectHelper.loadClass(name, getClass().getClassLoader());
+            Class<Exception> type = CastUtils.cast(ObjectHelper.loadClass(name, getClass().getClassLoader()));
             answer.add(type);
         }
         return answer;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java
Fri Nov 13 22:38:37 2009
@@ -40,6 +40,7 @@
 import org.apache.camel.processor.CatchProcessor;
 import org.apache.camel.processor.RedeliveryPolicy;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 
 import static org.apache.camel.builder.PredicateBuilder.toPredicate;
@@ -70,7 +71,7 @@
     @XmlElementRef
     private List<ProcessorDefinition> outputs = new ArrayList<ProcessorDefinition>();
     @XmlTransient
-    private List<Class> exceptionClasses;
+    private List<Class<Exception>> exceptionClasses;
     @XmlTransient
     private Processor errorHandler;
     @XmlTransient
@@ -83,12 +84,12 @@
     public OnExceptionDefinition() {
     }
 
-    public OnExceptionDefinition(List<Class> exceptionClasses) {
-        this.exceptionClasses = exceptionClasses;
+    public OnExceptionDefinition(List<Class<? extends Exception>> exceptionClasses)
{
+        this.exceptionClasses = CastUtils.cast(exceptionClasses);
     }
 
     public OnExceptionDefinition(Class exceptionType) {
-        exceptionClasses = new ArrayList<Class>();
+        exceptionClasses = new ArrayList<Class<Exception>>();
         exceptionClasses.add(exceptionType);
     }
 
@@ -411,14 +412,14 @@
         this.outputs = outputs;
     }
 
-    public List<Class> getExceptionClasses() {
+    public List<Class<Exception>> getExceptionClasses() {
         if (exceptionClasses == null) {
             exceptionClasses = createExceptionClasses();
         }
         return exceptionClasses;
     }
 
-    public void setExceptionClasses(List<Class> exceptionClasses) {
+    public void setExceptionClasses(List<Class<Exception>> exceptionClasses)
{
         this.exceptionClasses = exceptionClasses;
     }
 
@@ -515,11 +516,11 @@
         return redeliveryPolicy;
     }
 
-    protected List<Class> createExceptionClasses() {
+    protected List<Class<Exception>> createExceptionClasses() {
         List<String> list = getExceptions();
-        List<Class> answer = new ArrayList<Class>(list.size());
+        List<Class<Exception>> answer = new ArrayList<Class<Exception>>(list.size());
         for (String name : list) {
-            Class type = ObjectHelper.loadClass(name, getClass().getClassLoader());
+            Class<Exception> type = CastUtils.cast(ObjectHelper.loadClass(name, getClass().getClassLoader()),
Exception.class);
             answer.add(type);
         }
         return answer;
@@ -537,5 +538,4 @@
             retryUntil(getRetryUntil().createPredicate(routeContext));
         }
     }
-
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/TryDefinition.java Fri Nov
13 22:38:37 2009
@@ -34,6 +34,8 @@
 import org.apache.camel.processor.CatchProcessor;
 import org.apache.camel.processor.TryProcessor;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.util.CastUtils;
+
 import static org.apache.camel.builder.PredicateBuilder.toPredicate;
 
 /**
@@ -91,9 +93,9 @@
      * @param exceptionType  the exception(s)
      * @return the try builder
      */
-    public TryDefinition doCatch(Class... exceptionType) {
+    public TryDefinition doCatch(Class<? extends Exception>... exceptionType) {
         popBlock();
-        List<Class> list = Arrays.asList(exceptionType);
+        List<Class<Exception>> list = CastUtils.cast(Arrays.asList(exceptionType));
         CatchDefinition answer = new CatchDefinition(list);
         addOutput(answer);
         pushBlock(answer);
@@ -259,5 +261,4 @@
             }
         }
     }
-
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CatchProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CatchProcessor.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CatchProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/CatchProcessor.java Fri
Nov 13 22:38:37 2009
@@ -30,11 +30,11 @@
  * @version $Revision$
  */
 public class CatchProcessor extends DelegateProcessor implements Traceable {
-    private final List<Class> exceptions;
+    private final List<Class<Exception>> exceptions;
     private final Predicate onWhen;
     private final Predicate handled;
 
-    public CatchProcessor(List<Class> exceptions, Processor processor, Predicate onWhen,
Predicate handled) {
+    public CatchProcessor(List<Class<Exception>> exceptions, Processor processor,
Predicate onWhen, Predicate handled) {
         super(processor);
         this.exceptions = exceptions;
         this.onWhen = onWhen;
@@ -94,7 +94,7 @@
         return handled.matches(exchange);
     }
 
-    public List<Class> getExceptions() {
+    public List<Class<Exception>> getExceptions() {
         return exceptions;
     }
 
@@ -117,5 +117,4 @@
         }
         return onWhen.matches(exchange);
     }
-
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ConvertBodyProcessor.java
Fri Nov 13 22:38:37 2009
@@ -28,15 +28,15 @@
  * @version $Revision$
  */
 public class ConvertBodyProcessor implements Processor {
-    private final Class type;
+    private final Class<?> type;
     private final String charset;
 
-    public ConvertBodyProcessor(Class type) {
+    public ConvertBodyProcessor(Class<?> type) {
         this.type = type;
         this.charset = null;
     }
 
-    public ConvertBodyProcessor(Class type, String charset) {
+    public ConvertBodyProcessor(Class<?> type, String charset) {
         this.type = type;
         this.charset = charset;
     }
@@ -63,7 +63,7 @@
         }
     }
 
-    public Class getType() {
+    public Class<?> getType() {
         return type;
     }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelegateProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelegateProcessor.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelegateProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DelegateProcessor.java
Fri Nov 13 22:38:37 2009
@@ -31,7 +31,7 @@
  * 
  * @version $Revision$
  */
-public class DelegateProcessor extends ServiceSupport implements Processor, Navigate {
+public class DelegateProcessor extends ServiceSupport implements Processor, Navigate<Processor>
{
     protected Processor processor;
 
     public DelegateProcessor() {
@@ -94,5 +94,4 @@
         answer.add(processor);
         return answer;
     }
-
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ErrorHandlerSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ErrorHandlerSupport.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ErrorHandlerSupport.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ErrorHandlerSupport.java
Fri Nov 13 22:38:37 2009
@@ -46,9 +46,9 @@
         Processor processor = exceptionType.getErrorHandler();
         addChildService(processor);
 
-        List<Class> list = exceptionType.getExceptionClasses();
+        List<Class<Exception>> list = exceptionType.getExceptionClasses();
 
-        for (Class clazz : list) {
+        for (Class<Exception> clazz : list) {
             ExceptionPolicyKey key = new ExceptionPolicyKey(clazz, exceptionType.getOnWhen());
             exceptionPolicies.put(key, exceptionType);
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
Fri Nov 13 22:38:37 2009
@@ -53,7 +53,7 @@
  * @see Pipeline
  * @version $Revision$
  */
-public class MulticastProcessor extends ServiceSupport implements Processor, Navigate, Traceable
{
+public class MulticastProcessor extends ServiceSupport implements Processor, Navigate<Processor>,
Traceable {
 
     private static final int DEFAULT_THREADPOOL_SIZE = 10;
     private static final transient Log LOG = LogFactory.getLog(MulticastProcessor.class);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RecipientList.java Fri
Nov 13 22:38:37 2009
@@ -75,7 +75,7 @@
      * Sends the given exchange to the recipient list
      */
     public void sendToRecipientList(Exchange exchange, Object receipientList) throws Exception
{
-        Iterator iter = ObjectHelper.createIterator(receipientList, delimiter);
+        Iterator<Object> iter = ObjectHelper.createIterator(receipientList, delimiter);
         List<Processor> processors = new ArrayList<Processor>();
         while (iter.hasNext()) {
             Object recipient = iter.next();

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java
Fri Nov 13 22:38:37 2009
@@ -71,8 +71,9 @@
  * @version $Revision$
  */
 public class RedeliveryPolicy implements Cloneable, Serializable {
-    protected static transient Random randomNumberGenerator;
+    private static final long serialVersionUID = -338222777701473252L;
     private static final transient Log LOG = LogFactory.getLog(RedeliveryPolicy.class);
+    protected static transient Random randomNumberGenerator;
 
     protected long redeliverDelay = 1000L;
     protected int maximumRedeliveries;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SendAsyncProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SendAsyncProcessor.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SendAsyncProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SendAsyncProcessor.java
Fri Nov 13 22:38:37 2009
@@ -40,7 +40,7 @@
 /**
  * @version $Revision$
  */
-public class SendAsyncProcessor extends SendProcessor implements Runnable, Navigate {
+public class SendAsyncProcessor extends SendProcessor implements Runnable, Navigate<Processor>
{
 
     private static final int DEFAULT_THREADPOOL_SIZE = 10;
     protected final Processor target;

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java Fri
Nov 13 22:38:37 2009
@@ -24,6 +24,7 @@
 import org.apache.camel.Expression;
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
+import org.apache.camel.util.CastUtils;
 
 /**
  * A processor that sorts the expression using a comparator
@@ -31,18 +32,17 @@
 public class SortProcessor implements Processor {
 
     private final Expression expression;
-    private final Comparator comparator;
+    private final Comparator<Object> comparator;
 
-    public SortProcessor(Expression expression, Comparator comparator) {
+    public SortProcessor(Expression expression, Comparator<Object> comparator) {
         this.expression = expression;
         this.comparator = comparator;
     }
 
-    @SuppressWarnings("unchecked")
     public void process(Exchange exchange) throws Exception {
         Message in = exchange.getIn();
 
-        List list = expression.evaluate(exchange, List.class);
+        List<Object> list = CastUtils.cast(expression.evaluate(exchange, List.class));
         Collections.sort(list, comparator);
 
         if (exchange.getPattern().isOutCapable()) {
@@ -57,7 +57,6 @@
     public String toString() {
         return "Sort[" + expression + "]";
     }
-
 }
 
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Splitter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Splitter.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Splitter.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Splitter.java Fri Nov
13 22:38:37 2009
@@ -119,7 +119,7 @@
         } else {
             result = new ArrayList<ProcessorExchangePair>();
         }
-        Iterator iter = ObjectHelper.createIterator(value);
+        Iterator<Object> iter = ObjectHelper.createIterator(value);
         while (iter.hasNext()) {
             Object part = iter.next();
             Exchange newExchange = exchange.copy();
@@ -139,7 +139,7 @@
         super.updateNewExchange(exchange, index, allPairs);
         exchange.setProperty(Exchange.SPLIT_INDEX, index);
         if (allPairs instanceof Collection) {
-            exchange.setProperty(Exchange.SPLIT_SIZE, ((Collection) allPairs).size());
+            exchange.setProperty(Exchange.SPLIT_SIZE, ((Collection<?>)allPairs).size());
         }
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/exceptionpolicy/ExceptionPolicyKey.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/exceptionpolicy/ExceptionPolicyKey.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/exceptionpolicy/ExceptionPolicyKey.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/exceptionpolicy/ExceptionPolicyKey.java
Fri Nov 13 22:38:37 2009
@@ -26,10 +26,10 @@
  */
 public final class ExceptionPolicyKey {
 
-    private final Class<?> exceptionClass;
+    private final Class<? extends Exception> exceptionClass;
     private final WhenDefinition when;
 
-    public ExceptionPolicyKey(Class<?> exceptionClass, WhenDefinition when) {
+    public ExceptionPolicyKey(Class<? extends Exception> exceptionClass, WhenDefinition
when) {
         this.exceptionClass = exceptionClass;
         this.when = when;
     }
@@ -42,11 +42,11 @@
         return when;
     }
 
-    public static ExceptionPolicyKey newInstance(Class<?> exceptionClass) {
+    public static ExceptionPolicyKey newInstance(Class<? extends Exception> exceptionClass)
{
         return new ExceptionPolicyKey(exceptionClass, null);
     }
 
-    public static ExceptionPolicyKey newInstance(Class<?> exceptionClass, WhenDefinition
when) {
+    public static ExceptionPolicyKey newInstance(Class<? extends Exception> exceptionClass,
WhenDefinition when) {
         return new ExceptionPolicyKey(exceptionClass, when);
     }
 

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java
(original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ErrorHandlerSupportTest.java
Fri Nov 13 22:38:37 2009
@@ -27,7 +27,7 @@
 public class ErrorHandlerSupportTest extends TestCase {
 
     public void testOnePolicyChildFirst() {
-        List<Class> exceptions = new ArrayList<Class>();
+        List<Class<? extends Exception>> exceptions = new ArrayList<Class<?
extends Exception>>();
         exceptions.add(ChildException.class);
         exceptions.add(ParentException.class);
 
@@ -39,7 +39,7 @@
     }
 
     public void testOnePolicyChildLast() {
-        List<Class> exceptions = new ArrayList<Class>();
+        List<Class<? extends Exception>> exceptions = new ArrayList<Class<?
extends Exception>>();
         exceptions.add(ParentException.class);
         exceptions.add(ChildException.class);
 

Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CatchDefinitionRenderer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CatchDefinitionRenderer.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CatchDefinitionRenderer.java
(original)
+++ camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CatchDefinitionRenderer.java
Fri Nov 13 22:38:37 2009
@@ -33,8 +33,8 @@
     public static void render(StringBuilder buffer, ProcessorDefinition processor) {
         CatchDefinition catchDef = (CatchDefinition)processor;
         buffer.append(".").append(catchDef.getShortName()).append("(");
-        List<Class> exceptions = catchDef.getExceptionClasses();
-        for (Class clazz : exceptions) {
+        List<Class<Exception>> exceptions = catchDef.getExceptionClasses();
+        for (Class<Exception> clazz : exceptions) {
             buffer.append(clazz.getSimpleName()).append(".class");
             if (clazz != exceptions.get(exceptions.size() - 1)) {
                 buffer.append(", ");

Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/OnExceptionDefinitionRenderer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/OnExceptionDefinitionRenderer.java?rev=836037&r1=836036&r2=836037&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/OnExceptionDefinitionRenderer.java
(original)
+++ camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/OnExceptionDefinitionRenderer.java
Fri Nov 13 22:38:37 2009
@@ -40,8 +40,8 @@
 
         OnExceptionDefinition onException = (OnExceptionDefinition)processor;
         buffer.append(processor.getShortName()).append("(");
-        List<Class> exceptions = onException.getExceptionClasses();
-        for (Class excep : exceptions) {
+        List<Class<Exception>> exceptions = onException.getExceptionClasses();
+        for (Class<Exception> excep : exceptions) {
             buffer.append(excep.getSimpleName()).append(".class");
             if (excep != exceptions.get(exceptions.size() - 1)) {
                 buffer.append(", ");



Mime
View raw message