Issue2241

classification
Title: java.util.Set derived classes lack set methods
Type: Severity: normal
Components: Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: zyasoft
Priority: urgent Keywords:

Created on 2014-12-27.17:21:39 by zyasoft, last changed 2015-01-04.17:04:25 by zyasoft.

Messages
msg9269 (view) Author: Jim Baker (zyasoft) Date: 2014-12-27.17:21:38
Objects that implement java.util.Set when proxied from Python should have standard set methods and semantics.

Making urgent: this fix needs to be in beta 4 because of the backwards breaking change in overriding remove so it has Python, not Java semantics, and raises KeyError if object is not present:

>>> from java.util import TreeSet
>>> x = TreeSet(xrange(0, 10, 2))
>>> x
[0, 2, 4, 6, 8]
>>> x.remove(9)
False   # should raise KeyError
>>> x.remove(6)
True    # should return None
>>> x.add(5)
True
>>> x
[0, 2, 4, 5, 8] # ordering is maintained, nice!

As usual, we expect the standard test suite in test_set will pass, with only a small number of changes.

Related and now fixed bugs include for java.util.Map (http://bugs.jython.org/issue1631) and java.util.List (http://bugs.jython.org/issue2215)
msg9273 (view) Author: Jim Baker (zyasoft) Date: 2014-12-30.06:45:22
Fixed as of https://hg.python.org/jython/rev/07959ff1d8e9
History
Date User Action Args
2015-01-04 17:04:25zyasoftsetstatus: pending -> closed
2014-12-30 06:45:22zyasoftsetstatus: open -> pending
resolution: fixed
messages: + msg9273
2014-12-27 17:21:39zyasoftcreate