camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/3] camel git commit: CAMEL-11234: NullPointerException while trying to get the Route Status on startup
Date Tue, 16 May 2017 08:26:00 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x 14d57488f -> 8c00b91dd
  refs/heads/camel-2.19.x 7b23f1189 -> e313e6dba
  refs/heads/master a1830d5a2 -> 2999f9e76


CAMEL-11234: NullPointerException while trying to get the Route Status on startup


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

Branch: refs/heads/master
Commit: 2999f9e76cf4310d4142755baff67732d8f01b93
Parents: a1830d5
Author: Prasanth Pagolu <ppagolu@redhat.com>
Authored: Mon May 15 13:55:51 2017 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue May 16 10:21:34 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/impl/DefaultCamelContext.java |  3 ++-
 .../OnExceptionGlobalScopedRecursionTest.java           | 12 ++++++------
 .../processor/onexception/OnExceptionRecursionTest.java |  2 +-
 3 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2999f9e7/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index 82644d5..65c181d 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -3041,7 +3041,8 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
                 // count how many routes are actually started
                 int started = 0;
                 for (Route route : getRoutes()) {
-                    if (getRouteStatus(route.getId()).isStarted()) {
+                    ServiceStatus status = getRouteStatus(route.getId());
+                    if (status != null && status.isStarted()) {
                         started++;
                     }
                 }

http://git-wip-us.apache.org/repos/asf/camel/blob/2999f9e7/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionGlobalScopedRecursionTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionGlobalScopedRecursionTest.java
b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionGlobalScopedRecursionTest.java
index 417d4fa..37f6088 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionGlobalScopedRecursionTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionGlobalScopedRecursionTest.java
@@ -42,7 +42,7 @@ public class OnExceptionGlobalScopedRecursionTest extends ContextTestSupport
{
                     .to("mock:c")
                     .log("onException")
                     .throwException(new NullPointerException("A NPE error here"))
-                .end();
+                    .end();
 
                 from("direct:test")
                     .to("mock:a")
@@ -78,7 +78,7 @@ public class OnExceptionGlobalScopedRecursionTest extends ContextTestSupport
{
                     .to("mock:c")
                     .log("onException")
                     .throwException(new NullPointerException("A NPE error here"))
-                .end();
+                    .end();
 
                 from("direct:test")
                     .to("mock:a")
@@ -114,7 +114,7 @@ public class OnExceptionGlobalScopedRecursionTest extends ContextTestSupport
{
                     .to("mock:c")
                     .log("onException")
                     .to("direct:error")
-                .end();
+                    .end();
 
                 from("direct:test")
                     .to("mock:a")
@@ -157,7 +157,7 @@ public class OnExceptionGlobalScopedRecursionTest extends ContextTestSupport
{
                     .to("mock:c")
                     .log("onException")
                     .to("direct:error")
-                .end();
+                    .end();
 
                 from("direct:test")
                     .to("mock:a")
@@ -199,7 +199,7 @@ public class OnExceptionGlobalScopedRecursionTest extends ContextTestSupport
{
                     .to("mock:c")
                     .log("onException")
                     .to("direct:error")
-                .end();
+                    .end();
 
                 from("direct:test")
                     .to("mock:a")
@@ -239,7 +239,7 @@ public class OnExceptionGlobalScopedRecursionTest extends ContextTestSupport
{
                     .to("mock:c")
                     .log("onException")
                     .to("direct:error")
-                .end();
+                    .end();
 
                 from("direct:test")
                     .to("mock:a")

http://git-wip-us.apache.org/repos/asf/camel/blob/2999f9e7/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRecursionTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRecursionTest.java
b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRecursionTest.java
index bac6e40..d832296 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRecursionTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRecursionTest.java
@@ -68,7 +68,7 @@ public class OnExceptionRecursionTest extends ContextTestSupport {
             assertEquals("Bad state", ise.getMessage());
         }
 
-         assertMockEndpointsSatisfied();
+        assertMockEndpointsSatisfied();
     }
 
     public void testRecursionDirectNoErrorHandler() throws Exception {


Mime
View raw message