JDK-8227257 : javax/swing/JFileChooser/4847375/bug4847375.java fails with AssertionError
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7,11,13,14,16,17,19,20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86
  • Submitted: 2019-07-04
  • Updated: 2023-08-07
  • Resolved: 2023-01-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 20 JDK 21
11.0.20-oracleFixed 17.0.8-oracleFixed 20.0.2Fixed 21 b06Fixed
Related Reports
Relates :  
Description
Currently the jtreg test javax/swing/JFileChooser/4847375/bug4847375.java fails on Windows (seems it is a Windows only test anyway).
We run into this assertion (on Windows 10, also on Win server 2016 so it is an issue on variuos Windows versions) :

----------System.out:(0/0)----------
----------System.err:(35/2642)----------
java.lang.reflect.InvocationTargetException
	at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1367)
	at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1342)
	at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480)
	at bug4847375.main(bug4847375.java:53)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.lang.AssertionError
	at java.desktop/sun.awt.shell.Win32ShellFolder2$4.call(Win32ShellFolder2.java:440)
	at java.desktop/sun.awt.shell.Win32ShellFolder2$4.call(Win32ShellFolder2.java:438)
	at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:616)
	at java.desktop/sun.awt.shell.ShellFolder.invoke(ShellFolder.java:519)
	at java.desktop/sun.awt.shell.Win32ShellFolder2.getIShellFolder(Win32ShellFolder2.java:438)
	at java.desktop/sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:335)
	at java.desktop/sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:333)
	at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:616)
	at java.desktop/sun.awt.shell.ShellFolder.invoke(ShellFolder.java:519)
	at java.desktop/sun.awt.shell.Win32ShellFolder2.createShellFolder(Win32ShellFolder2.java:333)
	at java.desktop/sun.awt.shell.Win32ShellFolderManager2.createShellFolderFromRelativePIDL(Win32ShellFolderManager2.java:114)
	at java.desktop/sun.awt.shell.Win32ShellFolder2$11.call(Win32ShellFolder2.java:881)
	at java.desktop/sun.awt.shell.Win32ShellFolder2$11.call(Win32ShellFolder2.java:869)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker$1.run(Win32ShellFolderManager2.java:586)
	... 1 more

JavaTest Message: Test threw exception: java.lang.reflect.InvocationTargetException
JavaTest Message: shutting down test
--------------------------------------------------------------------
Comments
Fix request (20u, 17u, 11u) Clean backport. The fix was verified by the new test. all other "java_desktop" tests are green. Review 20u: https://github.com/openjdk/jdk20u/pull/22 Review 17u-dev: https://github.com/openjdk/jdk17u-dev/pull/1213 Review 11u-dev: https://github.com/openjdk/jdk11u-dev/pull/1815
24-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/1815 Date: 2023-03-21 22:40:13 +0000
24-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1213 Date: 2023-03-21 22:30:54 +0000
23-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk20u/pull/22 Date: 2023-03-21 22:03:52 +0000
22-03-2023

I reproduced the problem on my Windows laptop by adding the jtreg tags: * @run main/othervm -ea -esa bug4847375 When the test directs the file chooser to the *Recent* folder, it raises `AssertionError`. The folder contains a handful of link files which point to the new Setting app, the `.lnk` files use "ms-settings:" protocol, the File Explorer displays the target location as "The Internet".
16-01-2023

Changeset: 78b1686c Author: Sergey Bylokhov <serb@openjdk.org> Date: 2023-01-12 01:52:56 +0000 URL: https://git.openjdk.org/jdk/commit/78b1686c150aeaa29c5d969b70c9c42c872246a2
12-01-2023

PR is against mainline, hence targeted to 21
03-01-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11789 Date: 2022-12-26 05:17:30 +0000
26-12-2022

https://mail.openjdk.org/pipermail/awt-dev/2019-November/015495.html
25-12-2022

I was able to reproduce this on one of the systems
25-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11079 Date: 2022-11-10 06:00:27 +0000
10-11-2022

[~psadhukhan] please take it for this test sprint
11-04-2022

