mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user