JDK-8282234 : Create a regression test for JDK-4532513
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8,11,17,18,19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2022-02-22
  • Updated: 2022-07-25
  • Resolved: 2022-03-08
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 19 JDK 8
11.0.17-oracleFixed 17.0.5-oracleFixed 19 b13Fixed 8u351Fixed
Related Reports
Relates :  
Description
Create a regression test for JDK-4532513.
This test verifies that the DefaultCaret doesn't requests focus in mouseClick and mousePressed causing the associated input verifier to fire twice.
As per JDK-4532513, the DefaultCaret requests focus in mouseClick and mousePressed causing the associated input verifier to fire twice. 
This issue was raised in JDK 1.4.0 and fixed in 1.4.1, so the test need to be failed in 1.4.0 and must pass in 1.4.1.

Testing:

In JDK 1.4.0:
$ ./j2sdk1.4.0/bin/java DefaultCaretWin
Testing L&F: javax.swing.plaf.metal.MetalLookAndFeel
shouldYieldFocus called 1
shouldYieldFocus called 2
shouldYieldFocus called 3
java.lang.RuntimeException: Test failed for javax.swing.plaf.metal.MetalLookAndFeel as InputVerifier.shouldYieldFocus() getting called 3 times on jTextField2, but it is expected to call only once.
        at DefaultCaretWin.runTest(DefaultCaretWin.java:114)
        at DefaultCaretWin.main(DefaultCaretWin.java:58)

In JDK 1.4.1:
$ ./j2sdk1.4.1/bin/java DefaultCaretWin
Testing L&F: javax.swing.plaf.metal.MetalLookAndFeel
shouldYieldFocus called 1
Test passed for laf: javax.swing.plaf.metal.MetalLookAndFeel
Testing L&F: com.sun.java.swing.plaf.motif.MotifLookAndFeel
shouldYieldFocus called 1
Test passed for laf: com.sun.java.swing.plaf.motif.MotifLookAndFeel
Testing L&F: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
shouldYieldFocus called 1
Test passed for laf: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Comments
Fix request [11u/17u] I backport this for parity with 11.0.17&17.0.5-oracle. No risk, only a test change. Clean backport. Test passes. SAP nightly testing passed.
23-07-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/587 Date: 2022-07-22 10:44:54 +0000
22-07-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/1260 Date: 2022-07-22 10:41:54 +0000
22-07-2022

Changeset: 6b34884b Author: Manukumar V S <mvs@openjdk.org> Committer: Alexey Ivanov <aivanov@openjdk.org> Date: 2022-03-08 17:01:03 +0000 URL: https://git.openjdk.java.net/jdk/commit/6b34884b34c4d84a1b5cfa3556a188415a42b1de
08-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7577 Date: 2022-02-22 15:47:20 +0000
22-02-2022