src/share/classes/sun/awt/datatransfer/DataTransferer.java
Print this page
@@ -2896,25 +2896,26 @@
class2, UNKNOWN_OBJECT_LOSES);
if (comp != 0) {
return comp;
}
} else {
- // First, prefer application types.
- comp = compareIndices(primaryTypes, primaryType1, primaryType2,
- UNKNOWN_OBJECT_LOSES);
- if (comp != 0) {
- return comp;
- }
-
+ // First, prefer text types
if (flavor1.isFlavorTextType()) {
return 1;
}
if (flavor2.isFlavorTextType()) {
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.
comp = compareIndices(exactTypes, mimeType1, mimeType2,
UNKNOWN_OBJECT_WINS);