RangeConstraint (TextRange textRange, PsiExpression expr, LongRangeSet set) { SpecialField field = null; PsiReferenceExpression ref = expr instanceof PsiReferenceExpression ? (PsiReferenceExpression)expr : expr instanceof PsiMethodCallExpression ? ((PsiMethodCallExpression)expr).getMethodExpression() : null; if (ref != null) { PsiExpression qualifier = ref.getQualifierExpression(); if (qualifier != null) { field = SpecialField.findSpecialField(ref.resolve()); if (field != null) { expr = qualifier; } } } if (SideEffectChecker.mayHaveSideEffects(expr)) { return null; } return new RangeConstraint(textRange, expr, field, set); }