-
Bug
-
Resolution: Fixed
-
P3
-
jfx11, 8u271, jfx15
-
generic
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8267646 | 8-pool | Balchandra Vaidya | P3 | Open | Unresolved | |
JDK-8266823 | jfx11.0.12 | Johan Vos | P3 | Resolved | Fixed |
ADDITIONAL SYSTEM INFORMATION :
OS:
macOs Big Sur, 11.0.1
java version:
openjdk version "15" 2020-09-15
OpenJDK Runtime Environment Zulu15.27+17-CA (build 15+36)
OpenJDK 64-Bit Server VM Zulu15.27+17-CA (build 15+36, mixed mode, sharing)
openjfx version:
15.0.1
A DESCRIPTION OF THE PROBLEM :
Input any emoji using Chinese input method in JavaFX text area, an exception is thrown:
Exception in thread "JavaFX Application Thread" java.lang.StringIndexOutOfBoundsException: begin 0, end 2, length 1
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3734)
at java.base/java.lang.String.substring(String.java:1903)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleInputMethodEvent$7(GlassViewEventHandler.java:647)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleInputMethodEvent$8(GlassViewEventHandler.java:640)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleInputMethodEvent(GlassViewEventHandler.java:639)
at javafx.graphics/com.sun.glass.ui.View.handleInputMethodEvent(View.java:648)
at javafx.graphics/com.sun.glass.ui.View.notifyInputMethod(View.java:977)
at javafx.graphics/com.sun.glass.ui.mac.MacView.notifyInputMethodMac(MacView.java:161)
Seems that the notify str only contains the first byte of UTF-8 encoded emoji bytes.
Copy & Paste a emoji to text field works fine.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a simple JavaFX app with a TextArea, and Run:
public class Test extends Application {
@Override
public void start(Stage stage) {
stage.setTitle("Test");
var text = new TextArea();
var scene = new Scene(text, 600, 400);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
2. Input text using ‘简体拼音’ or any other Chinese input method, for example, keys 'keai' and then select the emoji in the candidate words.
OS:
macOs Big Sur, 11.0.1
java version:
openjdk version "15" 2020-09-15
OpenJDK Runtime Environment Zulu15.27+17-CA (build 15+36)
OpenJDK 64-Bit Server VM Zulu15.27+17-CA (build 15+36, mixed mode, sharing)
openjfx version:
15.0.1
A DESCRIPTION OF THE PROBLEM :
Input any emoji using Chinese input method in JavaFX text area, an exception is thrown:
Exception in thread "JavaFX Application Thread" java.lang.StringIndexOutOfBoundsException: begin 0, end 2, length 1
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3734)
at java.base/java.lang.String.substring(String.java:1903)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleInputMethodEvent$7(GlassViewEventHandler.java:647)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleInputMethodEvent$8(GlassViewEventHandler.java:640)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleInputMethodEvent(GlassViewEventHandler.java:639)
at javafx.graphics/com.sun.glass.ui.View.handleInputMethodEvent(View.java:648)
at javafx.graphics/com.sun.glass.ui.View.notifyInputMethod(View.java:977)
at javafx.graphics/com.sun.glass.ui.mac.MacView.notifyInputMethodMac(MacView.java:161)
Seems that the notify str only contains the first byte of UTF-8 encoded emoji bytes.
Copy & Paste a emoji to text field works fine.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a simple JavaFX app with a TextArea, and Run:
public class Test extends Application {
@Override
public void start(Stage stage) {
stage.setTitle("Test");
var text = new TextArea();
var scene = new Scene(text, 600, 400);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
2. Input text using ‘简体拼音’ or any other Chinese input method, for example, keys 'keai' and then select the emoji in the candidate words.
- backported by
-
JDK-8267646 [macos] Exception when input emoji using Chinese input method
-
- Open
-
-
JDK-8266823 [macos] Exception when input emoji using Chinese input method
-
- Resolved
-
- duplicates
-
JDK-8231643 TextInputControl in macOS environment cannot input Emoji
-
- Closed
-
- links to
-
Commit openjdk/jfx11u/debddf79
-
Commit openjdk/jfx/052e9f7d
-
Review openjdk/jfx11u/15
-
Review openjdk/jfx/436
(2 links to)