From 2bafac38a7f8f2fdf6379740135899460f67821a Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Sat, 9 Mar 2013 14:24:34 +0000 Subject: [PATCH] [COLLECTIONS-445] Clarify that the behavior of IBM JDK is not really a bug, Map.Entry specifies that its behavior is undefined if the backing map is modified. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1454717 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/collections/bidimap/DualTreeBidiMap.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/collections/bidimap/DualTreeBidiMap.java b/src/main/java/org/apache/commons/collections/bidimap/DualTreeBidiMap.java index f9a934951..7f622cd08 100644 --- a/src/main/java/org/apache/commons/collections/bidimap/DualTreeBidiMap.java +++ b/src/main/java/org/apache/commons/collections/bidimap/DualTreeBidiMap.java @@ -363,8 +363,9 @@ public class DualTreeBidiMap extends AbstractDualBidiMap "Cannot use setValue() when the object being set is already in the map"); } final V oldValue = parent.put(last.getKey(), value); - // set also the value in the Map.Entry: - // due to a bug in IBM JDK where the Entry is not in sync with the underlying map + // Map.Entry specifies that the behavior is undefined when the backing map + // has been modified (as we did with the put), so we also set the value + // (especially needed for IBM JDK) last.setValue(value); return oldValue; }