From 9fbc226e090b1ca1efef5e10fd1bd13c4a686cfd Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Thu, 24 Sep 2015 00:28:57 +0200 Subject: [Closes #928] `@Value` no longer makes uninitialized static fields final --- .../resource/after-delombok/ValueStaticField.java | 29 ++++++++++++++++++++++ .../resource/after-ecj/ValueStaticField.java | 24 ++++++++++++++++++ .../resource/before/ValueStaticField.java | 5 ++++ 3 files changed, 58 insertions(+) create mode 100644 test/transform/resource/after-delombok/ValueStaticField.java create mode 100644 test/transform/resource/after-ecj/ValueStaticField.java create mode 100644 test/transform/resource/before/ValueStaticField.java (limited to 'test') diff --git a/test/transform/resource/after-delombok/ValueStaticField.java b/test/transform/resource/after-delombok/ValueStaticField.java new file mode 100644 index 00000000..cec136f4 --- /dev/null +++ b/test/transform/resource/after-delombok/ValueStaticField.java @@ -0,0 +1,29 @@ +final class ValueStaticField { + private static int x; + private static final String PASSWORD = "Ken sent me"; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public ValueStaticField() { + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof ValueStaticField)) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public int hashCode() { + int result = 1; + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public java.lang.String toString() { + return "ValueStaticField()"; + } +} \ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValueStaticField.java b/test/transform/resource/after-ecj/ValueStaticField.java new file mode 100644 index 00000000..4ce84a02 --- /dev/null +++ b/test/transform/resource/after-ecj/ValueStaticField.java @@ -0,0 +1,24 @@ +import lombok.Value; +final @Value class ValueStaticField { + private static int x; + private static final String PASSWORD = "Ken sent me"; + () { + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof ValueStaticField))) + return false; + return true; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + int result = 1; + return result; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + return "ValueStaticField()"; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ValueStaticField() { + super(); + } +} \ No newline at end of file diff --git a/test/transform/resource/before/ValueStaticField.java b/test/transform/resource/before/ValueStaticField.java new file mode 100644 index 00000000..f731758a --- /dev/null +++ b/test/transform/resource/before/ValueStaticField.java @@ -0,0 +1,5 @@ +import lombok.Value; +@Value class ValueStaticField { + static int x; + static String PASSWORD = "Ken sent me"; +} -- cgit