Hi Jason,
I've commented in the bug report:
Couldn't reproduce locally.
Please next time the problem is reproduced on your side, run the small
program below and attach its output to this bug (or file a new one).
Make sure NOT using the system clipboard from the moment of exception
till running the test program.
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
public class ClipboardDump {
public static void main(String[] args) {
System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");
DataFlavor[] dataFlavors =
Toolkit.getDefaultToolkit().getSystemClipboard().
getAvailableDataFlavors();
for (DataFlavor df: dataFlavors) {
System.out.println(df);
}
}
}
Please also make sure you are running 7u80 (not an earlier version)
since the Comparator fix was integrated to 7u80
Thanks!
Anton.
On 21.04.2015 17:29, Jason Mehrens wrote:
Hello Swing-Dev,
Recently we have updated to JDK7u80 and have noticed a pattern of users
generating the following error:
==================
java.lang.IllegalArgumentException: Comparison method violates its general
contract!
at java.util.TimSort.mergeHi(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at
sun.awt.datatransfer.DataTransferer.setToSortedDataFlavorArray(Unknown Source)
at sun.awt.datatransfer.ClipboardTransferable.<init>(Unknown
Source)
at sun.awt.datatransfer.SunClipboard.getContents(Unknown
Source)
at
javax.swing.TransferHandler$TransferAction.actionPerformedImpl(Unknown Source)
at
javax.swing.TransferHandler$TransferAction.access$700(Unknown Source)
at javax.swing.TransferHandler$TransferAction$1.run(Unknown
Source)
at javax.swing.TransferHandler$TransferAction$1.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at javax.swing.TransferHandler$TransferAction$2.run(Unknown
Source)
at javax.swing.TransferHandler$TransferAction$2.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at
javax.swing.TransferHandler$TransferAction.actionPerformed(Unknown Source)
at javax.swing.text.JTextComponent.invokeAction(Unknown Source)
at javax.swing.text.JTextComponent.paste(Unknown Source)
at
javax.swing.text.DefaultEditorKit$PasteAction.actionPerformed(Unknown Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown
Source)
at
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$300(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
=============
When I check the issue tracker http://bugs.java.com/view_bug.do?bug_id=8023043
shows as fixed in 7u60. Did this get fixed in 7u60 through 7u80? The
stacktrace is a little different from that bug so should I file this as a new
issue?
Thanks,
Jason