From b718fbf4975bb8fa2f33e8533cde77ad7899e3df Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sun, 15 Jan 2023 23:50:41 +0100 Subject: [fixes #3327] Inject fields after generated record fields --- src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java') diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 072b6df2..9af88937 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -1998,7 +1998,7 @@ public class EclipseHandlerUtil { int index = 0; for (; index < size; index++) { FieldDeclaration f = newArray[index]; - if (isEnumConstant(f) || isGenerated(f)) continue; + if (isEnumConstant(f) || isGenerated(f) || isRecordField(f)) continue; break; } System.arraycopy(newArray, index, newArray, index + 1, size - index); @@ -2760,6 +2760,13 @@ public class EclipseHandlerUtil { return fieldNode.getKind() == Kind.FIELD && (((FieldDeclaration) fieldNode.get()).modifiers & AccRecord) != 0; } + /** + * Returns {@code true} If the provided node is a field declaration, and represents a field in a {@code record} declaration. + */ + public static boolean isRecordField(FieldDeclaration fieldDeclaration) { + return (fieldDeclaration.modifiers & AccRecord) != 0; + } + /** * Returns {@code true) if the provided node is a type declaration and is not of any kind indicated by the flags (the intent is to pass flags usch as `ClassFileConstants.AccEnum`). */ -- cgit