aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBulgakov Alexander <abulgakov@at-consulting.ru>2016-11-11 19:54:39 +0300
committerBulgakov Alexander <abulgakov@at-consulting.ru>2016-11-11 20:22:12 +0300
commitd317eda711f2b07bdbac15bc9652ae9816e4517b (patch)
tree7978070ec4a7c1f2a90bc55c16818267ffe38449 /src
parent4d9da60f4f2643302e53267ef150ee4c68c39d7c (diff)
downloadlombok-d317eda711f2b07bdbac15bc9652ae9816e4517b.tar.gz
lombok-d317eda711f2b07bdbac15bc9652ae9816e4517b.tar.bz2
lombok-d317eda711f2b07bdbac15bc9652ae9816e4517b.zip
fix for the issue 1228. @NoArgsConstructor(force = true) fails on primitive arrays in Eclipse
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/eclipse/handlers/HandleConstructor.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleConstructor.java b/src/core/lombok/eclipse/handlers/HandleConstructor.java
index 85d1d4ed..a3b0585d 100644
--- a/src/core/lombok/eclipse/handlers/HandleConstructor.java
+++ b/src/core/lombok/eclipse/handlers/HandleConstructor.java
@@ -48,6 +48,7 @@ import org.eclipse.jdt.internal.compiler.ast.AllocationExpression;
import org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.eclipse.jdt.internal.compiler.ast.Argument;
import org.eclipse.jdt.internal.compiler.ast.ArrayInitializer;
+import org.eclipse.jdt.internal.compiler.ast.ArrayTypeReference;
import org.eclipse.jdt.internal.compiler.ast.Assignment;
import org.eclipse.jdt.internal.compiler.ast.CharLiteral;
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
@@ -381,6 +382,8 @@ public class HandleConstructor {
}
private static Expression getDefaultExpr(TypeReference type, int s, int e) {
+ boolean array = type instanceof ArrayTypeReference;
+ if (array) return new NullLiteral(s, e);
char[] lastToken = type.getLastToken();
if (Arrays.equals(TypeConstants.BOOLEAN, lastToken)) return new FalseLiteral(s, e);
if (Arrays.equals(TypeConstants.CHAR, lastToken)) return new CharLiteral(new char[] {'\'', '\\', '0', '\''}, s, e);