aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/eclipse
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@tipit.to>2009-06-23 23:52:34 +0200
committerReinier Zwitserloot <reinier@tipit.to>2009-06-23 23:52:34 +0200
commit7191aa78bde2072b86d4d3d99ad6a3dfb7fa6527 (patch)
tree96d337dd624bb6e0b185bfbf22af358d4b0f9b1e /src/lombok/eclipse
parent2ebb040c812191381d62aa7f7c9d3e81ac6c1971 (diff)
downloadlombok-7191aa78bde2072b86d4d3d99ad6a3dfb7fa6527.tar.gz
lombok-7191aa78bde2072b86d4d3d99ad6a3dfb7fa6527.tar.bz2
lombok-7191aa78bde2072b86d4d3d99ad6a3dfb7fa6527.zip
fixed a bug where the auto-generated constructors (actual or static) would throw eclipse errors if you had 0 non-static fields.
Diffstat (limited to 'src/lombok/eclipse')
-rw-r--r--src/lombok/eclipse/handlers/HandleData.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lombok/eclipse/handlers/HandleData.java b/src/lombok/eclipse/handlers/HandleData.java
index 0b3dbffd..e90f33fd 100644
--- a/src/lombok/eclipse/handlers/HandleData.java
+++ b/src/lombok/eclipse/handlers/HandleData.java
@@ -215,8 +215,8 @@ public class HandleData implements EclipseAnnotationHandler<Data> {
args.add(new Argument(field.name, fieldPos, copyType(field.type), 0));
}
- constructor.statements = assigns.toArray(new Statement[assigns.size()]);
- constructor.arguments = args.toArray(new Argument[args.size()]);
+ constructor.statements = assigns.isEmpty() ? null : assigns.toArray(new Statement[assigns.size()]);
+ constructor.arguments = args.isEmpty() ? null : args.toArray(new Argument[args.size()]);
return constructor;
}
@@ -256,8 +256,8 @@ public class HandleData implements EclipseAnnotationHandler<Data> {
args.add(new Argument(field.name, fieldPos, copyType(field.type), 0));
}
- statement.arguments = assigns.toArray(new Expression[assigns.size()]);
- constructor.arguments = args.toArray(new Argument[args.size()]);
+ statement.arguments = assigns.isEmpty() ? null : assigns.toArray(new Expression[assigns.size()]);
+ constructor.arguments = args.isEmpty() ? null : args.toArray(new Argument[args.size()]);
constructor.statements = new Statement[] { new ReturnStatement(statement, (int)(p >> 32), (int)p) };
return constructor;
}