aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-ecj/GetterLazyInAnonymousClass.java
blob: ab8bc5997cbed946db9089a5b8657760f22e9574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import lombok.Getter;
public class GetterLazyInAnonymousClass {
  Object annonymous = new Object() {
    class Inner {
      private final @Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> string = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>();
      Inner() {
        super();
      }
      public @java.lang.SuppressWarnings({"all", "unchecked"}) 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);
      }
    }
    x() {
      super();
    }
  };
  public GetterLazyInAnonymousClass() {
    super();
  }
}