# HG changeset patch # User serb # Date 1524787414 25200 # Node ID 70a63053cf685ba3114020936f4e0c201b1540f1 # Parent 394a0387a3ab3ed8cfa412715d62ecd5f9b975ff 8198342: Test FileSystemViewListenerLeak.java is unstable Reviewed-by: jdv, kaddepalli, psadhukhan diff -r 394a0387a3ab -r 70a63053cf68 test/jdk/ProblemList.txt --- a/test/jdk/ProblemList.txt Thu Apr 26 13:33:11 2018 -0700 +++ b/test/jdk/ProblemList.txt Thu Apr 26 17:03:34 2018 -0700 @@ -672,7 +672,6 @@ javax/swing/JFileChooser/6738668/bug6738668.java 8194946 generic-all javax/swing/JFileChooser/8021253/bug8021253.java 8169954 windows-all,linux-all,macosx-all javax/swing/JFileChooser/8062561/bug8062561.java 8196466 linux-all,macosx-all -javax/swing/JFileChooser/FileSystemView/FileSystemViewListenerLeak.java 8198342 generic-all javax/swing/JInternalFrame/Test6325652.java 8196467 linux-all,macosx-all javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java 8194944 macosx-all javax/swing/JLabel/6596966/bug6596966.java 8040914 macosx-all diff -r 394a0387a3ab -r 70a63053cf68 test/jdk/javax/swing/JFileChooser/FileSystemView/FileSystemViewListenerLeak.java --- a/test/jdk/javax/swing/JFileChooser/FileSystemView/FileSystemViewListenerLeak.java Thu Apr 26 13:33:11 2018 -0700 +++ b/test/jdk/javax/swing/JFileChooser/FileSystemView/FileSystemViewListenerLeak.java Thu Apr 26 17:03:34 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,14 +23,14 @@ import java.io.File; import java.io.IOException; -import java.util.concurrent.TimeUnit; import javax.swing.UIManager; import javax.swing.filechooser.FileSystemView; /** * @test - * @bug 8175968 + * @bug 8175968 8198342 + * @summary FileSystemView should clean listeners in UIManager before removal * @library /javax/swing/regtesthelpers * @build Util * @run main/othervm -Xmx8m -Djava.awt.headless=true FileSystemViewListenerLeak @@ -39,19 +39,11 @@ public static void main(final String[] args) { checkListenersCount(); - test(); + new CustomFileSystemView(); Util.generateOOME(); checkListenersCount(); } - private static void test() { - // Will run the test no more than 30 seconds - long endtime = System.nanoTime() + TimeUnit.SECONDS.toNanos(30); - while (!(endtime - System.nanoTime() < 0)) { - new CustomFileSystemView(); - } - } - private static void checkListenersCount() { int length = UIManager.getPropertyChangeListeners().length; if (length != 0) {