-
Bug
-
Resolution: Fixed
-
P3
-
9
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8175780 | 10 | Philip Race | P3 | Resolved | Fixed | b02 |
FULL PRODUCT VERSION :
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+152)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+152, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.14393]
A DESCRIPTION OF THE PROBLEM :
Supplementary-plane characters in text fields are sometimes treated as two characters - it must be caused by their internal representation as surrogate pairs.
REGRESSION. Last worked in version 8u112
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run sample program given below. In opened text field, press Left first, then Backspace.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
First character is deleted (completely), second remains.
ACTUAL -
First character is replaced with some undisplayable character, probably because only a part of surrogate pair was deleted.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class JTextFieldTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame();
JTextField field = new JTextField(20);
field.setText(new String(new int[]{0x1d400, 0x61}, 0, 2));
frame.add(field);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
}
}
---------- END SOURCE ----------
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+152)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+152, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.14393]
A DESCRIPTION OF THE PROBLEM :
Supplementary-plane characters in text fields are sometimes treated as two characters - it must be caused by their internal representation as surrogate pairs.
REGRESSION. Last worked in version 8u112
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run sample program given below. In opened text field, press Left first, then Backspace.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
First character is deleted (completely), second remains.
ACTUAL -
First character is replaced with some undisplayable character, probably because only a part of surrogate pair was deleted.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
public class JTextFieldTest {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JFrame frame = new JFrame();
JTextField field = new JTextField(20);
field.setText(new String(new int[]{0x1d400, 0x61}, 0, 2));
frame.add(field);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8175780 Incorrect processing of supplementary-plane characters in text fields
-
- Resolved
-
- relates to
-
JDK-8143177 Integrate harfbuzz opentype layout engine per JEP 258
-
- Resolved
-