Author: ningjiang
Date: Sat Aug 23 02:30:27 2008
New Revision: 688281

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

Modified:
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileExpressionRenamer.java
    
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.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/util/IntrospectionSupport.java
    
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExpressionTest.java
    
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProducerExpressionTest.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/processor/FaultRetryRouteTest.java
    
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java?rev=688281&r1=688280&r2=688281&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/PredicateBuilder.java
 Sat Aug 23 02:30:27 2008
@@ -236,8 +236,8 @@
 
             @Override
             protected String assertionFailureMessage(E exchange) {
-                return super.assertionFailureMessage(exchange) + 
-                    " for <" + expression.evaluate(exchange) + ">";
+                return super.assertionFailureMessage(exchange)
+                    + " for <" + expression.evaluate(exchange) + ">";
             }
         };
     }

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileExpressionRenamer.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileExpressionRenamer.java?rev=688281&r1=688280&r2=688281&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileExpressionRenamer.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/strategy/FileExpressionRenamer.java
 Sat Aug 23 02:30:27 2008
@@ -1,3 +1,19 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.component.file.strategy;
 
 import java.io.File;

Modified: 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java?rev=688281&r1=688280&r2=688281&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
 Sat Aug 23 02:30:27 2008
@@ -188,7 +188,7 @@
 
     protected boolean isValidConverterMethod(Method method) {
         Class<?>[] parameterTypes = method.getParameterTypes();
-        return (parameterTypes != null) && (parameterTypes.length == 1 || 
-            (parameterTypes.length == 2 && 
Exchange.class.isAssignableFrom(parameterTypes[1])));
+        return (parameterTypes != null) && (parameterTypes.length == 1
+            || (parameterTypes.length == 2 && 
Exchange.class.isAssignableFrom(parameterTypes[1])));
     }
 }

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=688281&r1=688280&r2=688281&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 Aug 23 02:30:27 2008
@@ -1,3 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package org.apache.camel.language.simple;
 
 import java.io.IOException;
@@ -13,7 +30,10 @@
  * A helper class for working with <a 
href="http://activemq.apache.org/camel/expression.html";>expressions</a> based
  * on FileExchange.
  */
