diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2022-03-17 22:07:46 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2022-03-17 22:07:46 +0100 |
commit | 2eddba64f711091cb2dcf861559e9532947dff9d (patch) | |
tree | 50506b0877b0bdd0d15b919682b61757a23ead21 /test/transform | |
parent | 3a4f0e08dbb82fdf93b04da2b0876563e96e13b7 (diff) | |
download | lombok-2eddba64f711091cb2dcf861559e9532947dff9d.tar.gz lombok-2eddba64f711091cb2dcf861559e9532947dff9d.tar.bz2 lombok-2eddba64f711091cb2dcf861559e9532947dff9d.zip |
[fixes #2990] Treat records and enums as places where `static` is allowed.
Diffstat (limited to 'test/transform')
4 files changed, 31 insertions, 1 deletions
diff --git a/test/transform/resource/after-delombok/LoggerFloggerRecord.java b/test/transform/resource/after-delombok/LoggerFloggerRecord.java new file mode 100644 index 00000000..9cc0c9c0 --- /dev/null +++ b/test/transform/resource/after-delombok/LoggerFloggerRecord.java @@ -0,0 +1,6 @@ +class LoggerFloggerRecord { + record Inner(String x) { + @java.lang.SuppressWarnings("all") + private static final com.google.common.flogger.FluentLogger log = com.google.common.flogger.FluentLogger.forEnclosingClass(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerFloggerRecord.java b/test/transform/resource/after-ecj/LoggerFloggerRecord.java new file mode 100644 index 00000000..86004b67 --- /dev/null +++ b/test/transform/resource/after-ecj/LoggerFloggerRecord.java @@ -0,0 +1,16 @@ +import lombok.extern.flogger.Flogger; +class LoggerFloggerRecord { + static @Flogger record Inner(String x) { + private static final com.google.common.flogger.FluentLogger log = com.google.common.flogger.FluentLogger.forEnclosingClass(); +/* Implicit */ private final String x; + <clinit>() { + } + public Inner(String x) { + super(); + .x = x; + } + } + LoggerFloggerRecord() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/LoggerFlogger.java b/test/transform/resource/before/LoggerFlogger.java index ff0249c7..4bdc20b0 100644 --- a/test/transform/resource/before/LoggerFlogger.java +++ b/test/transform/resource/before/LoggerFlogger.java @@ -25,4 +25,4 @@ class LoggerFloggerWithInnerEnum { enum Inner { CONSTANT; } -}
\ No newline at end of file +} diff --git a/test/transform/resource/before/LoggerFloggerRecord.java b/test/transform/resource/before/LoggerFloggerRecord.java new file mode 100644 index 00000000..908704d6 --- /dev/null +++ b/test/transform/resource/before/LoggerFloggerRecord.java @@ -0,0 +1,8 @@ +// version 14: + +import lombok.extern.flogger.Flogger; + +class LoggerFloggerRecord { + @Flogger + record Inner(String x) {} +} |