[Jython-checkins] jython: Removed unused imports in Generic.java and fixed some warnings.

stefan.richthofer jython-checkins at python.org
Sat Jan 3 21:20:19 CET 2015


https://hg.python.org/jython/rev/7516a8779510
changeset:   7493:7516a8779510
user:        Stefan Richthofer <stefan.richthofer at gmx.de>
date:        Sat Jan 03 21:20:07 2015 +0100
summary:
  Removed unused imports in Generic.java and fixed some warnings.

files:
  Lib/test/regrtest.py             |   3 +++
  src/org/python/util/Generic.java |  14 +++++---------
  2 files changed, 8 insertions(+), 9 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1314,6 +1314,9 @@
         test_peepholer
         test_pyclbr
         test_pyexpat
+        test_select
+        test_select_new
+        test_socket
         test_stringprep
         test_threadsignals
         test_transformer
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
@@ -1,19 +1,12 @@
 package org.python.util;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.Serializable;
-import java.util.AbstractSet;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.WeakHashMap;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
@@ -39,11 +32,13 @@
     public static <T> List<T> list() {
         return new ArrayList<T>();
     }
+
     /**
      * Makes a List with its generic type inferred from whatever it's being assigned to filled with
      * the items in <code>contents</code>.
      */
-    public static <T, U extends T> List<T> list(U...contents) {
+    @SafeVarargs
+    public static <T, U extends T> List<T> list(U... contents) {
         List<T> l = new ArrayList<T>(contents.length);
         for (T t : contents) {
             l.add(t);
@@ -78,7 +73,8 @@
      * Makes a Set using the generic type inferred from whatever this is being assigned to filled
      * with the items in <code>contents</code>.
      */
-    public static <T, U extends T> Set<T> set(U...contents) {
+    @SafeVarargs
+    public static <T, U extends T> Set<T> set(U... contents) {
         Set<T> s = new HashSet<T>(contents.length);
         for (U u : contents) {
             s.add(u);

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


More information about the Jython-checkins mailing list