I just got the same failure on a personal test job .. which by coincidence (perhaps) ran on the exact same Windows 2016 VM .. so twice in one day on that "host". java.lang.AssertionError at java.desktop/sun.awt.shell.Win32ShellFolder2$4.call(Win32ShellFolder2.java:458) at java.desktop/sun.awt.shell.Win32ShellFolder2$4.call(Win32ShellFolder2.java:456) at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:626) at java.desktop/sun.awt.shell.ShellFolder.invoke(ShellFolder.java:534) at java.desktop/sun.awt.shell.Win32ShellFolder2.getIShellFolder(Win32ShellFolder2.java:456) at java.desktop/sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:352) at java.desktop/sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:350) at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:626) at java.desktop/sun.awt.shell.ShellFolder.invoke(ShellFolder.java:534) at java.desktop/sun.awt.shell.Win32ShellFolder2.createShellFolder(Win32ShellFolder2.java:350) at java.desktop/sun.awt.shell.Win32ShellFolderManager2.createShellFolderFromRelativePIDL(Win32ShellFolderManager2.java:116) at java.desktop/sun.awt.shell.Win32ShellFolder2$11.call(Win32ShellFolder2.java:900) at java.desktop/sun.awt.shell.Win32ShellFolder2$11.call(Win32ShellFolder2.java:888) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker$1.run(Win32ShellFolderManager2.java:595) at java.base/java.lang.Thread.run(Thread.java:828) STATUS:Failed.`main' threw exception: java.lang.AssertionError
28-03-2022

Here's a log file snippet from the jdk-19+16-1012-tier3 sighting: javax/swing/JFileChooser/4847375/bug4847375.java #section:main ----------messages:(5/349)---------- command: main bug4847375 reason: Assumed action based on file name: run main bug4847375 Mode: othervm Additional options from @modules: --add-modules java.desktop --add-exports java.desktop/sun.awt=ALL-UNNAMED --add-exports java.desktop/sun.awt.shell=ALL-UNNAMED --add-opens java.desktop/sun.awt.shell=ALL-UNNAMED elapsed time (seconds): 1.37 ----------configuration:(6/223)---------- Boot Layer add modules: java.desktop add exports: java.desktop/sun.awt ALL-UNNAMED java.desktop/sun.awt.shell ALL-UNNAMED add opens: java.desktop/sun.awt.shell ALL-UNNAMED ----------System.out:(0/0)---------- ----------System.err:(20/1708)---------- java.lang.AssertionError at java.desktop/sun.awt.shell.Win32ShellFolder2$4.call(Win32ShellFolder2.java:458) at java.desktop/sun.awt.shell.Win32ShellFolder2$4.call(Win32ShellFolder2.java:456) at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:626) at java.desktop/sun.awt.shell.ShellFolder.invoke(ShellFolder.java:534) at java.desktop/sun.awt.shell.Win32ShellFolder2.getIShellFolder(Win32ShellFolder2.java:456) at java.desktop/sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:352) at java.desktop/sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:350) at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker.invoke(Win32ShellFolderManager2.java:626) at java.desktop/sun.awt.shell.ShellFolder.invoke(ShellFolder.java:534) at java.desktop/sun.awt.shell.Win32ShellFolder2.createShellFolder(Win32ShellFolder2.java:350) at java.desktop/sun.awt.shell.Win32ShellFolderManager2.createShellFolderFromRelativePIDL(Win32ShellFolderManager2.java:116) at java.desktop/sun.awt.shell.Win32ShellFolder2$11.call(Win32ShellFolder2.java:900) at java.desktop/sun.awt.shell.Win32ShellFolder2$11.call(Win32ShellFolder2.java:888) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.desktop/sun.awt.shell.Win32ShellFolderManager2$ComInvoker$1.run(Win32ShellFolderManager2.java:595) at java.base/java.lang.Thread.run(Thread.java:828) STATUS:Failed.`main' threw exception: java.lang.AssertionError ----------rerun:(44/4874)*----------
28-03-2022

We run the jtreg tests with assertions enabled (jtreg flags -ea -esa) , so we see this assertion . Looked a bit more into this . The assertion occured when handling in the isDirectory - method of Win32ShellFolder2 the ShellFolder with display name "The Internet" which has attribute ATTRIB_BROWSABLE but not ATTRIB_FOLDER set.
05-09-2019

btw for a test I disabled the assertion at Win32ShellFolder2.java:440 , then the test passes . private long getIShellFolder() { if (disposer.pIShellFolder == 0) { try { disposer.pIShellFolder = invoke(new Callable<Long>() { public Long call() { // avoid this assertion // assert(isDirectory());
04-07-2019