NullPointerException from findBestPlainStorageName() #258

Closed
ardenliu opened this Issue Feb 9, 2012 · 1 comment

Projects

None yet

2 participants

@ardenliu
ardenliu commented Feb 9, 2012

When I run:
java -jar jnaerator-0.9.9-shaded.jar -I/somepath ./test.h

I got the following exception:

java.lang.NullPointerException
at com.ochafik.lang.jnaerator.JNAeratorUtils.findBestPlainStorageName(JNAeratorUtils.java:98)
at com.ochafik.lang.jnaerator.JNAeratorUtils.guessOwnerName(JNAeratorUtils.java:66)
at com.ochafik.lang.jnaerator.MissingNamesChooser.chooseNameIfMissing(MissingNamesChooser.java:329)
at com.ochafik.lang.jnaerator.MissingNamesChooser.visitFunctionSignature(MissingNamesChooser.java:133)
at com.ochafik.lang.jnaerator.parser.TypeRef$FunctionSignature.accept(TypeRef.java:190)
at com.ochafik.lang.jnaerator.parser.Scanner.visit(Scanner.java:457)
at com.ochafik.lang.jnaerator.parser.Scanner.visitDeclaration(Scanner.java:115)
at com.ochafik.lang.jnaerator.parser.Scanner.visitVariablesDeclaration(Scanner.java:287)
at com.ochafik.lang.jnaerator.parser.VariablesDeclaration.accept(VariablesDeclaration.java:41)
at com.ochafik.lang.jnaerator.parser.Scanner.visit(Scanner.java:468)
at com.ochafik.lang.jnaerator.parser.Scanner.visitSourceFile(Scanner.java:231)
at com.ochafik.lang.jnaerator.parser.SourceFile.accept(SourceFile.java:100)
at com.ochafik.lang.jnaerator.SourceFiles.accept(SourceFiles.java:40)
at com.ochafik.lang.jnaerator.JNAerator.jnaerationCore(JNAerator.java:1655)
at com.ochafik.lang.jnaerator.JNAerator.jnaerate(JNAerator.java:847)
at com.ochafik.lang.jnaerator.JNAerator$1.finished(JNAerator.java:737)
at com.ochafik.lang.jnaerator.JNAeratorCommandLineArgs$ArgsParser.parse(JNAeratorCommandLineArgs.java:118)
at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:297)

at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:178)

@ochafik
Member
ochafik commented Feb 12, 2012

Hi @ardenliu,

Thanks for your report !

I've committed a change that should fix the NPE you've reported, but I would be very interested in seeing the source code that triggered it : do you think you could share it here ?

Cheers

@ochafik ochafik closed this Feb 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment