aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-ecj/GetterLazyGenerics.java
blob: 67ef55434cc8077b821988ed4bd4786ca523dd88 (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
35
36
37
38
39
40
41
42
43
44
class GetterLazyGenerics<E> {
  private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> field = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>();
  private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> field2 = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>();
  GetterLazyGenerics() {
    super();
  }
  public static <E>E getAny() {
    return null;
  }
  public @java.lang.SuppressWarnings({"all", "unchecked"}) E getField() {
    java.lang.Object value = this.field.get();
    if ((value == null))
        {
          synchronized (this.field)
            {
              value = this.field.get();
              if ((value == null))
                  {
                    final E actualValue = getAny();
                    value = ((actualValue == null) ? this.field : actualValue);
                    this.field.set(value);
                  }
            }
        }
    return (E) ((value == this.field) ? null : value);
  }
  public @java.lang.SuppressWarnings({"all", "unchecked"}) long getField2() {
    java.lang.Object value = this.field2.get();
    if ((value == null))
        {
          synchronized (this.field2)
            {
              value = this.field2.get();
              if ((value == null))
                  {
                    final long actualValue = System.currentTimeMillis();
                    value = actualValue;
                    this.field2.set(value);
                  }
            }
        }
    return (java.lang.Long) value;
  }
}