From: <pj...@us...> - 2009-10-30 23:53:43
|
Revision: 6934 http://jython.svn.sourceforge.net/jython/?rev=6934&view=rev Author: pjenvey Date: 2009-10-30 23:53:24 +0000 (Fri, 30 Oct 2009) Log Message: ----------- remove the unneeded Generics workaround and always specify the cached TYPE to BaseSet Modified Paths: -------------- trunk/jython/src/org/python/core/BaseSet.java trunk/jython/src/org/python/core/PyFrozenSet.java trunk/jython/src/org/python/core/PySet.java Modified: trunk/jython/src/org/python/core/BaseSet.java =================================================================== --- trunk/jython/src/org/python/core/BaseSet.java 2009-10-30 01:34:16 UTC (rev 6933) +++ trunk/jython/src/org/python/core/BaseSet.java 2009-10-30 23:53:24 UTC (rev 6934) @@ -12,12 +12,8 @@ protected Set<PyObject> _set; /** - * Create a new Python set instance from the specified Set object. + * Create a new Python set of type from the specified Set object. */ - protected BaseSet(Set<PyObject> set) { - _set = set; - } - protected BaseSet(PyType type, Set<PyObject> set) { super(type); _set = set; Modified: trunk/jython/src/org/python/core/PyFrozenSet.java =================================================================== --- trunk/jython/src/org/python/core/PyFrozenSet.java 2009-10-30 01:34:16 UTC (rev 6933) +++ trunk/jython/src/org/python/core/PyFrozenSet.java 2009-10-30 23:53:24 UTC (rev 6934) @@ -15,11 +15,11 @@ public static final PyType TYPE = PyType.fromClass(PyFrozenSet.class); public PyFrozenSet() { - super(new HashSet<PyObject>()); + super(TYPE, new HashSet<PyObject>()); } public PyFrozenSet(PyObject data) { - super(_update(new HashSet<PyObject>(), data)); + this(TYPE, data); } public PyFrozenSet(PyType type, PyObject data) { Modified: trunk/jython/src/org/python/core/PySet.java =================================================================== --- trunk/jython/src/org/python/core/PySet.java 2009-10-30 01:34:16 UTC (rev 6933) +++ trunk/jython/src/org/python/core/PySet.java 2009-10-30 23:53:24 UTC (rev 6934) @@ -2,7 +2,6 @@ import java.util.Iterator; import java.util.NoSuchElementException; -import java.util.Set; import org.python.expose.ExposedMethod; import org.python.expose.ExposedNew; @@ -16,22 +15,17 @@ public static final PyType TYPE = PyType.fromClass(PySet.class); public PySet() { - super(concurrentSet()); + this(TYPE); } public PySet(PyType type) { - super(type, concurrentSet()); + super(type, Generic.<PyObject>concurrentSet()); } public PySet(PyObject data) { - super(_update(concurrentSet(), data)); + super(TYPE, _update(Generic.<PyObject>concurrentSet(), data)); } - /** Contextualize the needed Set<PyObject> type paramaters (generics workaround). */ - private static Set<PyObject> concurrentSet() { - return Generic.concurrentSet(); - } - @ExposedNew @ExposedMethod(doc = BuiltinDocs.set___init___doc) final void set___init__(PyObject[] args, String[] kwds) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |