Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer Exception #408

Closed
zspitzer opened this issue Aug 6, 2017 · 4 comments
Closed

Null pointer Exception #408

zspitzer opened this issue Aug 6, 2017 · 4 comments
Milestone

Comments

@zspitzer
Copy link

zspitzer commented Aug 6, 2017

the following snippet from https://github.com/bennadel/POIUtility.cfc/blob/master/coldfusion_mx7/POIUtility.cfc#L804 cases a NPE

<cfscript>
	// Loop over each CSS pair.
	for (
		local.PairIterator = local.Pairs.Iterator() ;
		local.PairIterator.HasNext() ;
		){
	}
</cfscript>

java.lang.NullPointerException
at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitForStatement(CFScriptStatementVisitor.java:310)
at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitForStatement(CFScriptStatementVisitor.java:95)
at cfml.CFSCRIPTParser$ForStatementContext.accept(CFSCRIPTParser.java:2883)
at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitStatement(CFScriptStatementVisitor.java:256)
at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitStatement(CFScriptStatementVisitor.java:95)
at cfml.CFSCRIPTParser$StatementContext.accept(CFSCRIPTParser.java:2239)
at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
at cfml.CFSCRIPTParserBaseVisitor.visitElement(CFSCRIPTParserBaseVisitor.java:41)
at cfml.CFSCRIPTParser$ElementContext.accept(CFSCRIPTParser.java:485)
at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
at cfml.CFSCRIPTParserBaseVisitor.visitScriptBlock(CFSCRIPTParserBaseVisitor.java:20)
at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitScriptBlock(CFScriptStatementVisitor.java:103)
at cfml.parsing.cfscript.walker.CFScriptStatementVisitor.visitScriptBlock(CFScriptStatementVisitor.java:95)
at cfml.CFSCRIPTParser$ScriptBlockContext.accept(CFSCRIPTParser.java:254)
at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
at cfml.parsing.CFMLParser.parseScript(CFMLParser.java:480)
at com.cflint.CFLint.process(CFLint.java:441)
at com.cflint.CFLint.processStack(CFLint.java:323)
at com.cflint.CFLint.process(CFLint.java:296)
at com.cflint.CFLint.scan(CFLint.java:250)
at com.cflint.CFLint.scan(CFLint.java:176)
at com.cflint.main.CFLintMain.execute(CFLintMain.java:436)
at com.cflint.main.CFLintMain.main(CFLintMain.java:282)

@zspitzer
Copy link
Author

zspitzer commented Aug 6, 2017

also, tracking down which file was causing the NPE was difficult, is there a way to show each file being processed? -verbose doesn't

@TheRealAgentK
Copy link
Collaborator

TheRealAgentK commented Aug 6, 2017 via email

@ryaneberly
Copy link
Contributor

@TheRealAgentK That's good.
com.cflint.CFLint.process(String, String) should also wrap exceptions coming out of it with the file name so you don't need to be in debug mode to figure out what file failed. Perhaps it should simply report a PARSE_ERROR in this case as well.

ryaneberly added a commit that referenced this issue Aug 7, 2017
ryaneberly added a commit that referenced this issue Aug 10, 2017
* Remove dependency copying (#376)

There doesn't seem to be a reason to have this phase. Perhaps there was
one before? All the required dependencies are added to the final JAR by
the `maven-shade-plugin` in the `package` phase anyway. This dependency
copying just seems like a waste of time.

* Add .editorconfig

Provides common whitespace settings for all editors. Supported out of
the box in some IDE's (like IntelliJ IDEA) and all others have
appropriate plugins.

*  Added .cflintrc schema and output schemas for JSON and XML. Tweaked README. (#377)

Added .cflintrc schema and output schemas for JSON and XML. Tweaked README.

* support autochange

* #382

* Align Gradle dependencies with Maven ones (#378)

Define the same set (and scopes) of dependencies for Gradle builds as we
have now in Maven's `pom.xml`.

* Added some context to the changelog for 1.2.0 and removed a lot of "##### no issues" items that were added to the list.

* Changed setting for auto-adding a final new line, that screws up expected files for tests.

* #383 Changed code, test, README with the output sample and JSON schema.

* Update timestamp type in result schemas

* #385 Two small modifications to HTML report

* Changed build versions to 1.2.1-SNAPSHOT in dev branch and change documentation to 1.2.1 in dev branch.

* 390 Add Implementation-Version to MANIFEST

Configures the Maven and Gradle builds to include
`Implementation-Version` in the MANIFEST.MF file, which can then be read
by the application and displayed to the user.

* #385 - Further HTML report improvements

* #390 - Adapting new way to grab version string

* #390 - Hopefully fixing Gradle build

* #390 - Review changes

* #396 fixed

* Update README.md

Explains how to pass multiple arguments in the command line in Windows Powershell and fixes a typo.

Fixes #400

* Update CODE_OF_CONDUCT.md

* #380 fixed

* Added VS Code info. Some cleanup.

* use cfparser 2.4.11

* #408

* #373

* #367

* #367

* add sonatype repo

* merged master

* cfparser 2.5.0

* Added test for #359 showing parsing error gone with cfparser 2.5.0

* #359 use parseCFMLExpression

* fix tests

* test for #346

* #413

* fix test

* fix javadoc
@ryaneberly
Copy link
Contributor

fixed in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants