From fd6a77a9d1f9edf6b6484340658b1664a6babe1e Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Fri, 30 Apr 2010 03:25:38 +0000 Subject: [PATCH] not tracking history for beans that have no explicit id --- .../springframework/integration/history/MessageHistory.java | 4 +++- .../integration/history/MessageHistoryEvent.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/history/MessageHistory.java b/org.springframework.integration/src/main/java/org/springframework/integration/history/MessageHistory.java index d2393971f9..36e0fe4b40 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/history/MessageHistory.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/history/MessageHistory.java @@ -22,6 +22,8 @@ import java.util.Iterator; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; +import org.springframework.util.StringUtils; + /** * Threadsafe Iterable list of {@link MessageHistoryEvent} instances. * @@ -39,7 +41,7 @@ public class MessageHistory implements Iterable, Serializab * Add a new event with the provided component metadata. */ public MessageHistoryEvent addEvent(String name, String type) { - if (name != null) { + if (name != null && !StringUtils.startsWithIgnoreCase(name, "org.springframework")) { MessageHistoryEvent event = new MessageHistoryEvent(name, type); this.events.add(event); return event; diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/history/MessageHistoryEvent.java b/org.springframework.integration/src/main/java/org/springframework/integration/history/MessageHistoryEvent.java index ee3fed0049..9f94827c3e 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/history/MessageHistoryEvent.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/history/MessageHistoryEvent.java @@ -62,9 +62,12 @@ public class MessageHistoryEvent implements Serializable { public String toString() { StringBuilder sb = new StringBuilder(); if (this.type != null) { - sb.append(type + ":"); + sb.append(type); } if (this.name != null) { + if (this.type != null) { + sb.append(':'); + } sb.append(name); //sb.append("[" + timestamp + "]"); }