private static boolean isCompileTimeFlagReference(PsiElement element) { PsiElement resolved = element instanceof PsiReferenceExpression ? ((PsiReferenceExpression) element).resolve() : null; if (!(resolved instanceof PsiField)) return false; PsiField field = (PsiField) resolved; return field.hasModifierProperty(PsiModifier.FINAL) && field.hasModifierProperty(PsiModifier.STATIC) && PsiType.BOOLEAN.equals(field.getType()); }
private static boolean isBoolean(@Nullable PsiType propertyType) { return PsiType.BOOLEAN.equals(propertyType) || propertyType != null && CommonClassNames.JAVA_LANG_BOOLEAN.equals(propertyType.getCanonicalText()); }