Community
Participate
Working Groups
Steps (using SDK 3.7 M5): - check out project org.eclipse.jdt.core (I assume any plug-in project with the following setting will do: compilers.p.build.source.library=2 ) - add a source folder "contrib", do not update build.properties The BundleErrorReporter will try to report: "contrib/ is not included in any "source.*" build entry" However, while trying to report it will die with an NPE: java.lang.NullPointerException at org.eclipse.pde.internal.core.builders.BuildErrorReporter.reportErrors(BuildErrorReporter.java:1068) at org.eclipse.pde.internal.core.builders.BuildErrorReporter.validate(BuildErrorReporter.java:164) at org.eclipse.pde.internal.core.builders.ErrorReporter.validateContent(ErrorReporter.java:127) at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateBuildProperties(ManifestConsistencyChecker.java:316) at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.validateProject(ManifestConsistencyChecker.java:231) at org.eclipse.pde.internal.core.builders.ManifestConsistencyChecker.build(ManifestConsistencyChecker.java:157) Cause: report(..) will return null if the problem severity is IGNORED, but reportErrors(..) does not catch this null but happily proceeds until ... Naturally, this occurred while working on bug 186342 to support detecting NPEs at compile time :) In the future the return of report(..) should be declared as "@Nullable IMarker" which will cause marker.setAttribute(..) to be flagged as an error. Simple as that.
Fixed in HEAD see BundleErrorReporter.java. Added javadoc comments to the report methods to remind callers. PDE is 1.4 compliant and we do not use annotations.