Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed May 3, 2021
2 parents 1296796 + 296daf6 commit 9d82b6f
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -8,20 +8,21 @@

public abstract class AbstractLazy<T> {

private Object value;
private volatile Object value;

AbstractLazy(Object supplier) {
value = supplier;
}

T unwrap() {
if (value instanceof Lazy.Supplier<?>) {
Object val = this.value;
if (val instanceof Lazy.Supplier<?>) {
//noinspection unchecked
value = ((Lazy.Supplier<T>) value).get();
this.value = ((Lazy.Supplier<T>) val).get();
return unwrap();
}
//noinspection unchecked
return (T) value;
return (T) val;
}

@Override
Expand Down

0 comments on commit 9d82b6f

Please sign in to comment.