JDK-8230926 : [macosx] Two apostrophes are entered instead of one with "U.S. International - PC" layout
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7,8u221,11,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2019-09-12
  • Updated: 2022-06-27
  • Resolved: 2020-01-13
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 13 JDK 15 JDK 8 Other
11.0.7-oracleFixed 13.0.4Fixed 15 b07Fixed 8u251Fixed openjdk8u262Fixed
Related Reports
Duplicate :  
Relates :  
Description
ADDITIONAL OS VERSION INFORMATION :
macOS 10.13.3

A DESCRIPTION OF THE PROBLEM :
Two apostrophe characters are entered in a text field instead of one with "U.S. International - PC" keyboard layout, if a user types one apostrophe character followed by one consonant Latin letter.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Go to "System Preferences -> Keyboard -> Input Sources" and add "U.S. International - PC".
2. Compile and run the test case, whose code is provided below.
3. Press apostrophe key " ' ", press any consonant Latin letter key, for example " d " key on a keyboard.

The bug is reproduced, if two apostrophe characters ('') are entered in the text field.

---------- BEGIN SOURCE ----------
import javax.swing.*;
  
public class JTextFieldTest {
    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                JFrame frame = new JFrame();
                frame.add(new JTextField(20));
                frame.pack();
                frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                frame.setVisible(true);
                frame.setLocationRelativeTo(null);
            }
        });
    }
}
---------- END SOURCE ----------
Comments
Fix request (13u) Requesting backport to 13u for parity with 11u, applies cleanly.
04-06-2020

Fix Request (jdk8u) I would like to request a backport of this to openjdk8, as well. The fix (I used the patch for 11u) applies without issue, modulo directory names. I reproduced the issue on an older JDK, and verified that the patch fixes it in 8u-dev. This is also for parity with Oracle JDK.
20-03-2020

jdk11 downport request I would like to have the patch in openjdk11 as well, because it is a part of 11.0.7-oracle. The patch applies cleanly to 11u.
28-02-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/abd50a05d1d1 User: psadhukhan Date: 2020-01-22 08:47:51 +0000
22-01-2020

URL: https://hg.openjdk.java.net/jdk/client/rev/abd50a05d1d1 User: alitvinov Date: 2020-01-13 18:13:18 +0000
13-01-2020

The same bug affects 4 other modifier keys in "U.S. International - PC" layout. They are: 1) " (QUOTATION MARK) 2) ` (ACCENT GRAVE) 3) ˜ (SMALL TILDE) 4) ˆ (MODIFIER LETTER CIRCUMFLEX ACCENT)
16-12-2019

After thorough debugging of JDK 14 code I come to a final conclusion that the fix for JDK-8180370 which caused this behavior change, is correct, and in fact it just uncovered the previously not manifesting problem. Removing the labels: "regression", "regression_8180370". Trying to identify the reason of, why instead of the expected consonant letter the previously handled apostrophe character is passed through keyboard events handling mechanism.
01-11-2019

The issue appeared in JDK 8u162 b03 and was introduced by the fix for the bug JDK-8180370. It was practically proven with JDK 14 complied from the source code in the repository "http://hg.openjdk.java.net/jdk/client" that reversion of the fix JDK-8180370 eliminates this new issue.
12-09-2019