test/java/awt/Focus/SortingFPT/JDK8048887.java
Print this page
*** 24,34 ****
/*
@test
@bug 8048887
@summary Tests SortingFTP for an exception caused by the tim-sort algo.
@author anton.tarasov: area=awt.focus
! @run main JDK8040632
*/
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
--- 24,34 ----
/*
@test
@bug 8048887
@summary Tests SortingFTP for an exception caused by the tim-sort algo.
@author anton.tarasov: area=awt.focus
! @run main JDK8048887
*/
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
*** 51,63 ****
}
public void start() {
final CountDownLatch latch = new CountDownLatch(1);
! SwingUtilities.invokeLater(() -> {
// Catch the original exception which sounds like:
// java.lang.IllegalArgumentException: Comparison method violates its general contract!
Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread t, Throwable e) {
e.printStackTrace();
if (e instanceof IllegalArgumentException) {
passed = false;
--- 51,66 ----
}
public void start() {
final CountDownLatch latch = new CountDownLatch(1);
! SwingUtilities.invokeLater(new Runnable(){
! @Override
! public void run(){
// Catch the original exception which sounds like:
// java.lang.IllegalArgumentException: Comparison method violates its general contract!
+
Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread t, Throwable e) {
e.printStackTrace();
if (e instanceof IllegalArgumentException) {
passed = false;
*** 73,82 ****
--- 76,88 ----
public void windowGainedFocus(WindowEvent e) {
latch.countDown();
}
});
d.setVisible(true);
+
+
+ }
});
try {
latch.await(5, TimeUnit.SECONDS);
} catch (InterruptedException e) {