Fixed the ecilpse warning of camel-core
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/11e954fb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/11e954fb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/11e954fb Branch: refs/heads/master Commit: 11e954fb09f6ca19b8db8e5e136c01f22dddf00c Parents: 783a2f5 Author: Willem Jiang <ningji...@apache.org> Authored: Thu Aug 22 09:57:44 2013 +0800 Committer: Willem Jiang <ningji...@apache.org> Committed: Thu Aug 22 09:57:44 2013 +0800 ---------------------------------------------------------------------- .../camel/converter/stream/CachedOutputStream.java | 7 +++++++ .../apache/camel/component/bean/BeanMapPutTest.java | 3 +-- .../converter/stream/CachedOutputStreamTest.java | 14 +++++++------- .../camel/impl/CamelPostProcessorHelperTest.java | 3 +-- 4 files changed, 16 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/11e954fb/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java b/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java index 7db0d51..c5f3b49 100644 --- a/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java +++ b/camel-core/src/main/java/org/apache/camel/converter/stream/CachedOutputStream.java @@ -230,8 +230,15 @@ public class CachedOutputStream extends OutputStream { } } + /** + * @deprecated use {@link #getStrategyBufferSize()} + */ @Deprecated public int getBufferSize() { + return getStrategyBufferSize(); + } + + public int getStrategyBufferSize() { return strategy.getBufferSize(); } http://git-wip-us.apache.org/repos/asf/camel/blob/11e954fb/camel-core/src/test/java/org/apache/camel/component/bean/BeanMapPutTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/component/bean/BeanMapPutTest.java b/camel-core/src/test/java/org/apache/camel/component/bean/BeanMapPutTest.java index 4743f75..d6c9fd8 100644 --- a/camel-core/src/test/java/org/apache/camel/component/bean/BeanMapPutTest.java +++ b/camel-core/src/test/java/org/apache/camel/component/bean/BeanMapPutTest.java @@ -21,7 +21,6 @@ import java.util.Map; import org.apache.camel.ContextTestSupport; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.impl.JndiRegistry; /** @@ -29,7 +28,7 @@ import org.apache.camel.impl.JndiRegistry; */ public class BeanMapPutTest extends ContextTestSupport { - private Map myMap = new HashMap(); + private Map<String, String> myMap = new HashMap<String, String>(); @Override protected JndiRegistry createRegistry() throws Exception { http://git-wip-us.apache.org/repos/asf/camel/blob/11e954fb/camel-core/src/test/java/org/apache/camel/converter/stream/CachedOutputStreamTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/converter/stream/CachedOutputStreamTest.java b/camel-core/src/test/java/org/apache/camel/converter/stream/CachedOutputStreamTest.java index a705e1a..39fac58 100644 --- a/camel-core/src/test/java/org/apache/camel/converter/stream/CachedOutputStreamTest.java +++ b/camel-core/src/test/java/org/apache/camel/converter/stream/CachedOutputStreamTest.java @@ -87,7 +87,7 @@ public class CachedOutputStreamTest extends ContextTestSupport { assertEquals("we should have a temp file", files.length, 1); assertTrue("The file name should start with cos" , files[0].startsWith("cos")); - StreamCache cache = cos.getStreamCache(); + StreamCache cache = cos.newStreamCache(); assertTrue("Should get the FileInputStreamCache", cache instanceof FileInputStreamCache); String temp = toString((InputStream)cache); @@ -131,7 +131,7 @@ public class CachedOutputStreamTest extends ContextTestSupport { assertTrue("The content is not encrypted", temp.length() > 0 && temp.indexOf("aaa") < 0); tmpin.close(); - StreamCache cache = cos.getStreamCache(); + StreamCache cache = cos.newStreamCache(); assertTrue("Should get the FileInputStreamCache", cache instanceof FileInputStreamCache); temp = toString((InputStream)cache); @@ -166,7 +166,7 @@ public class CachedOutputStreamTest extends ContextTestSupport { assertEquals("we should have a temp file", files.length, 1); assertTrue("The file name should start with cos" , files[0].startsWith("cos")); - StreamCache cache = cos.getStreamCache(); + StreamCache cache = cos.newStreamCache(); assertTrue("Should get the FileInputStreamCache", cache instanceof FileInputStreamCache); String temp = toString((InputStream)cache); assertEquals("Cached a wrong file", temp, TEST_STRING); @@ -195,7 +195,7 @@ public class CachedOutputStreamTest extends ContextTestSupport { String[] files = file.list(); assertEquals("we should have no temp file", files.length, 0); - StreamCache cache = cos.getStreamCache(); + StreamCache cache = cos.newStreamCache(); assertTrue("Should get the InputStreamCache", cache instanceof InputStreamCache); String temp = IOConverter.toString((InputStream)cache, null); assertEquals("Cached a wrong file", temp, TEST_STRING); @@ -216,7 +216,7 @@ public class CachedOutputStreamTest extends ContextTestSupport { String[] files = file.list(); assertEquals("we should have no temp file", files.length, 0); - StreamCache cache = cos.getStreamCache(); + StreamCache cache = cos.newStreamCache(); assertTrue("Should get the InputStreamCache", cache instanceof InputStreamCache); String temp = IOConverter.toString((InputStream)cache, null); assertEquals("Cached a wrong file", temp, TEST_STRING); @@ -235,7 +235,7 @@ public class CachedOutputStreamTest extends ContextTestSupport { CachedOutputStream cos = new CachedOutputStream(exchange); cos.write(TEST_STRING.getBytes("UTF-8")); - assertEquals("we should have a custom buffer size", cos.getBufferSize(), 8192); + assertEquals("we should have a custom buffer size", cos.getStrategyBufferSize(), 8192); // make sure things still work after custom buffer size set File file = new File("target/cachedir"); @@ -243,7 +243,7 @@ public class CachedOutputStreamTest extends ContextTestSupport { assertEquals("we should have a temp file", files.length, 1); assertTrue("The file name should start with cos" , files[0].startsWith("cos")); - StreamCache cache = cos.getStreamCache(); + StreamCache cache = cos.newStreamCache(); assertTrue("Should get the FileInputStreamCache", cache instanceof FileInputStreamCache); String temp = toString((InputStream)cache); assertEquals("Cached a wrong file", temp, TEST_STRING); http://git-wip-us.apache.org/repos/asf/camel/blob/11e954fb/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java b/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java index 347822a..4e32f7e 100644 --- a/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java +++ b/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java @@ -473,9 +473,8 @@ public class CamelPostProcessorHelperTest extends ContextTestSupport { } public class MyPrivateConsumeBean { - + @Consume(uri = "seda:foo") - @SuppressWarnings("unused") private void consumeSomethingPrivate(String body) { assertEquals("Hello World", body); template.sendBody("mock:result", body);