Simplification of NotNullLazyValue.

This commit is contained in:
Sergey Evdokimov
2011-04-15 19:39:05 +04:00
parent c901950c1d
commit 0818c415a9
@@ -23,17 +23,15 @@ import org.jetbrains.annotations.NotNull;
* @author peter
*/
public abstract class NotNullLazyValue<T> {
private boolean myComputed;
@NotNull private T myValue;
private T myValue;
@NotNull
protected abstract T compute();
@NotNull
public T getValue() {
if (!myComputed) {
if (myValue == null) {
myValue = compute();
myComputed = true;
}
return myValue;
}