src/share/classes/java/awt/datatransfer/SystemFlavorMap.java
Print this page
@@ -174,11 +174,12 @@
* Dynamic mapping generation used for text mappings should not be applied
* to the DataFlavors and String natives for which the mappings have been
* explicitly specified with setFlavorsForNative() or
* setNativesForFlavor(). This keeps all such keys.
*/
- private Set disabledMappingGenerationKeys = new HashSet();
+ // Holds String and DataFlavor objects
+ private Set<Object> disabledMappingGenerationKeys = new HashSet<>();
/**
* Returns the default FlavorMap for this thread's ClassLoader.
* @return the default FlavorMap for this thread's ClassLoader
*/
@@ -699,11 +700,11 @@
// flavormap.properties are stored per flavor's base type.
if ("text".equals(flav.getPrimaryType())) {
retval = getAllNativesForType(flav.mimeType.getBaseType());
if (retval != null) {
// To prevent the List stored in the map from modification.
- retval = new ArrayList(retval);
+ retval = new ArrayList<>(retval);
}
}
// Also include text/plain natives, but don't duplicate Strings
List<String> textPlainList = getAllNativesForType(TEXT_PLAIN_BASE_TYPE);
@@ -1000,11 +1001,11 @@
{
// Use getNativesForFlavor to generate extra natives for text flavors
// and stringFlavor
if (flavors == null) {
- List flavor_list = getFlavorsForNative(null);
+ List<DataFlavor> flavor_list = getFlavorsForNative(null);
flavors = new DataFlavor[flavor_list.size()];
flavor_list.toArray(flavors);
}
Map<DataFlavor, String> retval = new HashMap<>(flavors.length, 1.0f);
@@ -1045,11 +1046,11 @@
getFlavorsForNatives(String[] natives)
{
// Use getFlavorsForNative to generate extra flavors for text natives
if (natives == null) {
- List native_list = getNativesForFlavor(null);
+ List<String> native_list = getNativesForFlavor(null);
natives = new String[native_list.size()];
native_list.toArray(natives);
}
Map<String, DataFlavor> retval = new HashMap<>(natives.length, 1.0f);