Community
Participate
Working Groups
Created attachment 208220 [details] my project settings After configuring a project to use NPE annotations, and using the *default* proposed "org.eclipse.jdt.annotation.*" types, a compilation error appears: Buildpath problem: the type org.eclipse.jdt.annotation.NonNull, which is configured as a null annotation type, cannot be resolved This should be avoided - either warn user that project does NOT have proposed jdt annotation types in the classpath (and discard the setting), or (better) ask and (if user agrees) automatically configure the project classpath by adding the missing library. [dream] As a non-plus-ultra feature, for a *plugin* project with enabled NPE options, add a new "org.eclipse.jdt.annotations" plugin to the workspace which would just contain the libraries, and add dependency to the MANIFEST.MF instead of adding project dependency via .classpath. Right now by enabling NPE "default" settings for a project will always lead to compile error in Eclipse.
Thanks for your suggestion. This is already being planned :) *** This bug has been marked as a duplicate of bug 366014 ***
(In reply to comment #0) > [dream] As a non-plus-ultra feature, for a *plugin* project with enabled NPE > options, add a new "org.eclipse.jdt.annotations" plugin to the workspace which > would just contain the libraries, and add dependency to the MANIFEST.MF instead > of adding project dependency via .classpath. Some more bits of info: The New&Noteworthy mention: > In addition to enabling the null analysis, the annotations need to be on the > Java build path of your project. The default annotations can be found in the > org.eclipse.jdt.annotation JAR in the plugins directory, which can be > consumed as an OSGi bundle or plain JAR." This means using M4 you can already use the Require-Bundle you suggest, but as Markus suggests in bug 366014: > But for PDE, we should only add it as compile-time dependency > ("additional.bundles = org.eclipse.jdt.annotation" in build.properties), > not as OSGi Require-Bundle." HTH