-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[native-image] NPE in ChainedSubstitutionProcessor.lookup #968
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
Comments
Digging a bit deeper in this, the failure occurs when trying to get the The declaringClass itself is |
In PR #981 I added the constructors to the list of substitutions, and the error is gone now. I'm not sure though if the constructors were removed deliberately (and only methods were used to create substitutions)? |
I don't see how the substitutions for the constructors could be necessary, because the annotation objects are created during image generation and not at run time. Your PR substitutes the constructor with an accessor method that returns a field value - that is clearly a wrong functionality, i.e., if the constructor would ever be called horrible things would happen. I think we first need an investigation why the constructor is requested at all. Maybe we can fix the problem at that level. If we decide that a constructor is necessary, we can substitute it with a new |
The problem occurs with Proxy classes that are annotations and that have an |
The explanation about the issue can be found here. |
…tor substitution Contributed by @vjovanov
The proper fix for this is in #1001 |
In a complex application that works fine with Java 8 on SVM, I have an issue when using Java 11.
The final error is a
NullPointerException
inSubstitutionProcessor$ChainedSubstitutionProcessor.lookup
since the first lookup returns null in`second.lookup(first.lookup(method))
FYI,
first
is anAnnotationSupport
instance anddeclaringClass.getSubstitutionMethod(method)
returns null fordeclaringClass = AnnotationType<jdk.jfr.Relational$$ProxyImpl -> HotSpotType<Lcom/sun/proxy/$Proxy37;, resolved>>
and
method = HotSpotMethod<$Proxy37.<init>(InvocationHandler)>
The text was updated successfully, but these errors were encountered: