boolean (@NotNull CFGBuilder builder, @NotNull PsiMethodCallExpression call) { if (!ENUM_COMPARE_TO.matches(call)) return false; PsiExpression qualifier = call.getMethodExpression().getQualifierExpression(); if (qualifier == null) return false; PsiExpression arg = call.getArgumentList().getExpressions()[0]; PsiClass qualifierClass = PsiUtil.resolveClassInClassTypeOnly(qualifier.getType()); PsiClass argumentClass = PsiUtil.resolveClassInClassTypeOnly(arg.getType()); if (qualifierClass instanceof PsiEnumConstantInitializer) { qualifierClass = qualifierClass.getSuperClass(); } if (argumentClass instanceof PsiEnumConstantInitializer) { argumentClass = argumentClass.getSuperClass(); } if (qualifierClass == null || !qualifierClass.equals(argumentClass)) return false; builder.pushExpression(qualifier) .unwrap(SpecialField.ENUM_ORDINAL) .pushExpression(arg) .unwrap(SpecialField.ENUM_ORDINAL) .mathOp(LongRangeBinOp.MINUS, call); return true; }