bsh % for (x: new String[]{"foo",null,"bar"}) { print(x); }
foo
// Error: Internal Error: null variable value
bsh.InterpreterError: null variable value
at bsh.NameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.BlockNameSpace.setVariable(Unknown Source)
at bsh.NameSpace.setVariable(Unknown Source)
at bsh.BSHEnhancedForStatement.eval(Unknown Source)
at bsh.Interpreter.run(Unknown Source)
at bsh.Interpreter.main(Unknown Source)
bsh %
Logged In: YES
user_id=406180
Originator: NO
fixed in Beanshell2 fork
http://code.google.com/p/beanshell2/issues/detail?id=19
Logged In: YES
user_id=151428
Originator: YES
Forgive my ignorance, but how do I obtain that fork? The head of :pserver:anonymous@beanshell.cvs.sourceforge.net:/cvsroot/beanshell/BeanShell still contains the bug, and there is no branch there named anything like "beanshell2".
Logged In: YES
user_id=151428
Originator: YES
Ok, googled and found it at svn http://beanshell2.googlecode.com/svn/trunk/beanshell2-read-only. Thanks for the fix.
Ticket has been migrated to github.
Please follow up on this over here: https://github.com/beanshell/beanshell/issues/450