boolean (@NotNull UReferenceExpression expression) { // avoid double warning for qualified and simple reference in Kotlin: if (expression.getUastParent() instanceof UQualifiedReferenceExpression) return false; PsiElement colorField = expression.resolve(); if (colorField instanceof PsiField && ((PsiField)colorField).hasModifierProperty(PsiModifier.STATIC)) { PsiClass colorClass = ((PsiField)colorField).getContainingClass(); return colorClass != null && AWT_COLOR_CLASS_NAME.equals(colorClass.getQualifiedName()); } return false; }