Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8160463 | 8u112 | Arunprasad Rajkumar | P3 | Resolved | Fixed | b02 |
Reproducible: always
Platform-specific: no
Steps to reproduce: same as in parent bug.
Steps to reproduce:
1. Set javascript char variable from java.
2. Try to read the same variable from java code.
Expected: java.lang.String with single character OR java.lang.Character with original value.
Actual: Numeric value of original character returned.
Sample code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import netscape.javascript.JSObject;
public class CharBindingFailure extends Application {
@Override
public void start(Stage stage) throws Exception {
WebView view = new WebView();
WebEngine engine = view.getEngine();
stage.setScene(new Scene(new StackPane(view), 320, 240));
stage.setOnShown((e) -> {
char value = 'a';
JSObject window = (JSObject) engine.executeScript("window;");
window.setMember("testObject", value);
Object result = engine.executeScript("testObject;");
System.out.println(result.getClass());
});
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
RULE "WebNodeAutomated/com/sun/fx/webnode/tests/bridge/javascript2java/AddRemoveCommonTypesTest/testAddRemoveJavaScriptBindingChar" Exception java.lang.AssertionError: expected:<a> but was:<97>
RULE "WebNodeAutomated/com/sun/fx/webnode/tests/bridge/javascript2java/MethodCallsTest/testCharMethodCallA" Exception java.lang.AssertionError: expected:<n> but was:<110>
RULE "WebNodeAutomated/com/sun/fx/webnode/tests/bridge/javascript2java/MethodCallsTest/testCharMethodCallA2" Exception java.lang.AssertionError: expected:<n> but was:<110>
Platform-specific: no
Steps to reproduce: same as in parent bug.
Steps to reproduce:
1. Set javascript char variable from java.
2. Try to read the same variable from java code.
Expected: java.lang.String with single character OR java.lang.Character with original value.
Actual: Numeric value of original character returned.
Sample code:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import netscape.javascript.JSObject;
public class CharBindingFailure extends Application {
@Override
public void start(Stage stage) throws Exception {
WebView view = new WebView();
WebEngine engine = view.getEngine();
stage.setScene(new Scene(new StackPane(view), 320, 240));
stage.setOnShown((e) -> {
char value = 'a';
JSObject window = (JSObject) engine.executeScript("window;");
window.setMember("testObject", value);
Object result = engine.executeScript("testObject;");
System.out.println(result.getClass());
});
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
RULE "WebNodeAutomated/com/sun/fx/webnode/tests/bridge/javascript2java/AddRemoveCommonTypesTest/testAddRemoveJavaScriptBindingChar" Exception java.lang.AssertionError: expected:<a> but was:<97>
RULE "WebNodeAutomated/com/sun/fx/webnode/tests/bridge/javascript2java/MethodCallsTest/testCharMethodCallA" Exception java.lang.AssertionError: expected:<n> but was:<110>
RULE "WebNodeAutomated/com/sun/fx/webnode/tests/bridge/javascript2java/MethodCallsTest/testCharMethodCallA2" Exception java.lang.AssertionError: expected:<n> but was:<110>
- backported by
-
JDK-8160463 Char value is set as integer, not as character
- Resolved
- relates to
-
JDK-8167098 Backport of JDK-8158926 to JDK 8u mistakenly used preliminary patch
- Resolved
-
JDK-8160326 Char value is returned as integer, not as character
- Resolved
-
JDK-8089842 JavaScript2Java Bridge: A char value cannot be set from JavaScript
- Resolved