diff options
author | Rawi01 <Rawi01@users.noreply.github.com> | 2021-10-22 10:15:29 +0200 |
---|---|---|
committer | Rawi01 <Rawi01@users.noreply.github.com> | 2021-10-22 10:18:07 +0200 |
commit | 1d7db8c4dfa2f7a26d9816398947f6e76e506093 (patch) | |
tree | c978347378b6c9cd6a31770ac3780193ad13896b /src/core/lombok/eclipse | |
parent | 8bbac04478cb088eedceb4c63dcb45e30f0948ed (diff) | |
download | lombok-1d7db8c4dfa2f7a26d9816398947f6e76e506093.tar.gz lombok-1d7db8c4dfa2f7a26d9816398947f6e76e506093.tar.bz2 lombok-1d7db8c4dfa2f7a26d9816398947f6e76e506093.zip |
[fixes #2995] Skip records for field defaults via config
Diffstat (limited to 'src/core/lombok/eclipse')
-rw-r--r-- | src/core/lombok/eclipse/handlers/HandleFieldDefaults.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java index 5900e7ed..3297ba06 100644 --- a/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java +++ b/src/core/lombok/eclipse/handlers/HandleFieldDefaults.java @@ -160,6 +160,8 @@ public class HandleFieldDefaults extends EclipseASTAdapter { boolean defaultToFinal = makeFinalIsExplicit ? false : Boolean.TRUE.equals(typeNode.getAst().readConfiguration(ConfigurationKeys.FIELD_DEFAULTS_FINAL_EVERYWHERE)); if (!defaultToPrivate && !defaultToFinal && fieldDefaults == null) return; + // Do not apply field defaults to records if set using the the config system + if (fieldDefaults == null && !isClassOrEnum(typeNode)) return; AccessLevel fdAccessLevel = (fieldDefaults != null && levelIsExplicit) ? fd.level() : defaultToPrivate ? AccessLevel.PRIVATE : null; boolean fdToFinal = (fieldDefaults != null && makeFinalIsExplicit) ? fd.makeFinal() : defaultToFinal; |