camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r884894 - in /camel/trunk/camel-core/src/main/java/org/apache/camel/impl: DoCatchRouteNode.java OnExceptionRouteNode.java
Date Fri, 27 Nov 2009 15:26:36 GMT
Author: davsclaus
Date: Fri Nov 27 15:26:36 2009
New Revision: 884894

URL: http://svn.apache.org/viewvc?rev=884894&view=rev
Log:
Fixed potential NPE in tracer

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DoCatchRouteNode.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/OnExceptionRouteNode.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DoCatchRouteNode.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DoCatchRouteNode.java?rev=884894&r1=884893&r2=884894&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DoCatchRouteNode.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DoCatchRouteNode.java Fri Nov
27 15:26:36 2009
@@ -38,7 +38,13 @@
     }
 
     public String getLabel(Exchange exchange) {
-        return "doCatch[" + exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class).getClass().getSimpleName()
+ "]";
+        if (exchange.getProperty(Exchange.EXCEPTION_CAUGHT) != null) {
+            return "doCatch[" + exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class).getClass().getSimpleName()
+ "]";
+        } else if (exchange.getException() != null) {
+            return "doCatch[" + exchange.getException().getClass().getSimpleName() + "]";
+        } else {
+            return "doCatch[]";
+        }
     }
 
     public boolean isAbstract() {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/OnExceptionRouteNode.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/OnExceptionRouteNode.java?rev=884894&r1=884893&r2=884894&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/OnExceptionRouteNode.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/OnExceptionRouteNode.java Fri
Nov 27 15:26:36 2009
@@ -38,7 +38,13 @@
     }
 
     public String getLabel(Exchange exchange) {
-        return "OnException[" + exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class).getClass().getSimpleName()
+ "]";
+        if (exchange.getProperty(Exchange.EXCEPTION_CAUGHT) != null) {
+            return "OnException[" + exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class).getClass().getSimpleName()
+ "]";
+        } else if (exchange.getException() != null) {
+            return "OnException[" + exchange.getException().getClass().getSimpleName() +
"]";
+        } else {
+            return "OnException[]";
+        }
     }
 
     public boolean isAbstract() {



Mime
View raw message