Community
Participate
Working Groups
Created attachment 281710 [details] Test case Hi, exception is thrown Exception in thread "main" java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.deprecatedSinceValue(ProblemReporter.java:1925) at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.deprecatedType(ProblemReporter.java:1884) at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.deprecatedType(ProblemReporter.java:1870) at org.eclipse.jdt.internal.compiler.lookup.BlockScope.getBinding(BlockScope.java:548) at org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference.resolveType(QualifiedNameReference.java:1025) at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:691) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1066) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:641) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:316) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:551) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1293) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1418) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666) at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:901) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1044) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:662) at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:1013) Use "Dependent jar" and "Use it to creates ast" from bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=559849
To correlate line numbers in the stack: which exact version of Eclipse? JDT?
org.eclipse.jdt.core-3.20.100 Or the exception happens on lines String deprecatedSinceValue(Supplier<AnnotationBinding[]> annotations) { if (this.options != null && this.options.complianceLevel >= ClassFileConstants.JDK9) { ReferenceContext contextSave = this.referenceContext; try { for (AnnotationBinding annotationBinding : annotations.get()) { if (annotationBinding.getAnnotationType().id == TypeIds.T_JavaLangDeprecated) { // <<<
(In reply to Sergey Toshin from comment #2) > org.eclipse.jdt.core-3.20.100 Mh, so that's some build between 2019-12-14 and 2020-01-05 :) > Or the exception happens on lines > String deprecatedSinceValue(Supplier<AnnotationBinding[]> annotations) { > if (this.options != null && this.options.complianceLevel >= > ClassFileConstants.JDK9) { > ReferenceContext contextSave = this.referenceContext; > try { > for (AnnotationBinding annotationBinding : annotations.get()) { > if (annotationBinding.getAnnotationType().id == > TypeIds.T_JavaLangDeprecated) { // <<< Thanks, so without running your test case this looks like your deprecated element has an annotation that cannot be resolved, could that be?
This is a decompiled Java source, I cannot say exactly :) But because of this error I cannot get ASTs for the rest of files :(
Let's keep this on our radar, no promise implied ...
Hey, any changes regarding this bug?
Created attachment 286345 [details] Stacktrace in .metadata/.log I tried to change JDK from 11 to 13, nothing changed. No success also with other experiments. Even when I removed all deprecated annotations from the file, the NPE was thrown again, which is really suspicious behavior. I seems that the NPE is related to some dependency of this class (some class implementing this interface, or some class using class implementing this interface?). But ... NPE is always an error, especially without a message. Caused by: java.lang.NullPointerException at ....ProblemReporter.deprecatedSinceValue(ProblemReporter.java:1961)
Switching project's compiler from JDK11/JDK13 to JDK8 works as a workaround. But it is not a solution for projects using newer features.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.