Example #1
0
 @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;
 }
Example #2
0
 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;
 }