JDK-8204221 : ItemEvent for selection & deselection of multi select List's item is not correct
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 10,11,17,21,23,24,25
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x,windows_10
  • CPU: x86_64
  • Submitted: 2018-05-31
  • Updated: 2025-01-23
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.
Other
tbdUnresolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Microsoft Windows [Version 10.0.16299.371]

Sierra
Darwin unit 12.6.0 Darwin Kernel Version 12.6.0: Wed Mar 18 16:23:48 PDT 2015; root:xnu-2050.48.19~1/RELEASE_X86_64 x86_64



A DESCRIPTION OF THE PROBLEM :
The test java/awt/List/ItemEventTest/ItemEventTest.java fails on Windows and MacOS Sierra with the message "ItemEvent for selection & deselection of multi select List's item is not correct Expected : 01230123 Actual : "
The issue was not observed on Linux, MacOS HighSierra

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
$ jtreg -testjdk:/cygdrive/c/Program\ Files/Java/jdk-10.0.1 -javaoptions:"-Djava.awt.headless=false" -timeoutFactor:2 test/java/awt/List/ItemEventTest/ItemEventTest.java

ACTUAL -
#section:main
----------messages:(5/205)----------
command: main ItemEventTest
reason: Assumed action based on file name: run main ItemEventTest 
Mode: othervm
Additional options from @modules: --add-modules java.desktop
elapsed time (seconds): 0.987
----------configuration:(3/43)----------
Boot Layer
  add modules: java.desktop

----------System.out:(0/0)----------
----------System.err:(15/1198)----------
java.lang.RuntimeException: ItemEvent for selection & deselection of multi select List's item is not correct Expected : 01230123 Actual : 
	at ItemEventTest.performTest(ItemEventTest.java:133)
	at ItemEventTest.testHandleEvent(ItemEventTest.java:88)
	at ItemEventTest.main(ItemEventTest.java:142)
	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:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:844)

JavaTest Message: Test threw exception: java.lang.RuntimeException: ItemEvent for selection & deselection of multi select List's item is not correct Expected : 01230123 Actual : 
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: ItemEvent for selection & deselection of multi select List's item is not correct Expected : 01230123 Actual :

---------- BEGIN SOURCE ----------
http://hg.openjdk.java.net/jdk10/jdk10/jdk/file/777356696811/test/java/awt/List/ItemEventTest/ItemEventTest.java
---------- END SOURCE ----------

FREQUENCY : always



Comments
I attached a tiled image with the screenshots taken after each mousePress and mouseRelease pair which I got by the modified version of the test in JDK-8348299. As you can see in ItemEventTest-sequence.png, the items in the list are selected and deselected as expected, yet no events are dispatched. The test passes if I comment out test.testHandleEvent(), which means the events aren't received via the overridden `handleEvent` method. If ItemListener is added to the list, the events are received.
22-01-2025

This is frequently failing in the CI in tier 4.
16-01-2025

Here's a log file snippet from the jdk-24+11-1093-tier4 sighting: java/awt/List/ItemEventTest/ItemEventTest.java #section:main ----------messages:(7/277)---------- command: main ItemEventTest reason: Assumed action based on file name: run main ItemEventTest started: Fri Aug 09 08:59:55 GMT 2024 Mode: othervm Additional options from @modules: --add-modules java.desktop finished: Fri Aug 09 08:59:57 GMT 2024 elapsed time (seconds): 1.879 ----------configuration:(3/40)---------- Boot Layer add modules: java.desktop ----------System.out:(0/0)---------- ----------System.err:(13/995)---------- java.lang.RuntimeException: ItemEvent for selection & deselection of multi select List's item is not correct Expected : 01230123 Actual : at ItemEventTest.performTest(ItemEventTest.java:133) at ItemEventTest.testHandleEvent(ItemEventTest.java:88) at ItemEventTest.main(ItemEventTest.java:142) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:588) at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) at java.base/java.lang.Thread.run(Thread.java:1575) JavaTest Message: Test threw exception: java.lang.RuntimeException: ItemEvent for selection & deselection of multi select List's item is not correct Expected : 01230123 Actual : JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.lang.RuntimeException: ItemEvent for selection & deselection of multi select List's item is not correct Expected : 01230123 Actual : ----------rerun:(45/6203)*----------
09-08-2024

Closing this as Cannot reproduce. However, in case there is any other information that could help reproduce this case, share same as additional information.
01-06-2018

The test passed successfully when checked with JDK 10.0.1 and 11 ea b15 in windows 10. Results: ======= $ java -jar jtreg.jar -testjdk:"C:\Program Files\Java\jdk-10.0.1" -javaoptions:"-Djava.awt.headless=false" -timeoutFactor:2 "D:\jdk10-dev\test\jdk\java\awt\List\ItemEventTest\ItemEventTest.java" Test results: passed: 1 $ jtreg -v -testjdk:/cygdrive/c/Program\ Files/Java/jdk-11 -javaoptions:"-Djava.awt.headless" /cygdrive/d/source/11dev/test/jdk/java/awt/List/ItemEventTest/ItemEventTest.java runner starting test: java/awt/List/ItemEventTest/ItemEventTest.java runner finished test: java/awt/List/ItemEventTest/ItemEventTest.java Passed. Execution successful Test results: passed: 1
01-06-2018