You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2009/09/13 14:15:51 UTC

svn commit: r814306 - in /camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy: ./ csv/ format/ kvp/

Author: ningjiang
Date: Sun Sep 13 12:15:50 2009
New Revision: 814306

URL: http://svn.apache.org/viewvc?rev=814306&view=rev
Log:
Fixed the CS errors of camel-bindy

Modified:
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/DatePatternFormat.java
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/FormatException.java
    camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java?rev=814306&r1=814305&r2=814306&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyCsvFactory.java Sun Sep 13 12:15:50 2009
@@ -185,7 +185,7 @@
                 try {
                     value = format.parse(data);
                 } catch (FormatException ie) {
-                	throw new IllegalArgumentException( ie.getMessage() + ", position : " + pos + ", line nber : " + line, ie);
+                    throw new IllegalArgumentException(ie.getMessage() + ", position : " + pos + ", line nber : " + line, ie);
                 } catch (Exception e) {
                     throw new IllegalArgumentException("Parsing error detected for field defined at the position : " + pos  + ", line nber : " + line, e);
                 }

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java?rev=814306&r1=814305&r2=814306&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/BindyKeyValuePairFactory.java Sun Sep 13 12:15:50 2009
@@ -166,7 +166,7 @@
                     value = format.parse(keyValue);
                 } catch (Exception e) {
                     throw new IllegalArgumentException("Parsing error detected for field defined at the tag : " + tag
-                    		                                + ", line nber : " + line, e);
+                        + ", line nber : " + line, e);
                 }
 
                 field.set(modelField, value);
@@ -182,7 +182,7 @@
 
         StringBuilder builder = new StringBuilder();
 
-        Map<Integer, KeyValuePairField> keyValuePairFieldsSorted = new TreeMap<Integer, KeyValuePairField>( keyValuePairFields );
+        Map<Integer, KeyValuePairField> keyValuePairFieldsSorted = new TreeMap<Integer, KeyValuePairField>(keyValuePairFields);
         Iterator<Integer> it = keyValuePairFieldsSorted.keySet().iterator();
 
         // Map containing the OUT position of the field

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java?rev=814306&r1=814305&r2=814306&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java Sun Sep 13 12:15:50 2009
@@ -98,11 +98,11 @@
 
             // If the first line of the CSV file contains columns name, then we skip this line
             if (factory.getSkipFirstLine()) {
-            	
-            	// Check if scanner is empty
-            	if (scanner.hasNextLine()) {
-            		scanner.nextLine();
-            	}
+            
+                // Check if scanner is empty
+                if (scanner.hasNextLine()) {
+                    scanner.nextLine();
+                }
             }
 
             while (scanner.hasNextLine()) {

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/DatePatternFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/DatePatternFormat.java?rev=814306&r1=814305&r2=814306&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/DatePatternFormat.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/DatePatternFormat.java Sun Sep 13 12:15:50 2009
@@ -56,17 +56,17 @@
         // To avoid to parse a string date : 20090901-10:32:30 when 
         // the pattern is yyyyMMdd
        
-        if ( string.length() <= this.pattern.length() ) {
-        	
+        if (string.length() <= this.pattern.length()) {
+        
             // Force the parser to be strict in the syntax of the date to be
             // converted
             df.setLenient(false);
             date = df.parse(string);
 
             return date;
-        	
+        
         } else {
-        	throw new FormatException("Date provided does not fit the pattern defined");
+            throw new FormatException("Date provided does not fit the pattern defined");
         }
 
     }

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/FormatException.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/FormatException.java?rev=814306&r1=814305&r2=814306&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/FormatException.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/format/FormatException.java Sun Sep 13 12:15:50 2009
@@ -17,10 +17,10 @@
 package org.apache.camel.dataformat.bindy.format;
 
 public class FormatException extends Exception {
-	
-	private static final long serialVersionUID = 2243166587373950715L;
 
-	public FormatException() {
+    private static final long serialVersionUID = 2243166587373950715L;
+
+    public FormatException() {
     }
 
     public FormatException(String message) {

Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java?rev=814306&r1=814305&r2=814306&view=diff
==============================================================================
--- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java (original)
+++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/kvp/BindyKeyValuePairDataFormat.java Sun Sep 13 12:15:50 2009
@@ -73,7 +73,7 @@
 
     public Object unmarshal(Exchange exchange, InputStream inputStream) throws Exception {
         BindyKeyValuePairFactory factory = getFactory(exchange.getContext().getPackageScanClassResolver());
-        
+
         // List of Pojos
         List<Map<String, Object>> models = new ArrayList<Map<String, Object>>();
 
@@ -86,7 +86,8 @@
         Scanner scanner = new Scanner(in);
 
         // Retrieve the pair separator defined to split the record
-        ObjectHelper.notNull(factory.getPairSeparator(), "The pair separator property of the annotation @Message");
+        ObjectHelper.notNull(factory.getPairSeparator(),
+                             "The pair separator property of the annotation @Message");
         String separator = factory.getPairSeparator();
 
         int count = 0;
@@ -94,45 +95,45 @@
 
             while (scanner.hasNextLine()) {
 
-				// Read the line
-				String line = scanner.nextLine().trim();
+                // Read the line
+                String line = scanner.nextLine().trim();
 
-				if (ObjectHelper.isEmpty(line)) {
-					// skip if line is empty
-					continue;
-				}
+                if (ObjectHelper.isEmpty(line)) {
+                    // skip if line is empty
+                    continue;
+                }
 
-				// Increment counter
-				count++;
+                // Increment counter
+                count++;
 
-				// Create POJO
-				model = factory.factory();
+                // Create POJO
+                model = factory.factory();
 
-				// Split the message according to the pair separator defined in
-				// annotated class @Message
-				List<String> result = Arrays.asList(line.split(separator));
+                // Split the message according to the pair separator defined in
+                // annotated class @Message
+                List<String> result = Arrays.asList(line.split(separator));
 
-				if (result.size() == 0 || result.isEmpty()) {
-					throw new java.lang.IllegalArgumentException("No records have been defined in the KVP !");
-				}
+                if (result.size() == 0 || result.isEmpty()) {
+                    throw new java.lang.IllegalArgumentException("No records have been defined in the KVP !");
+                }
 
-				if (result.size() > 0) {
+                if (result.size() > 0) {
 
-					// Bind data from message with model classes
-					factory.bind(result, model, count);
+                    // Bind data from message with model classes
+                    factory.bind(result, model, count);
 
-					// Link objects together
-					factory.link(model);
+                    // Link objects together
+                    factory.link(model);
 
-					// Add objects graph to the list
-					models.add(model);
+                    // Add objects graph to the list
+                    models.add(model);
 
-					if (LOG.isDebugEnabled()) {
-						LOG.debug("Graph of objects created : " + model);
-					}
-				}
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Graph of objects created : " + model);
+                    }
+                }
 
-			}
+            }
 
             // Test if models list is empty or not
             // If this is the case (correspond to an empty stream, ...)