boolean (Instruction instruction) { if (!(instruction instanceof MethodCallInstruction)) { return false; } PsiCall call = ((MethodCallInstruction)instruction).getCallExpression(); if (call == null) return false; if (call instanceof PsiNewExpression && canAccessFields((PsiExpression)call)) { return true; } if (call instanceof PsiMethodCallExpression) { PsiExpression qualifier = ((PsiMethodCallExpression)call).getMethodExpression().getQualifierExpression(); if (qualifier == null || canAccessFields(qualifier)) { return true; } } PsiExpressionList argumentList = call.getArgumentList(); if (argumentList != null) { for (PsiExpression expression : argumentList.getExpressions()) { if (canAccessFields(expression)) return true; } } return false; }