diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2023-01-15 23:50:41 +0100 |
---|---|---|
committer | Rawi01 <Rawi01@users.noreply.github.com> | 2023-01-15 23:50:41 +0100 |
commit | b718fbf4975bb8fa2f33e8533cde77ad7899e3df (patch) | |
tree | df090ef9a1d3f128c68150bfa5340d1a99502878 /src | |
parent | 75c9a9ddde2b61273ae21efbfce91d4dde533d89 (diff) | |
download | lombok-b718fbf4975bb8fa2f33e8533cde77ad7899e3df.tar.gz lombok-b718fbf4975bb8fa2f33e8533cde77ad7899e3df.tar.bz2 lombok-b718fbf4975bb8fa2f33e8533cde77ad7899e3df.zip |
[fixes #3327] Inject fields after generated record fields
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java | 9 |
1 files changed, 8 insertions, 1 deletions
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); @@ -2761,6 +2761,13 @@ public class EclipseHandlerUtil { } /** + * 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 <em>and</em> is <strong>not</strong> of any kind indicated by the flags (the intent is to pass flags usch as `ClassFileConstants.AccEnum`). */ static boolean isTypeAndDoesNotHaveFlags(EclipseNode typeNode, long flags) { |