void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); final @NonNls String name = methodExpression.getReferenceName(); if (!"setScale".equals(name) && !"divide".equals(name)) { return; } final PsiExpressionList argumentList = expression.getArgumentList(); if (PsiUtilCore.hasErrorElementChild(argumentList)) { return; } final PsiExpression[] arguments = argumentList.getExpressions(); if (arguments.length != 2 && arguments.length != 3) { return; } final PsiExpression argument = arguments[arguments.length - 1]; if (!PsiTypes.intType().equals(argument.getType())) { return; } if (!TypeUtils.expressionHasTypeOrSubtype(expression, "java.math.BigDecimal")) { return; } final PsiMethod method = expression.resolveMethod(); if (method == null) { return; } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null || !"java.math.BigDecimal".equals(containingClass.getQualifiedName())) { return; } registerMethodCallError(expression, argument); }