[Jython-checkins] jython: Ensure __subclasses__() has stable ordering. Fixes #2514

jim.baker jython-checkins at python.org
Tue Sep 6 00:45:42 EDT 2016


https://hg.python.org/jython/rev/ed451b497499
changeset:   7961:ed451b497499
user:        Jim Baker <jim.baker at rackspace.com>
date:        Mon Sep 05 22:45:39 2016 -0600
summary:
  Ensure __subclasses__() has stable ordering. Fixes #2514

Missing change from previous commit.

files:
  src/org/python/util/Generic.java |  8 ++++++++
  1 files changed, 8 insertions(+), 0 deletions(-)


diff --git a/src/org/python/util/Generic.java b/src/org/python/util/Generic.java
--- a/src/org/python/util/Generic.java
+++ b/src/org/python/util/Generic.java
@@ -4,6 +4,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -70,6 +71,13 @@
     }
 
     /**
+     * Makes a LinkedHashSet using the generic type inferred from whatever this is being assigned to.
+     */
+    public static <E> Set<E> linkedHashSet() {
+        return new LinkedHashSet<E>();
+    }
+
+    /**
      * Makes a Set using the generic type inferred from whatever this is being assigned to filled
      * with the items in <code>contents</code>.
      */

-- 
Repository URL: https://hg.python.org/jython


More information about the Jython-checkins mailing list