diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-04-30 23:22:36 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-05-01 00:08:52 +0200 |
commit | 934e41d8217152c751942e604f6004440efd9319 (patch) | |
tree | 77babb540ee22e0fcb3192da7f16191cb02a9081 /src/core/lombok | |
parent | fd1a9d7c0994ec93881e2986844856b781a22c6d (diff) | |
download | lombok-934e41d8217152c751942e604f6004440efd9319.tar.gz lombok-934e41d8217152c751942e604f6004440efd9319.tar.bz2 lombok-934e41d8217152c751942e604f6004440efd9319.zip |
eclipse usually just wants 'null' instead of a zero-len array.
In this particular case, ecj8 (but not ecj7) would start printing extra
spaces, causing tests to fail. Other things tend to break too, so,
we're sticking to the 'null for empty arrays' model.
Diffstat (limited to 'src/core/lombok')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java index b6ea568d..f34e70b9 100644 --- a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java +++ b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java @@ -484,7 +484,7 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH setGeneratedBy(objectRef, source); method.arguments = new Argument[] {new Argument(new char[] { 'o' }, 0, objectRef, Modifier.FINAL)}; method.arguments[0].sourceStart = pS; method.arguments[0].sourceEnd = pE; - method.arguments[0].annotations = onParam.toArray(new Annotation[0]); + if (!onParam.isEmpty()) method.arguments[0].annotations = onParam.toArray(new Annotation[0]); setGeneratedBy(method.arguments[0], source); List<Statement> statements = new ArrayList<Statement>(); @@ -749,7 +749,7 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH setGeneratedBy(objectRef, source); method.arguments = new Argument[] {new Argument(otherName, 0, objectRef, Modifier.FINAL)}; method.arguments[0].sourceStart = pS; method.arguments[0].sourceEnd = pE; - method.arguments[0].annotations = onParam.toArray(new Annotation[0]); + if (!onParam.isEmpty()) method.arguments[0].annotations = onParam.toArray(new Annotation[0]); setGeneratedBy(method.arguments[0], source); SingleNameReference otherRef = new SingleNameReference(otherName, p); |