use of com.intellij.psi.impl.java.stubs.PsiNameValuePairStub in project intellij-community by JetBrains.
the class PsiNameValuePairImpl method getDetachedValue.
@Override
@Nullable
public PsiAnnotationMemberValue getDetachedValue() {
PsiNameValuePairStub stub = getStub();
if (stub != null) {
String text = stub.getValue();
PsiAnnotationMemberValue result = SoftReference.dereference(myDetachedValue);
if (result == null) {
PsiAnnotation anno = JavaPsiFacade.getElementFactory(getProject()).createAnnotationFromText("@F(" + text + ")", this);
((LightVirtualFile) anno.getContainingFile().getViewProvider().getVirtualFile()).setWritable(false);
myDetachedValue = new SoftReference<>(result = anno.findAttributeValue(null));
}
return result;
}
return getValue();
}
Aggregations