-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
hopper
-
x86
-
windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2050970 | 1.4.0 | Josh Bloch | P3 | Resolved | Fixed | fcs |
Name: jl125535 Date: 01/23/2002
FULL PRODUCT VERSION :
java version "1.4.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b91)
Java HotSpot(TM) Client VM (build 1.4.0-rc-b91, mixed mode)
FULL OPERATING SYSTEM VERSION : Bug in java code, will
occur in any OS.
ADDITIONAL OPERATING SYSTEMS : Any
EXTRA RELEVANT SYSTEM CONFIGURATION :
None needed.
A DESCRIPTION OF THE PROBLEM :
Bug is obvious by looking at the source code for
java.util.HashMap.Entry.setValue() (note that line numbers
included below correspond to the HashMap.java file
distributed with J2SDK 1.4.0-rc):
653 public Object setValue(Object newValue) {
654 Object oldValue = newValue;
655 value = newValue;
656 return oldValue;
657 }
Whereas the documentation for java.util.Map.Entry.setValue
() states that the previous value should be returned
instead:
Returns:
old value corresponding to the entry.
This bug can be reproduced always.
(Review ID: 138639)
======================================================================
- backported by
-
JDK-2050970 java.util.HashMap.Entry.setValue() returns new value (as opposed to old)
-
- Resolved
-