From 5ee6271902c05a3cad28b611be60bce94f6904a8 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Thu, 21 Jan 2021 09:42:31 +0100 Subject: [fixes #2716] SuperBuilder now skips initializers while gathering types --- src/core/lombok/eclipse/handlers/HandleSuperBuilder.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core') diff --git a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java index 8fdfd315..a0bd0600 100644 --- a/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleSuperBuilder.java @@ -50,6 +50,7 @@ import org.eclipse.jdt.internal.compiler.ast.FalseLiteral; import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; import org.eclipse.jdt.internal.compiler.ast.FieldReference; import org.eclipse.jdt.internal.compiler.ast.IfStatement; +import org.eclipse.jdt.internal.compiler.ast.Initializer; import org.eclipse.jdt.internal.compiler.ast.MessageSend; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.NullLiteral; @@ -1093,6 +1094,7 @@ public class HandleSuperBuilder extends EclipseAnnotationHandler { // 3. Add used type names. if (td.fields != null) { for (FieldDeclaration field : td.fields) { + if (field instanceof Initializer) continue; char[][] typeName = field.type.getTypeName(); if (typeName.length >= 1) // Add the first token, because only that can collide. usedNames.add(String.valueOf(typeName[0])); -- cgit