camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [4/5] camel git commit: CAMEL-9747: Java 8 upgrade - Set source and target to java 1.8
Date Wed, 23 Mar 2016 10:42:47 GMT
CAMEL-9747: Java 8 upgrade - Set source and target to java 1.8


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/39535244
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/39535244
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/39535244

Branch: refs/heads/master
Commit: 39535244a55f4f03e93485250fef80ba224ecec1
Parents: 667af83
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Mar 23 11:40:32 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Mar 23 11:42:32 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/mock/MockEndpoint.java   |  6 +++++-
 .../apache/camel/builder/xml/XPathTransformTest.java    |  4 ++--
 .../org/apache/camel/impl/ConfigurationHelperTest.java  | 12 ++++++------
 .../org/apache/camel/component/hl7/HL7Converter.java    |  3 ++-
 .../component/ignite/TestIgniteComputeResources.java    |  3 ++-
 5 files changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/39535244/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 929ccff..7be0ed1 100644
--- a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -681,7 +681,11 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint
{
         }
 
         if (actualValue instanceof Expression) {
-            actualValue = ((Expression)actualValue).evaluate(exchange, expectedValue != null
? expectedValue.getClass() : Object.class);
+            Class clazz = Object.class;
+            if (expectedValue != null) {
+                clazz = expectedValue.getClass();
+            }
+            actualValue = ((Expression)actualValue).evaluate(exchange, clazz);
         } else if (actualValue instanceof Predicate) {
             actualValue = ((Predicate)actualValue).matches(exchange);
         } else if (expectedValue != null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/39535244/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTransformTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTransformTest.java
b/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTransformTest.java
index b62ff74..f0d194a 100644
--- a/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTransformTest.java
+++ b/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTransformTest.java
@@ -62,7 +62,7 @@ public class XPathTransformTest extends ContextTestSupport {
 
         expect(l.isInfoEnabled()).andReturn(true).anyTimes();
 
-        l.info(contains("Namespaces discovered in message"), anyObject());
+        l.info(contains("Namespaces discovered in message"), anyObject(Object.class));
         expectLastCall().times(1);
         replay(l);
 
@@ -91,7 +91,7 @@ public class XPathTransformTest extends ContextTestSupport {
         expect(l.isInfoEnabled()).andReturn(true).anyTimes();
 
         Capture<String> captures = new Capture<String>(CaptureType.ALL);
-        l.info(capture(captures), anyObject());
+        l.info(capture(captures), anyObject(Object.class));
         expectLastCall().anyTimes();
 
         replay(l);

http://git-wip-us.apache.org/repos/asf/camel/blob/39535244/camel-core/src/test/java/org/apache/camel/impl/ConfigurationHelperTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/ConfigurationHelperTest.java b/camel-core/src/test/java/org/apache/camel/impl/ConfigurationHelperTest.java
index aeab0dc..e4b7737 100644
--- a/camel-core/src/test/java/org/apache/camel/impl/ConfigurationHelperTest.java
+++ b/camel-core/src/test/java/org/apache/camel/impl/ConfigurationHelperTest.java
@@ -71,7 +71,7 @@ public class ConfigurationHelperTest {
         assertEquals("URNs don't set the authority field", null, cfg.getParameter(EndpointConfiguration.URI_AUTHORITY));
         assertEquals("URNs don't set the userInfo field", null, cfg.getParameter(EndpointConfiguration.URI_USER_INFO));
         assertEquals("URNs don't set the host field", null, cfg.getParameter(EndpointConfiguration.URI_HOST));
-        assertEquals("URNs don't set the port field", -1, cfg.getParameter(EndpointConfiguration.URI_PORT));
+        assertEquals("URNs don't set the port field", Integer.valueOf(-1), cfg.getParameter(EndpointConfiguration.URI_PORT));
         assertEquals("URNs don't set the path field", null, cfg.getParameter(EndpointConfiguration.URI_PATH));
         assertEquals("URNs don't set the query field", null, cfg.getParameter(EndpointConfiguration.URI_QUERY));
         assertEquals("URNs don't set the fragment field", null, cfg.getParameter(EndpointConfiguration.URI_FRAGMENT));
@@ -86,7 +86,7 @@ public class ConfigurationHelperTest {
         assertEquals("URNs don't set the authority field", null, cfg.getParameter(EndpointConfiguration.URI_AUTHORITY));
         assertEquals("URNs don't set the userInfo field", null, cfg.getParameter(EndpointConfiguration.URI_USER_INFO));
         assertEquals("URNs don't set the host field", null, cfg.getParameter(EndpointConfiguration.URI_HOST));
-        assertEquals("URNs don't set the port field", -1, cfg.getParameter(EndpointConfiguration.URI_PORT));
+        assertEquals("URNs don't set the port field", Integer.valueOf(-1), cfg.getParameter(EndpointConfiguration.URI_PORT));
         assertEquals("URNs don't set the path field", null, cfg.getParameter(EndpointConfiguration.URI_PATH));
         assertEquals("URNs don't set the query field", null, cfg.getParameter(EndpointConfiguration.URI_QUERY));
         assertEquals("URNs don't set the fragment field", null, cfg.getParameter(EndpointConfiguration.URI_FRAGMENT));
@@ -101,7 +101,7 @@ public class ConfigurationHelperTest {
         assertEquals("foo", cfg.getParameter(EndpointConfiguration.URI_AUTHORITY));
         assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_USER_INFO));
         assertEquals("foo", cfg.getParameter(EndpointConfiguration.URI_HOST));
-        assertEquals(-1, cfg.getParameter(EndpointConfiguration.URI_PORT));
+        assertEquals(Integer.valueOf(-1), cfg.getParameter(EndpointConfiguration.URI_PORT));
         assertEquals("", cfg.getParameter(EndpointConfiguration.URI_PATH));
         assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_QUERY));
         assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_FRAGMENT));
