--- old/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java 2015-07-06 14:01:38.176534000 +0300 +++ new/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java 2015-07-06 14:01:37.633534000 +0300 @@ -574,14 +574,7 @@ return comp; } } else { - // First, prefer application types. - comp = compareIndices(primaryTypes, primaryType1, primaryType2, - UNKNOWN_OBJECT_LOSES); - if (comp != 0) { - return comp; - } - - // Next prefer text types + // First, prefer text types if (flavor1.isFlavorTextType()) { return 1; } @@ -590,6 +583,13 @@ return -1; } + // Next, prefer application types. + comp = compareIndices(primaryTypes, primaryType1, primaryType2, + UNKNOWN_OBJECT_LOSES); + if (comp != 0) { + return comp; + } + // Next, look for application/x-java-* types. Prefer unknown // MIME types because if the user provides his own data flavor, // it will likely be the most descriptive one.