Author: ningjiang
Date: Sun Jun 15 23:36:26 2008
New Revision: 668062
URL: http://svn.apache.org/viewvc?rev=668062&view=rev
Log:
Fixed some CS error in camel-core
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/StringSourceTest.java
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java?rev=668062&r1=668061&r2=668062&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/NIOConverter.java
Sun Jun 15 23:36:26 2008
@@ -60,26 +60,27 @@
@Converter
public static ByteBuffer toByteBuffer(File file) throws IOException {
- InputStream in = null;
- try {
+ InputStream in = null;
+ try {
byte[] buf = new byte[(int)file.length()];
in = new BufferedInputStream(new FileInputStream(file));
int sizeLeft = (int)file.length();
int offset = 0;
while (sizeLeft > 0) {
- int readSize = in.read(buf, offset, sizeLeft);
- sizeLeft -= readSize;
- offset += readSize;
+ int readSize = in.read(buf, offset, sizeLeft);
+ sizeLeft -= readSize;
+ offset += readSize;
}
return ByteBuffer.wrap(buf);
- } finally {
+ } finally {
try {
- if (in != null)
- in.close();
+ if (in != null) {
+ in.close();
+ }
} catch (IOException e) {
LOG.warn("Failed to close file stream: " + file.getPath(), e);
}
- }
+ }
}
@Converter
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java?rev=668062&r1=668061&r2=668062&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/StringSource.java
Sun Jun 15 23:36:26 2008
@@ -16,8 +16,17 @@
*/
package org.apache.camel.converter.jaxp;
+import java.io.ByteArrayInputStream;
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
+
import javax.xml.transform.stream.StreamSource;
-import java.io.*;
/**
* A helper class which provides a JAXP [EMAIL PROTECTED]
javax.xml.transform.Source Source} from a String which can
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java?rev=668062&r1=668061&r2=668062&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java
(original)
+++
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ResolverUtil.java
Sun Jun 15 23:36:26 2008
@@ -281,8 +281,7 @@
protected void find(Test test, String packageName, ClassLoader loader) {
if (LOG.isTraceEnabled()) {
- LOG.trace("Searching for: " + test + " in package: " + packageName
+
- " using classloader: " + loader);
+ LOG.trace("Searching for: " + test + " in package: " + packageName
+ " using classloader: " + loader);
}
try {
@@ -364,8 +363,8 @@
}
}
} catch (Exception e) {
- LOG.error("Could not search osgi bundles for classes matching
criteria: "
- + test + "due to an Exception: " + e.getMessage());
+ LOG.error("Could not search osgi bundles for classes matching
criteria: " + test
+ + "due to an Exception: " + e.getMessage());
}
}
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/StringSourceTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/StringSourceTest.java?rev=668062&r1=668061&r2=668062&view=diff
==============================================================================
---
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/StringSourceTest.java
(original)
+++
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/StringSourceTest.java
Sun Jun 15 23:36:26 2008
@@ -1,5 +1,4 @@
/**
- *
* 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.
@@ -7,7 +6,7 @@
* (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
+ * 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,
@@ -17,15 +16,16 @@
*/
package org.apache.camel.converter;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
import junit.framework.TestCase;
-import org.apache.camel.converter.jaxp.StringSource;
import org.apache.camel.TypeConverter;
-import org.apache.camel.util.ReflectionInjector;
+import org.apache.camel.converter.jaxp.StringSource;
import org.apache.camel.impl.converter.DefaultTypeConverter;
-
-import java.io.ObjectOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.*;
+import org.apache.camel.util.ReflectionInjector;
/**
* @version $Revision: 1.1 $