void (PsiCall expression) { PsiExpression[] initializers = CommonJavaRefactoringUtil.getArrayInitializersToFlattenInVarargs(expression); if (initializers == null) return; if (!(expression instanceof PsiExpression && LOGGER_MESSAGE_CALL.matches((PsiExpression)expression)) && !CommonJavaRefactoringUtil.isSafeToFlattenToVarargsCall(expression, initializers)) { return; } PsiExpressionList argumentList = expression.getArgumentList(); PsiExpression[] args = Objects.requireNonNull(argumentList).getExpressions(); PsiExpression arrayCreation = Objects.requireNonNull(PsiUtil.skipParenthesizedExprDown(args[args.length - 1])); if (!(arrayCreation instanceof PsiNewExpression)) return; final String message = JavaBundle.message("inspection.redundant.array.creation.for.varargs.call.descriptor"); PsiArrayInitializerExpression arrayInitializer = ((PsiNewExpression)arrayCreation).getArrayInitializer(); if (arrayInitializer == null) { myHolder.registerProblem( arrayCreation, message, redundantArrayForVarargsCallFixAction); } else { myHolder.registerProblem( arrayCreation, new TextRange(0, arrayInitializer.getStartOffsetInParent()), message, redundantArrayForVarargsCallFixAction); } }