Repository: camel
Updated Branches:
  refs/heads/master a04a95313 -> 0713b95e2


CAMEL-7144: Avoid calling toString on a processor instance in the route 
description as that can be problematic if the processor is a proxy or something.


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

Branch: refs/heads/master
Commit: 0713b95e2c7ff95ccdb81b8ae5e2ab3a093bb67c
Parents: a04a953
Author: Claus Ibsen <davscl...@apache.org>
Authored: Sun Feb 15 17:58:50 2015 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Sun Feb 15 17:58:50 2015 +0100

----------------------------------------------------------------------
 .../org/apache/camel/model/ProcessDefinition.java     | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0713b95e/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java 
b/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java
index 86439ef..b5f9f44 100644
--- a/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java
@@ -55,9 +55,13 @@ public class ProcessDefinition extends 
NoOutputDefinition<ProcessDefinition> {
 
     @Override
     public String toString() {
-        return "process["
-                + ((ref != null) ? "ref:" + ref : processor)
-                + "]";
+        if (ref != null) {
+            return "process[ref:" + ref + "]";
+        } else {
+            // do not invoke toString on the processor as we do not know what 
it would do
+            String id = ObjectHelper.getIdentityHashCode(processor);
+            return "process[Processor@" + id + "]";
+        }
     }
 
     @Override
@@ -65,7 +69,9 @@ public class ProcessDefinition extends 
NoOutputDefinition<ProcessDefinition> {
         if (ref != null) {
             return "ref:" + ref;
         } else if (processor != null) {
-            return processor.toString();
+            // do not invoke toString on the processor as we do not know what 
it would do
+            String id = ObjectHelper.getIdentityHashCode(processor);
+            return "Processor@" + id;
         } else {
             return "";
         }

Reply via email to