This commit is contained in:
Alexey Kudravtsev
2012-04-12 13:48:53 +04:00
parent 98cd545828
commit 79ccf1186b
3 changed files with 7 additions and 1 deletions
@@ -15,10 +15,13 @@
*/
package com.intellij.psi.util;
import org.jetbrains.annotations.NotNull;
public interface CachedValue<T> {
T getValue();
@NotNull
CachedValueProvider<T> getValueProvider();
boolean hasUpToDateValue();
@@ -19,6 +19,7 @@ package com.intellij.psi.impl;
import com.intellij.psi.PsiManager;
import com.intellij.psi.util.CachedValue;
import com.intellij.psi.util.CachedValueProvider;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -27,7 +28,7 @@ import org.jetbrains.annotations.Nullable;
public class PsiCachedValueImpl<T> extends PsiCachedValue<T> implements CachedValue<T> {
private final CachedValueProvider<T> myProvider;
public PsiCachedValueImpl(PsiManager manager, CachedValueProvider<T> provider) {
public PsiCachedValueImpl(@NotNull PsiManager manager, @NotNull CachedValueProvider<T> provider) {
super(manager);
myProvider = provider;
}
@@ -37,6 +38,7 @@ public class PsiCachedValueImpl<T> extends PsiCachedValue<T> implements CachedVa
return getValueWithLock(null);
}
@NotNull
@Override
public CachedValueProvider<T> getValueProvider() {
return myProvider;
@@ -40,6 +40,7 @@ public abstract class CachedValueImpl<T> extends CachedValueBase<T> implements C
return myProvider.compute();
}
@NotNull
@Override
public CachedValueProvider<T> getValueProvider() {
return myProvider;