aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
diff options
context:
space:
mode:
authorRawi01 <Rawi01@users.noreply.github.com>2021-11-22 21:43:12 +0100
committerRoel Spilker <r.spilker@gmail.com>2021-12-12 02:29:45 +0100
commit025a76aa66517c45a033407838750fdb43b3a870 (patch)
tree41dd38ec0dd8b2792d8b6720cccd83c3850fad9e /src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
parent5155060ddf48b683a902b9d354d0fd07df7a79a1 (diff)
downloadlombok-025a76aa66517c45a033407838750fdb43b3a870.tar.gz
lombok-025a76aa66517c45a033407838750fdb43b3a870.tar.bz2
lombok-025a76aa66517c45a033407838750fdb43b3a870.zip
[fixes #3040] Support array initializer in onX
Diffstat (limited to 'src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java')
-rw-r--r--src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
index f8cde6c8..50349059 100644
--- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
+++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java
@@ -447,16 +447,18 @@ public class EclipseHandlerUtil {
// arrays
if (in instanceof ArrayInitializer) {
- Expression[] exprs = ((ArrayInitializer) in).expressions;
- Expression[] copy = new Expression[exprs.length];
- for (int i = 0; i < exprs.length; i++) copy[i] = copyAnnotationMemberValue(exprs[i]);
ArrayInitializer out = new ArrayInitializer();
out.sourceStart = s;
out.sourceEnd = e;
out.bits = in.bits;
out.implicitConversion = in.implicitConversion;
out.statementEnd = e;
- out.expressions = copy;
+ Expression[] exprs = ((ArrayInitializer) in).expressions;
+ if (exprs != null) {
+ Expression[] copy = new Expression[exprs.length];
+ for (int i = 0; i < exprs.length; i++) copy[i] = copyAnnotationMemberValue(exprs[i]);
+ out.expressions = copy;
+ }
return out;
}