"ratish" wrote:
From Monday(26-08-2014) I am facing a problem with the brightscript plugin on eclispe( any version, tried helios , indigo, juno, kepler and luna ). The .brs files are failing to open with brightscript editor. Its throwing NullPointerException. This happens for a project i was working for a long time with the same IDE and brightscript plugin.
The brighscript plugin that was running on eclipse was 1.0.0.201310291810. I updated the same to 1.0.0.201408081014 after seeing this issue but still the problem persists.
When i try to build the project or convert to Brighscript project it fails throwing NullPointerException and script builder failed.
Below is the log thrown when i tried to open a file.
java.lang.NullPointerException
at com.roku.brightscript.ide.eclipse.core.model.ast.typedexpressions.BrightScriptDotExpression.toString(BrightScriptDotExpression.java:284)
at com.roku.brightscript.ide.eclipse.core.model.ast.typedexpressions.BrightScriptDotExpression.getStringRepresentation(BrightScriptDotExpression.java:268)
at com.roku.brightscript.ide.eclipse.core.model.ast.BrightScriptASTTranslator.processFnCallFnRefOrVarRef(BrightScriptASTTranslator.java:2394)
at com.roku.brightscript.ide.eclipse.core.model.ast.BrightScriptASTTranslator.exitFnexprtail(BrightScriptASTTranslator.java:2304)
at com.roku.brightscript.parser.BrightScriptAnalyzer.exit(BrightScriptAnalyzer.java:1329)
at net.percederberg.grammatica.parser.Parser.exitNode(Parser.java:540)
at net.percederberg.grammatica.parser.RecursiveDescentParser.parseAlternative(RecursiveDescentParser.java:300)
This bug (which is not the same as the OP) was reported by someone else earlier today via email and I already have a bugfix check-in pending approval.
It shouldn't take terribly long for the next plugin version to be published with the fix.
In the meantime, examine your .brs source files using the text editor instead of the BrightScript editor for "dot expressions" that use a literal as the head of the expression.
e.g.:
foo = "I am a string literal".len()
Note, any kind of valid BrightScript literal used as the head of a dot expression will expose the bug (i.e. string, integer, hex, double, float, boolean, etc.).
If you can't wait for the updated plugin to be published, use a variable as the head of the expression instead, by separating those types of expressions into 2 statements.
e.g.:
bar = "I am a string literal"
foo = bar.len()