-public class FileExpressionBuilder {
+public final class FileExpressionBuilder {
+    private FileExpressionBuilder() {
+        // Helper class
+    }
 
     public static <E extends FileExchange> Expression<E> fileNameExpression() {
         return new Expression<E>() {

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=688281&r1=688280&r2=688281&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 Aug 23 02:30:27 2008
@@ -285,7 +285,7 @@
 
         if (candidates.isEmpty()) {
             return candidates;
-        } else if (candidates.size() == 1 ){
+        } else if (candidates.size() == 1) {
             // only one
             return candidates;
         } else {

Modified: 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExpressionTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExpressionTest.java?rev=688281&r1=688280&r2=688281&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExpressionTest.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerExpressionTest.java
 Sat Aug 23 02:30:27 2008
@@ -124,17 +124,17 @@
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("file://target/filelanguage/report.txt?autoCreate=false" +
-                    "&expression=${id}.bak").to("mock:result");
+                from("file://target/filelanguage/report.txt?autoCreate=false"
+                     + "&expression=${id}.bak").to("mock:result");
 
-                from("file://target/filelanguage/report2.txt?autoCreate=false" 
+
-                    
"&expression=backup-${id}-${file:name.noext}.bak").to("mock:result");
+                from("file://target/filelanguage/report2.txt?autoCreate=false"
+                     + 
"&expression=backup-${id}-${file:name.noext}.bak").to("mock:result");
 
-                from("file://target/filelanguage/report3.txt?autoCreate=false" 
+
-                    
"&expression=backup/${bean:myguidgenerator.guid}.txt").to("mock:result");
+                from("file://target/filelanguage/report3.txt?autoCreate=false"
+                     + 
"&expression=backup/${bean:myguidgenerator.guid}.txt").to("mock:result");
 
-                from("file://target/filelanguage/report4.txt?autoCreate=false" 
+
-                    
"&expression=../backup/${file:name}.bak").to("mock:result");
+                from("file://target/filelanguage/report4.txt?autoCreate=false"
+                     + 
"&expression=../backup/${file:name}.bak").to("mock:result");
 
                 // configured by java using java beans setters
                 FileEndpoint endpoint = new FileEndpoint();

Modified: 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProducerExpressionTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProducerExpressionTest.java?rev=688281&r1=688280&r2=688281&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProducerExpressionTest.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileProducerExpressionTest.java
 Sat Aug 23 02:30:27 2008
@@ -18,8 +18,8 @@
 
 import java.io.File;
 import java.text.SimpleDateFormat;
-import java.util.Date;
 import java.util.Calendar;
+import java.util.Date;
 import java.util.GregorianCalendar;
 
 import org.apache.camel.ContextTestSupport;
@@ -56,7 +56,7 @@
 
         Thread.sleep(500);
         assertFileExists("target/filelanguage/123.bak");
-     }
+    }
 
     public void testProducerDateByHeader() throws Exception {
         template.sendBodyAndHeader("file://target/filelanguage", "Hello World",

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=688281&r1=688280&r2=688281&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 Aug 23 02:30:27 2008
@@ -18,9 +18,9 @@
 
 import java.io.File;
 import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
-import java.util.Calendar;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;

Modified: 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRetryRouteTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRetryRouteTest.java?rev=688281&r1=688280&r2=688281&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRetryRouteTest.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRetryRouteTest.java
 Sat Aug 23 02:30:27 2008
@@ -29,7 +29,7 @@
     protected MockEndpoint b;
     protected MockEndpoint error;
     protected final Processor successOnRetryProcessor = new Processor() {
-       int count = 0;
+        int count;
         public void process(Exchange exchange) throws CamelException {
             if (count++ == 0) {
                 Message message = exchange.getFault();
@@ -42,9 +42,9 @@
         a.expectedBodiesReceived("in");
         b.expectedBodiesReceived("in");
         error.expectedMessageCount(0);
-        
+
         template.sendBody("direct:start", "in");
-        
+
         MockEndpoint.assertIsSatisfied(a, b, error);
     }
 

Modified: 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java?rev=688281&r1=688280&r2=688281&view=diff
==============================================================================
--- 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
 (original)
+++ 
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
 Sat Aug 23 02:30:27 2008
@@ -115,17 +115,17 @@
             assertEquals("Fault message", "It makes no sense of business 
logic",
                          
((IllegalStateException)(fault.getBody())).getMessage());
         } else { // test for the throwFault with String
-               if (errors == 0) {
-                   // fault *not* handled
-                   assertTrue("It should be the CamelException", 
fault.getBody() instanceof CamelException);
-                   assertEquals("Fault message", "ExceptionMessage", 
((CamelException)(fault.getBody())).getMessage());
-               } else {
-                   // fault handled, exception should contain the fault
-                   assertNull("Fault body should be null", fault.getBody());
-                   CamelException faultex = 
(CamelException)exchange.getException();
-                   assertNotNull("Exception body should contain the fault", 
faultex);
-                   assertEquals("Fault message", "ExceptionMessage", 
faultex.getMessage());
-               }
+            if (errors == 0) {
+                // fault *not* handled
+                assertTrue("It should be the CamelException", fault.getBody() 
instanceof CamelException);
+                assertEquals("Fault message", "ExceptionMessage", 
((CamelException)(fault.getBody())).getMessage());
+            } else {
+                // fault handled, exception should contain the fault
+                assertNull("Fault body should be null", fault.getBody());
+                CamelException faultex = 
(CamelException)exchange.getException();
+                assertNotNull("Exception body should contain the fault", 
faultex);
+                assertEquals("Fault message", "ExceptionMessage", 
faultex.getMessage());
+            }
         }
     }
 


Reply via email to