void (@NotNull PsiMethodCallExpression call) { if (!OBJECT_GET_CLASS.test(call)) return; // Sometimes people use xyz.getClass() for implicit NPE check. While it's a questionable code style // do not warn about such case if (ExpressionUtils.isVoidContext(call)) return; PsiExpression qualifier = call.getMethodExpression().getQualifierExpression(); if (qualifier == null) return; PsiType type = qualifier.getType(); if (!PsiTypesUtil.classNameEquals(type, CommonClassNames.JAVA_LANG_CLASS)) return; holder.registerProblem(Objects.requireNonNull(call.getMethodExpression().getReferenceNameElement()), JavaAnalysisBundle.message("inspection.class.getclass.message"), new RemoveGetClassCallFix(), new ReplaceWithClassClassFix()); }