diff options
author | John Ross | 2012-02-19 16:16:56 +0000 |
---|---|---|
committer | John Ross | 2012-02-19 16:16:56 +0000 |
commit | bfa09835111c8cad6ba9e3f0253329754dcb02d1 (patch) | |
tree | 6a78817a353f4248786170cf44a0731d8ed63481 | |
parent | a412d9bf7bd8873b9215aa8c2353367920d6582f (diff) | |
download | rt.equinox.bundles-bfa09835111c8cad6ba9e3f0253329754dcb02d1.tar.gz rt.equinox.bundles-bfa09835111c8cad6ba9e3f0253329754dcb02d1.tar.xz rt.equinox.bundles-bfa09835111c8cad6ba9e3f0253329754dcb02d1.zip |
Bug 371980: Participants are now notified in reverse participation order when ending or failing a coordination.v20120219-1616
-rw-r--r-- | bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinationImpl.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinationImpl.java b/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinationImpl.java index ac39a6c56..a597aac9b 100644 --- a/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinationImpl.java +++ b/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinationImpl.java @@ -156,7 +156,9 @@ public class CoordinationImpl { Exception exception = null; // No additional synchronization is needed here because the participant // list will not be modified post termination. - for (Participant participant : participants) { + List<Participant> participantsToNotify = new ArrayList<Participant>(this.participants); + Collections.reverse(participantsToNotify); + for (Participant participant : participantsToNotify) { try { participant.ended(referent); } catch (Exception e) { @@ -261,7 +263,9 @@ public class CoordinationImpl { // Notify participants this coordination has failed. // No additional synchronization is needed here because the participant // list will not be modified post termination. - for (Participant participant : participants) { + List<Participant> participantsToNotify = new ArrayList<Participant>(this.participants); + Collections.reverse(participantsToNotify); + for (Participant participant : participantsToNotify) { try { participant.failed(referent); } catch (Exception e) { |