From 972f6affc525f581dd30ac100613519ef6bb23f4 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Thu, 26 Aug 2010 18:58:46 +0000 Subject: [PATCH] INT-1257, INT-1263 Refactoring Message History (work in progress): MessageHistory's toString() now only returns the name of components that have been visited. Programmatically one can still access the 'type' and 'timestamp' properties as well. --- .../integration/history/MessageHistory.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java index f277be43fd..dcf0fbe1b9 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/history/MessageHistory.java @@ -29,6 +29,7 @@ import org.springframework.integration.MessageHeaders; import org.springframework.integration.context.NamedComponent; import org.springframework.integration.core.MessageBuilder; import org.springframework.util.Assert; +import org.springframework.util.StringUtils; /** * @author Mark Fisher @@ -123,7 +124,14 @@ public class MessageHistory implements List { } public String toString() { - return this.components.toString(); + List names = new ArrayList(); + for (Properties p : this.components) { + String name = p.getProperty(NAME_PROPERTY); + if (name != null) { + names.add(name); + } + } + return StringUtils.collectionToCommaDelimitedString(names); }