void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); @NonNls final String methodName = methodExpression.getReferenceName(); if (!"exit".equals(methodName) && !"halt".equals(methodName)) { return; } if (ignoreInMainMethod) { final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(expression, PsiMethod.class, true, PsiClass.class, PsiLambdaExpression.class); if (containingMethod != null && HardcodedMethodConstants.MAIN.equals(containingMethod.getName()) && PsiMethodUtil.isMainMethod(containingMethod)) { return; } } final PsiMethod method = expression.resolveMethod(); if (method == null) { return; } final PsiParameterList parameterList = method.getParameterList(); if (parameterList.getParametersCount() != 1) { return; } final PsiParameter[] parameters = parameterList.getParameters(); final PsiType parameterType = parameters[0].getType(); if (!parameterType.equals(PsiTypes.intType())) { return; } final PsiClass aClass = method.getContainingClass(); if (aClass == null) { return; } final String className = aClass.getQualifiedName(); if (CommonClassNames.JAVA_LANG_SYSTEM.equals(className)) { registerMethodCallError(expression, "System"); } else if ("java.lang.Runtime".equals(className)) { registerMethodCallError(expression, "Runtime"); } }