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

Parser NPE #30

Closed
jpsacha opened this issue Aug 14, 2015 · 4 comments
Closed

Parser NPE #30

jpsacha opened this issue Aug 14, 2015 · 4 comments
Labels

Comments

@jpsacha
Copy link
Member

jpsacha commented Aug 14, 2015

I am trying to create a new preset for Basler Pylon librarty. No files gets generated, only getting an error:

...
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to execute JavaCPP Builder
        at org.bytedeco.javacpp.tools.BuildMojo.execute(BuildMojo.java:276)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 19 more
Caused by: java.lang.NullPointerException
        at org.bytedeco.javacpp.tools.Parser.function(Parser.java:1191)
        at org.bytedeco.javacpp.tools.Parser.declarations(Parser.java:2285)
        at org.bytedeco.javacpp.tools.Parser.group(Parser.java:1926)
        at org.bytedeco.javacpp.tools.Parser.declarations(Parser.java:2284)
        at org.bytedeco.javacpp.tools.Parser.namespace(Parser.java:2193)
        at org.bytedeco.javacpp.tools.Parser.declarations(Parser.java:2283)
        at org.bytedeco.javacpp.tools.Parser.parse(Parser.java:2359)
        at org.bytedeco.javacpp.tools.Parser.parse(Parser.java:2454)
        at org.bytedeco.javacpp.tools.Builder.parse(Builder.java:66)
        at org.bytedeco.javacpp.tools.Builder.build(Builder.java:623)
        at org.bytedeco.javacpp.tools.BuildMojo.execute(BuildMojo.java:269)
        ... 21 more
@saudet
Copy link
Member

saudet commented Aug 14, 2015

Looks like params is null when it shouldn't. We should add a null check there, to skip that block, and get more meaningful info about the parsing error...

saudet added a commit that referenced this issue Aug 16, 2015
…eclarations, and default constructors with an explicit `void` parameter (issue #31)

 * Fix a couple of potential `NullPointerException` in `Parser` (issue #30)
@saudet saudet added the bug label Aug 16, 2015
@saudet
Copy link
Member

saudet commented Aug 16, 2015

I've fixed the NullPointerException in the latest commit, so let me know if you get some more verbose error with that. Thanks for reporting!

@jpsacha
Copy link
Member Author

jpsacha commented Aug 17, 2015

I am still getting NPE, with a different stack trace this time:

Caused by: java.lang.NullPointerException
        at org.bytedeco.javacpp.tools.Parser.function(Parser.java:1273)
        at org.bytedeco.javacpp.tools.Parser.declarations(Parser.java:2283)
        at org.bytedeco.javacpp.tools.Parser.group(Parser.java:1923)
        at org.bytedeco.javacpp.tools.Parser.declarations(Parser.java:2282)
        at org.bytedeco.javacpp.tools.Parser.namespace(Parser.java:2191)
        at org.bytedeco.javacpp.tools.Parser.declarations(Parser.java:2281)
        at org.bytedeco.javacpp.tools.Parser.parse(Parser.java:2357)
        at org.bytedeco.javacpp.tools.Parser.parse(Parser.java:2452)
        at org.bytedeco.javacpp.tools.Builder.parse(Builder.java:66)
        at org.bytedeco.javacpp.tools.Builder.build(Builder.java:623)
        at org.bytedeco.javacpp.tools.BuildMojo.execute(BuildMojo.java:269)
        ... 21 more

Looks that the line with NPE:

dcl.signature = dcl.javaName + params.signature;

possibly params is null.

@jpsacha
Copy link
Member Author

jpsacha commented Aug 18, 2015

The last commit (5c259e1) fixed the issue. Thanks.

@jpsacha jpsacha closed this as completed Aug 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants