diff --git a/java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicConstantInspection.java b/java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicConstantInspection.java index 3e9fbb66b599..fbad6d7d2fe1 100644 --- a/java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicConstantInspection.java +++ b/java/java-impl/src/com/intellij/codeInspection/magicConstant/MagicConstantInspection.java @@ -454,7 +454,7 @@ public class MagicConstantInspection extends AbstractBaseJavaLocalInspectionTool } else { realElement = element; } - return CachedValuesManager.getCachedValue(element, () -> + return CachedValuesManager.getCachedValue(realElement, () -> CachedValueProvider.Result.create(AnnotationUtil.getAllAnnotations(realElement, true, null, false), PsiModificationTracker.MODIFICATION_COUNT)); }