diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2017-01-20 00:26:14 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2017-01-20 00:37:31 +0100 |
commit | 00ce9a72e6625f685da485b3338a9f52ce4227e5 (patch) | |
tree | d6ffa3682cdf4f74d25958f0279b9a5acaafcc0c /src/core/lombok | |
parent | 5a7f02ca05ecfdd3578b2133de7d66ba7a745b1d (diff) | |
download | lombok-00ce9a72e6625f685da485b3338a9f52ce4227e5.tar.gz lombok-00ce9a72e6625f685da485b3338a9f52ce4227e5.tar.bz2 lombok-00ce9a72e6625f685da485b3338a9f52ce4227e5.zip |
If field resolution isn’t available, don’t try to make a symbol for the constructor (typemirrors).
Diffstat (limited to 'src/core/lombok')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleConstructor.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/lombok/javac/handlers/HandleConstructor.java b/src/core/lombok/javac/handlers/HandleConstructor.java index 827dfcb9..ef4ba088 100644 --- a/src/core/lombok/javac/handlers/HandleConstructor.java +++ b/src/core/lombok/javac/handlers/HandleConstructor.java @@ -230,8 +230,15 @@ public class HandleConstructor { JCMethodDecl constr = createConstructor(staticConstrRequired ? AccessLevel.PRIVATE : level, onConstructor, typeNode, fields, allToDefault, suppressConstructorProperties, source); ListBuffer<Type> argTypes = new ListBuffer<Type>(); - for (JavacNode fieldNode : fields) argTypes.append(getMirrorForFieldType(fieldNode)); - List<Type> argTypes_ = argTypes.toList(); + for (JavacNode fieldNode : fields) { + Type mirror = getMirrorForFieldType(fieldNode); + if (mirror == null) { + argTypes = null; + break; + } + argTypes.append(mirror); + } + List<Type> argTypes_ = argTypes == null ? null : argTypes.toList(); injectMethod(typeNode, constr, argTypes_, Javac.createVoidType(typeNode.getSymbolTable(), CTC_VOID)); if (staticConstrRequired) { ClassSymbol sym = ((JCClassDecl) typeNode.get()).sym; |