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

NullPointerException on CtTypeReferenceImpl.isGenerics #3275

Closed
ontologiae opened this issue Feb 27, 2020 · 2 comments
Closed

NullPointerException on CtTypeReferenceImpl.isGenerics #3275

ontologiae opened this issue Feb 27, 2020 · 2 comments

Comments

@ontologiae
Copy link

ontologiae commented Feb 27, 2020

Hi,

I have an error parsing this file (This codebase leverage several bugs, you should use it)
after L87 of this file : https://github.com/metasfresh/metasfresh/blob/70a820840dde9b73783c52ec72e02c9f611df281/de.metas.adempiere.libero.libero/src/main/java/org/eevolution/costing/BOMCostPrice.java#L87
It's the last reference I have on this file.
My code test before calling isGeneric that the receiver is not null.
The last token that lead to call isGeneric is a CtInvocation

Here's the stacktrace :

[error] (run-main-1) java.lang.NullPointerException
[error] java.lang.NullPointerException
[error] 	at spoon.support.reflect.reference.CtTypeParameterReferenceImpl.getDeclaration(CtTypeParameterReferenceImpl.java:131)
[error] 	at spoon.support.reflect.reference.CtTypeParameterReferenceImpl.isGenerics(CtTypeParameterReferenceImpl.java:195)
[error] 	at spoon.support.reflect.reference.CtTypeReferenceImpl.isGenerics(CtTypeReferenceImpl.java:845)
[error] 	at org.deepanalyzer.javaparse.Parser.extractType(Parser.scala:546)
[error] 	at org.deepanalyzer.javaparse.Parser.descendExpression(Parser.scala:951)
@MartinWitt
Copy link
Collaborator

MartinWitt commented Feb 27, 2020

i have reproduce your bug, currently looking into it.
Edit: The problem is, that if (!parentExec.getDeclaringType().equals(e)) getDeclaringType returns null

https://github.com/INRIA/spoon/blob/master/src/main/java/spoon/support/reflect/reference/CtTypeParameterReferenceImpl.java#L131

@monperrus
Copy link
Collaborator

closed per #3276

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