@Nullable private static ValueConstraint getLiteralConstraint(@Nullable PsiExpression expr) { if (expr instanceof PsiLiteralExpression) { if (expr.textMatches(PsiKeyword.TRUE)) return TRUE_VALUE; if (expr.textMatches(PsiKeyword.FALSE)) return FALSE_VALUE; if (expr.textMatches(PsiKeyword.NULL)) return NULL_VALUE; } return null; }
private int resolveParameter(@Nullable PsiExpression expr) { if (expr instanceof PsiReferenceExpression && !((PsiReferenceExpression) expr).isQualified()) { String name = expr.getText(); PsiParameter[] parameters = myMethod.getParameterList().getParameters(); for (int i = 0; i < parameters.length; i++) { if (name.equals(parameters[i].getName())) { return i; } } } return -1; }