diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-11-01 16:38:25 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2018-11-01 16:38:25 +0100 |
commit | 2fd46a50b6125fd9f0e8177ffad5db8ee934fe34 (patch) | |
tree | 6662a3cb71b99b8c2b9fc058db8b735dc36145d0 /test/transform/resource | |
parent | 21878e253e331f6ea340ae44bf824890185e1938 (diff) | |
download | lombok-2fd46a50b6125fd9f0e8177ffad5db8ee934fe34.tar.gz lombok-2fd46a50b6125fd9f0e8177ffad5db8ee934fe34.tar.bz2 lombok-2fd46a50b6125fd9f0e8177ffad5db8ee934fe34.zip |
[feature] FieldNameConstants now works like Builder: Make whatever bits it does by hand and lombok fills in whatever is missing.
Diffstat (limited to 'test/transform/resource')
5 files changed, 124 insertions, 2 deletions
diff --git a/test/transform/resource/after-delombok/FieldNameConstantsBasic.java b/test/transform/resource/after-delombok/FieldNameConstantsBasic.java index 8be45d2b..0504327a 100644 --- a/test/transform/resource/after-delombok/FieldNameConstantsBasic.java +++ b/test/transform/resource/after-delombok/FieldNameConstantsBasic.java @@ -6,7 +6,7 @@ public class FieldNameConstantsBasic { String butPrintMePlease; @java.lang.SuppressWarnings("all") static final class Fields { - public static final java.lang.String butPrintMePlease = "butPrintMePlease"; public static final java.lang.String iAmADvdPlayer = "iAmADvdPlayer"; + public static final java.lang.String butPrintMePlease = "butPrintMePlease"; } } diff --git a/test/transform/resource/after-delombok/FieldNameConstantsHandrolled.java b/test/transform/resource/after-delombok/FieldNameConstantsHandrolled.java new file mode 100644 index 00000000..2677cfa0 --- /dev/null +++ b/test/transform/resource/after-delombok/FieldNameConstantsHandrolled.java @@ -0,0 +1,30 @@ +class FieldNameConstantsHandrolled1 { + int field1; + int alsoAField; + int thirdField; + public enum TypeTest { + alsoAField, thirdField, field1; + } +} +class FieldNameConstantsHandrolled2 { + int field1; + int alsoAField; + int thirdField; + public enum TypeTest { + alsoAField, thirdField, field1; + public String foo() { + return name(); + } + } +} + +class FieldNameConstantsHandrolled3 { + int field1; + int alsoAField; + int thirdField; + static class Fields { + public static final java.lang.String field1 = "field1"; + public static final java.lang.String thirdField = "thirdField"; + public static final int alsoAField = 5; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/FieldNameConstantsBasic.java b/test/transform/resource/after-ecj/FieldNameConstantsBasic.java index 674dd602..5b58e7d7 100644 --- a/test/transform/resource/after-ecj/FieldNameConstantsBasic.java +++ b/test/transform/resource/after-ecj/FieldNameConstantsBasic.java @@ -2,8 +2,8 @@ import lombok.experimental.FieldNameConstants; import lombok.AccessLevel; public @FieldNameConstants(level = AccessLevel.PACKAGE) class FieldNameConstantsBasic { static final @java.lang.SuppressWarnings("all") class Fields { - public static final java.lang.String butPrintMePlease = "butPrintMePlease"; public static final java.lang.String iAmADvdPlayer = "iAmADvdPlayer"; + public static final java.lang.String butPrintMePlease = "butPrintMePlease"; <clinit>() { } private @java.lang.SuppressWarnings("all") Fields() { diff --git a/test/transform/resource/after-ecj/FieldNameConstantsHandrolled.java b/test/transform/resource/after-ecj/FieldNameConstantsHandrolled.java new file mode 100644 index 00000000..6762fdd8 --- /dev/null +++ b/test/transform/resource/after-ecj/FieldNameConstantsHandrolled.java @@ -0,0 +1,59 @@ +import lombok.experimental.FieldNameConstants; +import lombok.AccessLevel; +@FieldNameConstants(asEnum = true,innerTypeName = "TypeTest") class FieldNameConstantsHandrolled1 { + public enum TypeTest { + field1(), + alsoAField(), + thirdField(), + <clinit>() { + } + private @java.lang.SuppressWarnings("all") TypeTest() { + super(); + } + } + int field1; + int alsoAField; + int thirdField; + FieldNameConstantsHandrolled1() { + super(); + } +} +@FieldNameConstants(asEnum = true,innerTypeName = "TypeTest") class FieldNameConstantsHandrolled2 { + public enum TypeTest { + field1(), + alsoAField(), + thirdField(), + <clinit>() { + } + public String foo() { + return name(); + } + private @java.lang.SuppressWarnings("all") TypeTest() { + super(); + } + } + int field1; + int alsoAField; + int thirdField; + FieldNameConstantsHandrolled2() { + super(); + } +} +@FieldNameConstants class FieldNameConstantsHandrolled3 { + static class Fields { + public static final java.lang.String field1 = "field1"; + public static final java.lang.String thirdField = "thirdField"; + public static final int alsoAField = 5; + <clinit>() { + } + private @java.lang.SuppressWarnings("all") Fields() { + super(); + } + } + int field1; + int alsoAField; + int thirdField; + FieldNameConstantsHandrolled3() { + super(); + } +} diff --git a/test/transform/resource/before/FieldNameConstantsHandrolled.java b/test/transform/resource/before/FieldNameConstantsHandrolled.java new file mode 100644 index 00000000..b6765fb2 --- /dev/null +++ b/test/transform/resource/before/FieldNameConstantsHandrolled.java @@ -0,0 +1,33 @@ +import lombok.experimental.FieldNameConstants; +import lombok.AccessLevel; + +@FieldNameConstants(asEnum = true, innerTypeName = "TypeTest") +class FieldNameConstantsHandrolled1 { + int field1, alsoAField, thirdField; + + public enum TypeTest { + field1 + } +} + +@FieldNameConstants(asEnum = true, innerTypeName = "TypeTest") +class FieldNameConstantsHandrolled2 { + int field1, alsoAField, thirdField; + + public enum TypeTest { + field1; + + public String foo() { + return name(); + } + } +} + +@FieldNameConstants +class FieldNameConstantsHandrolled3 { + int field1, alsoAField, thirdField; + + static class Fields { + public static final int alsoAField = 5; + } +} |