-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
wontfixThis will not be worked onThis will not be worked on
Description
here is some code:
private static void runJShellBindingExample2() {
try {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("jshell");
String script = "" +
"if (inputA != null && inputB != null) {" +
" System.out.println(\"Input A: \" + inputA);" +
" System.out.println(\"Input B: \" + inputB);" +
" var output = inputA + \" \" + inputB;" +
" System.out.println(\"GOING TO RETURN: \" + output);" +
" return output;" +
"}" +
"return \"\"";
engine.put("inputA", "hello");
engine.put("inputB", "world");
Object result = engine.eval(script);
System.out.println("runJShellBindingExample2 Result: " + result);
Object output = engine.get("output");
System.out.println("Output Variable: " + output);
} catch (ScriptException e) {
e.printStackTrace();
}
}
when i run it i get this back:
Input A: hello
Input B: world
GOING TO RETURN: hello world
runJShellBindingExample2 Result:
Output Variable: null
even though i would expect to get:
Input A: hello
Input B: world
GOING TO RETURN: hello world
runJShellBindingExample2 Result: **hello world**
Output Variable: null
(tested on version 1.1.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
wontfixThis will not be worked onThis will not be worked on