Community
Participate
Working Groups
Using the Java 8 preview installed I got the following stacktrace when compiling: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.nullAnnotationUnsupportedLocation(ProblemReporter.java:5708) at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.checkIllegalNullAnnotation(AllocationExpression.java:505) at org.eclipse.jdt.internal.compiler.ast.AllocationExpression.resolveType(AllocationExpression.java:327) at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:591) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:1016) at org.eclipse.jdt.internal.compiler.ast.Block.resolveUsing(Block.java:136) at org.eclipse.jdt.internal.compiler.ast.TryStatement.resolve(TryStatement.java:1089) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:620) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:303) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:531) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1209) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1319) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:570) at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:920) at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:965) at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:204) at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:270) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:190) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788) at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1247) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:151) at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:104) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206) This was apparently caused by a wrong location of a @Nonnull annotation, used in the source code as: @Nonnull public class DbUpdater { Removing the @Nonnull fixed the problem. The version of the Java 8 binaries is 1.0.0v20131229-0103_BETA_JAVA8
Thanks, the NPE occurs when we try to complain about a null annotation in s.t. like new DbUpdater() The compiler "believes" to see a null annotation here, because the type DbUpdater itself is tagged as NonNull. This behavior is not yet supported (see bug 415918). For now I'm doubly avoiding the NPE by: - resetting the null annotation tag bits after reporting the error against the class - ignoring annotation tag bits at the allocation if no corresponding source annotation can be found Fix released via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=ac2334c5e86fc350c298c6647ae4cbd01cc6fb31