cbuschka / beanshell2

Automatically exported from code.google.com/p/beanshell2
0 stars 0 forks source link

NullPointerException in eval(String) #67

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When I evaluate the string 

fScriptEngine.eval("print(\"Hello World!\";");

with BeanShell 2.1b5 I get a the following exception stack:

java.lang.NullPointerException
    at bsh.ParseException.getErrorLineNumber(ParseException.java:276)
    at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:93)
    at bsh.BshScriptEngine.eval(BshScriptEngine.java:61)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
    at test.scripting.ScriptRunner.runScripts(ScriptRunner.java:260)
    at test.scripting.ScriptRunner.main(ScriptRunner.java:553)

The same evaluation with BeanShell 2.0b5 will show me the expected result:

In file: inline evaluation of: ``print("Hello World!";'' Encountered "( \"Hello 
World!\" ;" at line 1, column 6.
 in inline evaluation of: ``print("Hello World!";'' at line number 1

Both eval() calls use the following exception handling:

catch (ScriptException e) {
    System.err.println(e.getLocalizedMessage());
}

Original issue reported on code.google.com by maroch...@gmail.com on 28 Feb 2012 at 8:38

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r109.

Original comment by `` on 28 Feb 2012 at 5:03