From 687d4769af8008ef188cadccd53c0e2bf15d4865 Mon Sep 17 00:00:00 2001 From: "Piotr P. Karwasz" Date: Fri, 9 Feb 2024 14:12:24 +0100 Subject: [PATCH] Remove remaining `StringBuilderFormattable` occurences --- .../docgen/processor/internal/StructuralNodeImpl.java | 7 +------ .../log4j/docgen/processor/internal/TableImpl.java | 9 +-------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/internal/StructuralNodeImpl.java b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/internal/StructuralNodeImpl.java index b0639ca7..65f3e660 100644 --- a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/internal/StructuralNodeImpl.java +++ b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/internal/StructuralNodeImpl.java @@ -19,7 +19,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.apache.logging.log4j.util.StringBuilderFormattable; import org.asciidoctor.ast.ContentNode; import org.asciidoctor.ast.Cursor; import org.asciidoctor.ast.StructuralNode; @@ -92,11 +91,7 @@ protected static void formatNodeCollection( } else { first = false; } - if (node instanceof final StringBuilderFormattable formattable) { - formattable.formatTo(buffer); - } else { - buffer.append(node.convert()); - } + formatNode(node, buffer); } } diff --git a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/internal/TableImpl.java b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/internal/TableImpl.java index aaebadac..cb4454a2 100644 --- a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/internal/TableImpl.java +++ b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/internal/TableImpl.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.List; -import org.apache.logging.log4j.util.StringBuilderFormattable; import org.asciidoctor.ast.Column; import org.asciidoctor.ast.ContentNode; import org.asciidoctor.ast.Row; @@ -54,13 +53,7 @@ private static void formatColSpecifier(final int colCount, final StringBuilder b private static void formatRow(final Row row, final StringBuilder buffer) { buffer.append('\n'); - row.getCells().forEach(cell -> { - if (cell instanceof final StringBuilderFormattable formattable) { - formattable.formatTo(buffer); - } else { - buffer.append(cell.convert()); - } - }); + formatNodeCollection(row.getCells(), "", buffer); } @Override