summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-05-24 11:52:07 (EDT)
committer pelder2006-05-24 11:52:07 (EDT)
commit88365ae5aee2fe963d617c37515a1c70b162f028 (patch)
tree8d384c2339e7fbe0d00a8c754c857cdf1bf67f51
parente415612c1960f99c403f612ca4f966f9881f5a8a (diff)
downloadorg.eclipse.jet-88365ae5aee2fe963d617c37515a1c70b162f028.zip
org.eclipse.jet-88365ae5aee2fe963d617c37515a1c70b162f028.tar.gz
org.eclipse.jet-88365ae5aee2fe963d617c37515a1c70b162f028.tar.bz2
[143499] Use LinkedHashMap to guarantee listener execution order. Update javadoc to indicate that execution order is guaranteed.
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Writer.java4
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
index 3dd063e..3751bcc 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
@@ -19,8 +19,8 @@ package org.eclipse.jet;
import java.util.Collections;
-import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.Map;
import org.eclipse.jet.internal.InternalJET2Platform;
@@ -54,7 +54,7 @@ public class BodyContentWriter implements JET2Writer
{
super();
parentWriter = null;
- listeners = new HashMap(5);
+ listeners = new LinkedHashMap(5); // ensure listeners are returned in the order they are added...
}
/**
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Writer.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Writer.java
index e9ccbd8..493c96d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Writer.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Writer.java
@@ -120,6 +120,8 @@ public interface JET2Writer
/**
* Finalize the writers contents. Once finalized, no more content may be written to the writer.
* Calls {@link IWriterListener#finalizeContent(JET2Writer, Object)} on all registered listeners.
+ * Listeners are called in the
+ * order in which the listeners were registered via {@link #addEventListener(String, IWriterListener)}.
* <p>
* The type of <code>file</code> varies depending on the context in which the content
* is finalized. The standard JET2 Workspace tags pass an org.eclipse.core.resources.IFile.
@@ -133,6 +135,8 @@ public interface JET2Writer
/**
* Inform listeners that the content has been committed to some permanent store.
* Calls {@link IWriterListener#postCommitContent(JET2Writer, Object)} on all registered listeners.
+ * Listeners are called in the
+ * order in which the listeners were registered via {@link #addEventListener(String, IWriterListener)}.
* <p>
* The type of <code>committedObject</code> varies, depending on the context in which the content
* is committed. The standard JET2 Workspace tags pass an org.eclipse.core.resources.IFile.