jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java
changeset 21598 b0de5e2762ed
parent 21251 bf72e65e6f91
child 22281 830790e8640d
--- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Wed Nov 13 20:16:43 2013 +0400
+++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Thu Nov 14 10:52:19 2013 +0400
@@ -40,7 +40,6 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
@@ -1321,16 +1320,16 @@
     }
 
     private List<String> getAllNativesForType(String type) {
-        List<String> retval = null;
+        Set<String> retval = null;
         for (DataFlavor dataFlavor : convertMimeTypeToDataFlavors(type)) {
             List<String> natives = getFlavorToNative().get(dataFlavor);
             if (natives != null && !natives.isEmpty()) {
                 if (retval == null) {
-                    retval = new ArrayList<>();
+                    retval = new LinkedHashSet<>();
                 }
                 retval.addAll(natives);
             }
         }
-        return retval;
+        return retval == null ? null : new ArrayList<>(retval);
     }
 }