JDK-6441058 : (coll) TreeSet.add(): specified NPE behaviour inconsistent with implementation
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-20
  • Updated: 2012-10-08
  • Resolved: 2006-06-23
Related Reports
Duplicate :  
Description
CR 5045147 was closed with resolution "will not fix". 
At the same time new(updated in Mustang) specification for methods TreeSet.add(E o)
says: "NullPointerException - if the specified element is null and this set uses natural ordering,
or its comparator does not permit null elements".
Hence the current spec contradicts to the implementation.
*** (#1 of 1): [ UNSAVED ] ###@###.###

Comments
EVALUATION It's difficult to come up with an implementation that is sufficiently backward-compatible and a spec that has enough weasel words to permit the current undesirable but backward-compatible implementation.
20-06-2006