In JavaScript engine, some String operations produce ConsString instead, type errors at runtime
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openjdk-7 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have a small task that's done in Java's javax.script engine for JavaScript, which I understand was based on Rhino in Java SE 6 and 7, swapped out for Nashorn in Java SE 8. The code fails to run in openjdk-6 (38) and openjdk-7(95) - both i386 and amd64- but *only* in Ubuntu. A colleague has tested the exact same releases of Java in Redhat without the error. The code, however, works fine in openjdk-8 in both Ubuntu and Redhat.
The main issue seems to be that the + operator between two strings no longer produces a string result, it produces a sun.org.
Here is some code to reproduce the error:
import javax.script.
import javax.script.
public class jstest {
public static void main(String[] args) throws Exception {
ScriptEngin
ScriptEngine testEngine =
mgr.
String testScript =
" var key = 'something';\n" +
" var tpr = 'echo';\n" +
" var pb = new java.lang.
" pb.start(
System.
}
}
Running in Ubuntu gives this error:
javax.script.
Any ideas what's going wrong and why only in Ubuntu?
Version details:
Ubuntu 14.04.4 LTS
openjdk-6-jdk - 6b38-1.
openjdk-7-jdk - 7u95-2.