camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r699766 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/component/log/ main/java/org/apache/camel/impl/converter/ main/java/org/apache/camel/language/simple/ main/java/org/apache/camel/processor/ main/java/org/apache/c...
Date Sun, 28 Sep 2008 03:18:13 GMT
Author: ningjiang
Date: Sat Sep 27 20:18:13 2008
New Revision: 699766

URL: http://svn.apache.org/viewvc?rev=699766&view=rev
Log:
Fixed the CS error in the camel-core

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/FileExpressionBuilder.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTestProcessor.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogFormatter.java
Sat Sep 27 20:18:13 2008
@@ -177,7 +177,7 @@
     // Implementation methods
     //-------------------------------------------------------------------------
     protected Object getBodyAsString(Message message) {
-    	StreamCache newBody = null;
+        StreamCache newBody = null;
         try {
             newBody = message.getBody(StreamCache.class);
             if (newBody != null) {
@@ -192,7 +192,7 @@
         } catch (NoTypeConversionAvailableException ex) {
             answer = message.getBody();
         }
-        
+
         if (newBody != null) {
             // Reset the StreamCache
             newBody.reset();

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/DefaultTypeConverter.java
Sat Sep 27 20:18:13 2008
@@ -67,7 +67,7 @@
 
     @SuppressWarnings("unchecked")
     public <T> T convertTo(Class<T> type, Exchange exchange, Object value) {
-    	if (LOG.isTraceEnabled()) {
+        if (LOG.isTraceEnabled()) {
             LOG.trace("Converting " + (value == null ? "null" : value.getClass().getCanonicalName())
                 + " -> " + type.getCanonicalName() + " with value: " + value);
         }
@@ -112,7 +112,7 @@
                 return (T) convertTo(primitiveType, exchange, value);
             }
         }
-       
+
         // Could not find suitable conversion
         throw new NoTypeConversionAvailableException(value, type);
     }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/FileExpressionBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/FileExpressionBuilder.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/FileExpressionBuilder.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/language/simple/FileExpressionBuilder.java
Sat Sep 27 20:18:13 2008
@@ -20,8 +20,8 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
-import org.apache.camel.Expression;
 import org.apache.camel.Exchange;
+import org.apache.camel.Expression;
 import org.apache.camel.builder.ExpressionBuilder;
 
 /**
@@ -146,7 +146,7 @@
                         return null;
                     }
                 }
-                // must call evalute to return the nested langauge evaluate when evaluating
+                // must call evaluate to return the nested language evaluate when evaluating
                 // stacked expressions
                 return ExpressionBuilder.dateExpression(command, pattern).evaluate(exchange);
             }
@@ -161,7 +161,7 @@
     public static <E extends Exchange> Expression<E> simpleExpression(final String
simple) {
         return new Expression<E>() {
             public Object evaluate(E exchange) {
-                // must call evalute to return the nested langauge evaluate when evaluating
+                // must call evaluate to return the nested language evaluate when evaluating
                 // stacked expressions
                 return SimpleLanguage.simple(simple).evaluate(exchange);
             }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/LoopProcessor.java
Sat Sep 27 20:18:13 2008
@@ -32,9 +32,9 @@
 public class LoopProcessor extends DelegateProcessor {
     public static final String PROP_ITER_COUNT = "CamelIterationCount";
     public static final String PROP_ITER_INDEX = "CamelIterationIndex";
-    
+
     private static final Log LOG = LogFactory.getLog(LoopProcessor.class);
-    
+
     private Expression<Exchange> expression;
 
     public LoopProcessor(Expression<Exchange> expression, Processor processor) {
@@ -49,8 +49,8 @@
         String text = ExchangeHelper.convertToType(exchange, String.class, expression.evaluate(exchange));
         Integer value = ExchangeHelper.convertToType(exchange, Integer.class, text);
         if (value == null) {
-        	// TODO: we should probably catch evaluate/convert exception an set is as fault
(after fix for CAMEL-316)
-        	throw new RuntimeCamelException("Expression \"" + expression + "\" does not evaluate
to an int.");
+            // TODO: we should probably catch evaluate/convert exception an set is as fault
(after fix for CAMEL-316)
+            throw new RuntimeCamelException("Expression \"" + expression + "\" does not evaluate
to an int.");
         }
         int count = value.intValue();
         exchange.setProperty(PROP_ITER_COUNT, count);

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
Sat Sep 27 20:18:13 2008
@@ -35,14 +35,14 @@
         super();
         setInterceptorLogic(new Processor() {
             public void process(Exchange exchange) throws Exception {
-            	try {
+                try {
                     StreamCache newBody = exchange.getIn().getBody(StreamCache.class);
                     if (newBody != null) {
                         newBody.reset();
                         exchange.getIn().setBody(newBody);
                     }
-            	} catch (NoTypeConversionAvailableException ex) {
-            	    // ignore if in is not of StreamCache type
+                } catch (NoTypeConversionAvailableException ex) {
+                    // ignore if in is not of StreamCache type
                 }
                 proceed(exchange);
             }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java
Sat Sep 27 20:18:13 2008
@@ -90,7 +90,7 @@
 
     public static <T> T getMandatoryProperty(Exchange exchange, String propertyName,
Class<T> type)
         throws NoSuchPropertyException {
-    	try {
+        try {
             T result = exchange.getProperty(propertyName, type);
             if (result != null) {
                 return result;

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/IntrospectionSupport.java
Sat Sep 27 20:18:13 2008
@@ -207,8 +207,8 @@
                     } catch (IllegalArgumentException e) {
                         typeConvertionFailed = e;
                     }
-                    LOG.trace("Setter \"" + setter + "\" with parameter type \"" + 
-                            setter.getParameterTypes()[0] + "\" could not be used for type
conertions of " + value);
+                    LOG.trace("Setter \"" + setter + "\" with parameter type \""
+                              + setter.getParameterTypes()[0] + "\" could not be used for
type conertions of " + value);
                 }
             }
             // we did not find a setter method to use, and if we did try to use a type converter
then throw

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/language/FileLanguageTest.java
Sat Sep 27 20:18:13 2008
@@ -25,9 +25,8 @@
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.LanguageTestSupport;
-import org.apache.camel.converter.IOConverter;
-import org.apache.camel.component.file.FileExchange;
 import org.apache.camel.component.file.FileComponent;
+import org.apache.camel.component.file.FileExchange;
 import org.apache.camel.impl.JndiRegistry;
 
 /**

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/model/XmlParseTest.java
Sat Sep 27 20:18:13 2008
@@ -90,7 +90,7 @@
         TransformType node = assertNthProcessorInstanceOf(TransformType.class, route, 0);
         assertExpression(node.getExpression(), "simple", "${in.body} extra data!");
         assertChildTo(route, "mock:end", 1);
-    }    
+    }
 
     public void testParseSetBodyXml() throws Exception {
         RouteType route = assertOneRoute("setBody.xml");
@@ -98,8 +98,8 @@
         SetBodyType node = assertNthProcessorInstanceOf(SetBodyType.class, route, 0);
         assertExpression(node.getExpression(), "simple", "${in.body} extra data!");
         assertChildTo(route, "mock:end", 1);
-    }        
-    
+    }
+
     public void testParseSetHeaderXml() throws Exception {
         RouteType route = assertOneRoute("setHeader.xml");
         assertFrom(route, "seda:a");
@@ -107,7 +107,7 @@
         assertEquals("oldBodyValue", node.getHeaderName());
         assertExpression(node.getExpression(), "simple", "body");
         assertChildTo(route, "mock:b", 1);
-    }   
+    }
 
     public void testParseSetHeaderToConstantXml() throws Exception {
         RouteType route = assertOneRoute("setHeaderToConstant.xml");
@@ -116,7 +116,7 @@
         assertEquals("theHeader", node.getHeaderName());
         assertExpression(node.getExpression(), "constant", "a value");
         assertChildTo(route, "mock:b", 1);
-    }       
+    }
 
     public void testParseSetOutHeaderXml() throws Exception {
         RouteType route = assertOneRoute("setOutHeader.xml");
@@ -125,7 +125,7 @@
         assertEquals("oldBodyValue", node.getHeaderName());
         assertExpression(node.getExpression(), "simple", "body");
         assertChildTo(route, "mock:b", 1);
-    }   
+    }
 
     public void testParseSetOutHeaderToConstantXml() throws Exception {
         RouteType route = assertOneRoute("setOutHeaderToConstant.xml");
@@ -134,16 +134,16 @@
         assertEquals("theHeader", node.getHeaderName());
         assertExpression(node.getExpression(), "constant", "a value");
         assertChildTo(route, "mock:b", 1);
-    }        
-    
+    }
+
     public void testParseConvertBodyXml() throws Exception {
         RouteType route = assertOneRoute("convertBody.xml");
         assertFrom(route, "seda:a");
         ConvertBodyType node = assertOneProcessorInstanceOf(ConvertBodyType.class, route);
         assertEquals("java.lang.Integer", node.getType());
         assertEquals(Integer.class, node.getTypeClass());
-    } 
-    
+    }
+
     public void testParseRoutingSlipXml() throws Exception {
         RouteType route = assertOneRoute("routingSlip.xml");
         assertFrom(route, "seda:a");
@@ -157,17 +157,17 @@
         assertFrom(route, "seda:a");
         RoutingSlipType node = assertOneProcessorInstanceOf(RoutingSlipType.class, route);
         assertEquals("theRoutingSlipHeader", node.getHeaderName());
-        assertEquals(RoutingSlipType.DEFAULT_DELIMITER, node.getUriDelimiter());       
-    }       
-    
+        assertEquals(RoutingSlipType.DEFAULT_DELIMITER, node.getUriDelimiter());
+    }
+
     public void testParseRoutingSlipWithHeaderAndDelimiterSetXml() throws Exception {
         RouteType route = assertOneRoute("routingSlipHeaderAndDelimiterSet.xml");
         assertFrom(route, "seda:a");
         RoutingSlipType node = assertOneProcessorInstanceOf(RoutingSlipType.class, route);
         assertEquals("theRoutingSlipHeader", node.getHeaderName());
-        assertEquals("#", node.getUriDelimiter());       
-    }   
-    
+        assertEquals("#", node.getUriDelimiter());
+    }
+
     //TODO get the test fixed
     public void xtestParseRouteWithInterceptorXml() throws Exception {
         RouteType route = assertOneRoute("routeWithInterceptor.xml");
@@ -177,7 +177,7 @@
     }
 
     @SuppressWarnings("unchecked")
-	public void testParseRouteWithChoiceXml() throws Exception {
+    public void testParseRouteWithChoiceXml() throws Exception {
         RouteType route = assertOneRoute("routeWithChoice.xml");
         assertFrom(route, "seda:a");
 
@@ -304,7 +304,7 @@
     protected void assertInterceptorRefs(ProcessorType route, String... names) {
         RouteType rt = (RouteType)route;
         assertNotNull(rt);
-        
+
         // Rely on the fact that reference ids are unique
         List<InterceptorType> interceptors = rt.getInterceptors();
         assertEquals("Interceptor count does not match", names.length, interceptors.size());

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTest.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTest.java
Sat Sep 27 20:18:13 2008
@@ -41,18 +41,18 @@
     }
 
     public void testLoopAsBlock() throws Exception {
-    	MockEndpoint lastEndpoint = resolveMandatoryEndpoint("mock:last", MockEndpoint.class);
+        MockEndpoint lastEndpoint = resolveMandatoryEndpoint("mock:last", MockEndpoint.class);
         lastEndpoint.expectedMessageCount(1);
         performLoopTest("direct:d", 2);
         lastEndpoint.assertIsSatisfied();
     }
 
     public void testLoopWithInvalidExpression() throws Exception {
-    	try {
+        try {
             performLoopTest("direct:b", 4, "invalid");
             fail("Exception expected for invalid expression");
-    	} catch (RuntimeCamelException e) {
-    	    // expected
+        } catch (RuntimeCamelException e) {
+            // expected
         }
     }
 

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTestProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTestProcessor.java?rev=699766&r1=699765&r2=699766&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTestProcessor.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/LoopTestProcessor.java
Sat Sep 27 20:18:13 2008
@@ -21,8 +21,8 @@
 import org.apache.camel.Processor;
 
 public class LoopTestProcessor implements Processor {
-    private int count = 0;
-    private int index = 0;
+    private int count;
+    private int index;
 
     public LoopTestProcessor() {
     }
@@ -41,10 +41,10 @@
     }
 
     public void process(Exchange exchange) {
-    	Integer c = exchange.getProperty(LoopProcessor.PROP_ITER_COUNT, Integer.class);
-    	Integer i = exchange.getProperty(LoopProcessor.PROP_ITER_INDEX, Integer.class);
-    	if (c == null || c.intValue() != this.count) {
-    	    exchange.setException(new CamelException(
+        Integer c = exchange.getProperty(LoopProcessor.PROP_ITER_COUNT, Integer.class);
+        Integer i = exchange.getProperty(LoopProcessor.PROP_ITER_INDEX, Integer.class);
+        if (c == null || c.intValue() != this.count) {
+            exchange.setException(new CamelException(
                 "Invalid count value.  Expected " + this.count + " but was " + c));
         }
         if (i == null || i.intValue() != this.index++) {



Mime
View raw message