@@ -116,7 +116,7 @@ public class ConfigurationHelperTest {
         assertEquals("foo", cfg.getParameter(EndpointConfiguration.URI_AUTHORITY));
         assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_USER_INFO));
         assertEquals("foo", cfg.getParameter(EndpointConfiguration.URI_HOST));
-        assertEquals(-1, cfg.getParameter(EndpointConfiguration.URI_PORT));
+        assertEquals(Integer.valueOf(-1), cfg.getParameter(EndpointConfiguration.URI_PORT));
         assertEquals("/bar#defrag", cfg.getParameter(EndpointConfiguration.URI_PATH));
         assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_QUERY));
         assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_FRAGMENT));
@@ -131,7 +131,7 @@ public class ConfigurationHelperTest {
         assertEquals("hadrian@localhost:9001", cfg.getParameter(EndpointConfiguration.URI_AUTHORITY));
         assertEquals("hadrian", cfg.getParameter(EndpointConfiguration.URI_USER_INFO));
         assertEquals("localhost", cfg.getParameter(EndpointConfiguration.URI_HOST));
-        assertEquals(9001, cfg.getParameter(EndpointConfiguration.URI_PORT));
+        assertEquals(Integer.valueOf(9001), cfg.getParameter(EndpointConfiguration.URI_PORT));
         assertEquals("/context/path/", cfg.getParameter(EndpointConfiguration.URI_PATH));
         assertEquals("bar=true&baz=2#none", cfg.getParameter(EndpointConfiguration.URI_QUERY));
         assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_FRAGMENT));
@@ -155,7 +155,7 @@ public class ConfigurationHelperTest {
         assertNotNull(config);
         assertTrue(config instanceof DummyConfiguration);
         assertEquals("one", config.getParameter("first"));
-        assertEquals(2, config.getParameter("second"));
+        assertEquals(Integer.valueOf(2), config.getParameter("second"));
     }
     
     protected static void logConfigurationObject(EndpointConfiguration config) {

http://git-wip-us.apache.org/repos/asf/camel/blob/39535244/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
----------------------------------------------------------------------
diff --git a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
index e8c98fb..1d96db0 100644
--- a/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
+++ b/components/camel-hl7/src/main/java/org/apache/camel/component/hl7/HL7Converter.java
@@ -21,6 +21,7 @@ import ca.uhn.hl7v2.HL7Exception;
 import ca.uhn.hl7v2.HapiContext;
 import ca.uhn.hl7v2.model.Message;
 import ca.uhn.hl7v2.parser.Parser;
+import ca.uhn.hl7v2.validation.ValidationContext;
 import ca.uhn.hl7v2.validation.impl.ValidationContextFactory;
 import org.apache.camel.Converter;
 
@@ -30,7 +31,7 @@ import org.apache.camel.Converter;
 @Converter
 public final class HL7Converter {
 
-    private static final HapiContext DEFAULT_CONTEXT = new DefaultHapiContext(ValidationContextFactory.noValidation());
+    private static final HapiContext DEFAULT_CONTEXT = new DefaultHapiContext((ValidationContext)
ValidationContextFactory.noValidation());
 
     private HL7Converter() {
         // Helper class

http://git-wip-us.apache.org/repos/asf/camel/blob/39535244/components/camel-ignite/src/test/java/org/apache/camel/component/ignite/TestIgniteComputeResources.java
----------------------------------------------------------------------
diff --git a/components/camel-ignite/src/test/java/org/apache/camel/component/ignite/TestIgniteComputeResources.java
b/components/camel-ignite/src/test/java/org/apache/camel/component/ignite/TestIgniteComputeResources.java
index 7c31e16e..76a5a23 100644
--- a/components/camel-ignite/src/test/java/org/apache/camel/component/ignite/TestIgniteComputeResources.java
+++ b/components/camel-ignite/src/test/java/org/apache/camel/component/ignite/TestIgniteComputeResources.java
@@ -95,7 +95,8 @@ public final class TestIgniteComputeResources {
         public String reduce(List<ComputeJobResult> results) throws IgniteException
{
             StringBuilder answer = new StringBuilder();
             for (ComputeJobResult res : results) {
-                answer.append(res.getData()).append(",");
+                Object data = res.getData();
+                answer.append(data).append(",");
             }
             answer.deleteCharAt(answer.length() - 1);
             return answer.toString();


Mime
View raw message