Fix: IDEA-70991 (Grails GSP tag <g:hasErrors bean="${some}" field="f"/> highlights an error on "field" attribute: "cannot resolve symbol 'f'")

This commit is contained in:
Sergey Evdokimov
2011-06-20 13:50:55 +04:00
parent 8ada217d2d
commit 992b57a90c
@@ -2,7 +2,6 @@ package org.jetbrains.plugins.groovy.util;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.UserDataHolder;
import com.intellij.openapi.util.UserDataHolderEx;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
@@ -29,28 +28,7 @@ public class LightCacheKey<T> {
return userData.second;
}
/**
*
* @param holder
* @param defaultValue Value which will put to cache if cache is empty or outdated. Other threads will get this value.
* @return
*/
public T getCachedValue(PsiElement holder, @NotNull T defaultValue) {
Pair<Long, T> userData = holder.getUserData(key);
long modificationCount = holder.getManager().getModificationTracker().getModificationCount();
if (userData != null && modificationCount == userData.first) {
return userData.second;
}
Pair<Long, T> newUserData = Pair.create(modificationCount, defaultValue);
return null;
}
public T putCachedValue(PsiElement holder, @Nullable T value) {
public T putCachedValue(PsiElement holder, @NotNull T value) {
long modificationCount = holder.getManager().getModificationTracker().getModificationCount();
Pair<Long, T> pair = Pair.create(modificationCount, value);