void (@NotNull PsiNewExpression expression) { super.visitNewExpression(expression); final PsiType type = expression.getType(); if (type == null) { return; } final String canonicalText = type.getCanonicalText(); if (!cachedNumberTypes.contains(canonicalText)) { return; } final PsiClass aClass = ClassUtils.getContainingClass(expression); if (aClass != null && cachedNumberTypes.contains(aClass.getQualifiedName())) { return; } final PsiExpressionList argumentList = expression.getArgumentList(); if (argumentList == null) { return; } final PsiExpression[] arguments = argumentList.getExpressions(); if (arguments.length != 1) { return; } final PsiExpression argument = arguments[0]; final PsiType argumentType = argument.getType(); if (argumentType == null || (ignoreStringArguments && argumentType.equalsToText(CommonClassNames.JAVA_LANG_STRING))) { return; } final PsiMethod method = expression.resolveMethod(); if (method == null || (reportOnlyWhenDeprecated && !method.isDeprecated())) { return; } if (expression.getClassReference() == null) { return; } registerNewExpressionError(expression, expression); }