camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1329110 - in /camel/branches/camel-2.9.x: ./ camel-core/src/main/java/org/apache/camel/Endpoint.java camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
Date Mon, 23 Apr 2012 08:05:03 GMT
Author: davsclaus
Date: Mon Apr 23 08:05:02 2012
New Revision: 1329110

URL: http://svn.apache.org/viewvc?rev=1329110&view=rev
Log:
CAMEL-5205: Removed legacy code in createExchange method that was only applicable in Camel
1.x

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Endpoint.java
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1329109

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Endpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Endpoint.java?rev=1329110&r1=1329109&r2=1329110&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Endpoint.java (original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/Endpoint.java Mon
Apr 23 08:05:02 2012
@@ -76,7 +76,7 @@ public interface Endpoint extends IsSing
     Exchange createExchange(ExchangePattern pattern);
 
     /**
-     * Creates a new exchange for communicating with this exchange using the
+     * Creates a new exchange for communicating with this endpoint using the
      * given exchange to pre-populate the values of the headers and messages
      *
      * @param exchange given exchange to use for pre-populate

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java?rev=1329110&r1=1329109&r2=1329110&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/impl/DefaultEndpoint.java
Mon Apr 23 08:05:02 2012
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.impl;
 
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
 import java.util.Map;
 
 import org.apache.camel.CamelContext;
@@ -207,34 +205,9 @@ public abstract class DefaultEndpoint ex
     }
 
     public Exchange createExchange(Exchange exchange) {
-        Class<Exchange> exchangeType = getExchangeType();
-        if (exchangeType != null) {
-            if (exchangeType.isInstance(exchange)) {
-                return exchangeType.cast(exchange);
-            }
-        }
         return exchange.copy();
     }
 
-    /**
-     * Returns the type of the exchange which is generated by this component
-     */
-    @SuppressWarnings("unchecked")
-    public Class<Exchange> getExchangeType() {
-        Type type = getClass().getGenericSuperclass();
-        if (type instanceof ParameterizedType) {
-            ParameterizedType parameterizedType = (ParameterizedType)type;
-            Type[] arguments = parameterizedType.getActualTypeArguments();
-            if (arguments.length > 0) {
-                Type argumentType = arguments[0];
-                if (argumentType instanceof Class) {
-                    return (Class<Exchange>)argumentType;
-                }
-            }
-        }
-        return null;
-    }
-
     public Exchange createExchange() {
         return createExchange(getExchangePattern());
     }



Mime
View raw message