int (@Nullable PsiExpression expression) { if (expression == null) { return 0; } if (expression instanceof PsiParenthesizedExpression) { return hashExpression(((PsiParenthesizedExpression)expression).getExpression()); } short index = expression.getNode().getElementType().getIndex(); if (expression instanceof PsiReferenceExpression) { return hashReference((PsiReferenceExpression)expression, index); } if (expression instanceof PsiMethodCallExpression) { return hashReference(((PsiMethodCallExpression)expression).getMethodExpression(), index); } if (expression instanceof PsiNewExpression) { PsiJavaCodeReferenceElement reference = ((PsiNewExpression)expression).getClassOrAnonymousClassReference(); if (reference != null) { return hashReference(reference, index); } } if (expression instanceof PsiAssignmentExpression) { PsiExpression lExpression = ((PsiAssignmentExpression)expression).getLExpression(); PsiExpression rExpression = ((PsiAssignmentExpression)expression).getRExpression(); return ((hashExpression(lExpression) * 31) + hashExpression(rExpression)) * 31 + index; } return index; }