@@ -29,6 +29,7 @@ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. If you reuse (enti
2929import static org .pdfclown .common .build .internal .util_ .Exceptions .runtime ;
3030import static org .pdfclown .common .build .internal .util_ .Exceptions .unexpected ;
3131import static org .pdfclown .common .build .internal .util_ .Exceptions .wrongArg ;
32+ import static org .pdfclown .common .build .internal .util_ .Objects .LITERAL_NULL ;
3233import static org .pdfclown .common .build .internal .util_ .Objects .fqn ;
3334import static org .pdfclown .common .build .internal .util_ .Objects .fqnd ;
3435import static org .pdfclown .common .build .internal .util_ .Objects .objToLiteralString ;
@@ -445,6 +446,8 @@ Matcher<T> getMatcher() {
445446 * @see Assertions#assertParameterized(Object, Expected, Supplier)
446447 */
447448 public static class ExpectedGeneration {
449+ private static final int MAX_ARG_COMMENT_LENGTH__DEFAULT = 50 ;
450+
448451 /**
449452 * Gets the constructor source code to use in {@link #setExpectedSourceCodeGenerator(Function)}.
450453 *
@@ -470,7 +473,7 @@ public static String expectedSourceCodeForFactory(Class<?> type, String methodNa
470473 Function <@ Nullable Object , String > argCommentFormatter = Objects ::objToLiteralString ;
471474 final List <Entry <String , @ Nullable Object >> args ;
472475 Function <Object , String > expectedSourceCodeGenerator = Objects ::objToLiteralString ;
473- int maxArgCommentLength = 20 ;
476+ int maxArgCommentLength = MAX_ARG_COMMENT_LENGTH__DEFAULT ;
474477 PrintStream out = System .err ;
475478 boolean outOverridable = true ;
476479
@@ -522,7 +525,7 @@ public Function<Object, String> getExpectedSourceCodeGenerator() {
522525 /**
523526 * Maximum length of argument values in comments accompanying expected results source code.
524527 * <p>
525- * DEFAULT: {@code 20 }
528+ * DEFAULT: {@value #MAX_ARG_COMMENT_LENGTH__DEFAULT }
526529 * </p>
527530 */
528531 public int getMaxArgCommentLength () {
@@ -758,11 +761,11 @@ protected ExpectedGenerator(int count) {
758761 * The expected result is mapped to source code representation based on its value type:
759762 * </p>
760763 * <ul>
761- * <li>{@code null} — to literal null ({@code "null"})</li>
762764 * <li>failed result (thrown {@link Throwable}) — to {@link Failure}</li>
763765 * <li>regular result — via
764766 * {@code generation.}{@link ExpectedGeneration#getExpectedSourceCodeGenerator()
765767 * expectedSourceCodeGenerator}</li>
768+ * <li>{@code null} — to literal null ({@code "null"})</li>
766769 * </ul>
767770 *
768771 * @param expected
@@ -831,7 +834,7 @@ protected <T> void generateExpectedSourceCode(@Nullable Object expected,
831834 ExpectedGeneration generation ) {
832835 String expectedSourceCode ;
833836 if (expected == null ) {
834- expectedSourceCode = "null" ;
837+ expectedSourceCode = LITERAL_NULL ;
835838 } else if (expected instanceof Failure ) {
836839 var failure = (Failure ) expected ;
837840 expectedSourceCode = String .format ("new %s(\" %s\" , %s)" ,
0 commit comments