aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/changelog.markdown1
-rw-r--r--src/core/lombok/javac/apt/LombokProcessor.java7
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/changelog.markdown b/doc/changelog.markdown
index 0e489dd3..07b1b0aa 100644
--- a/doc/changelog.markdown
+++ b/doc/changelog.markdown
@@ -11,6 +11,7 @@ Lombok Changelog
* BUGFIX: Delombok would turn something like `List<byte[]>...` in a method parameter to `List<byte...>...` [Issue #2140](https://github.com/rzwitserloot/lombok/issues/2140)
* BUGFIX: Javac would generate the wrong equals and hashCode if a type-use annotation was put on an array type field [Issue #2165](https://github.com/rzwitserloot/lombok/issues/2165)
* BUGFIX: Eclipse 2019-06 + JDK-12 compatibility + an `@Singular` builder entry would produce a cascade of error dialogs. [Issue #2169](https://github.com/rzwitserloot/lombok/issues/2169)
+* BUGFIX: Javac would throw a NullPointerException if the package-info.java did not contain a package declaration. [Issue #2184](https://github.com/rzwitserloot/lombok/issues/2184)
* IMPROBABLE BREAKING CHANGE: Stricter validation of configuration keys dealing with identifiers and types (`lombok.log.fieldName`, `lombok.fieldNameConstants.innerTypeName`, `lombok.copyableAnnotations`).
* IMPROBABLE BREAKING CHANGE: The fields generated inside builders for fields with defaults (with `@Builder` on a class with fields marked `@Default`) now have `$value` as the name; direct manipulation of these fields is not advised because there is an associated `$set` variable that also needs to be taken into account. [Issue #2115](https://github.com/rzwitserloot/lombok/issues/2115)
diff --git a/src/core/lombok/javac/apt/LombokProcessor.java b/src/core/lombok/javac/apt/LombokProcessor.java
index 79db5dec..ed6cdb65 100644
--- a/src/core/lombok/javac/apt/LombokProcessor.java
+++ b/src/core/lombok/javac/apt/LombokProcessor.java
@@ -389,7 +389,12 @@ public class LombokProcessor extends AbstractProcessor {
}
private JCCompilationUnit toUnit(Element element) {
- TreePath path = trees == null ? null : trees.getPath(element);
+ TreePath path = null;
+ if (trees != null) {
+ try {
+ path = trees.getPath(element);
+ } catch (NullPointerException ignore) {}
+ }
if (path == null) return null;
return (JCCompilationUnit) path.getCompilationUnit();