aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java
diff options
context:
space:
mode:
authorMichael Ernst <mernst@cs.washington.edu>2021-12-07 11:16:11 -0800
committerMichael Ernst <mernst@cs.washington.edu>2021-12-07 11:16:11 -0800
commit3f5e4a2819d2f03d634a06861ff5487af320b719 (patch)
treeba9ab7ba2f582bb179624e2bb3f717bea5d9a421 /test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java
parent0b4cc60c2367845ebc362e4b254f9e96a66d53c3 (diff)
parentd3b763f9dab4a46e88ff10bc2132fb6f12fda639 (diff)
downloadlombok-3f5e4a2819d2f03d634a06861ff5487af320b719.tar.gz
lombok-3f5e4a2819d2f03d634a06861ff5487af320b719.tar.bz2
lombok-3f5e4a2819d2f03d634a06861ff5487af320b719.zip
Merge ../lombok-branch-master into nullness-annotations
Diffstat (limited to 'test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java')
-rw-r--r--test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java b/test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java
new file mode 100644
index 00000000..4476e463
--- /dev/null
+++ b/test/transform/resource/after-delombok/GetterLazyInAnonymousClass.java
@@ -0,0 +1,24 @@
+public class GetterLazyInAnonymousClass {
+ Object annonymous = new Object() {
+
+ class Inner {
+ private final java.util.concurrent.atomic.AtomicReference<java.lang.Object> string = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>();
+
+ @java.lang.SuppressWarnings({"all", "unchecked"})
+ public String getString() {
+ java.lang.Object value = this.string.get();
+ if (value == null) {
+ synchronized (this.string) {
+ value = this.string.get();
+ if (value == null) {
+ final String actualValue = "test";
+ value = actualValue == null ? this.string : actualValue;
+ this.string.set(value);
+ }
+ }
+ }
+ return (String) (value == this.string ? null : value);
+ }
+ }
+ };
+}