kwin commented on code in PR #1042:
URL: https://github.com/apache/maven-doxia/pull/1042#discussion_r2900198487


##########
doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java:
##########
@@ -135,9 +135,20 @@ public Xhtml5BaseSink(Writer out) {
         this.tableCaptionXMLWriterStack = new LinkedList<>();
         this.tableCaptionStack = new LinkedList<>();
 
-        init();
+        doInit();
     }
 
+    /**
+     * Called from constructor and from {@link #init()} to initialize certain 
instance fields.
+     */
+    private void doInit() {

Review Comment:
   Renamed in 
https://github.com/apache/maven-doxia/pull/1042/commits/977d4f6bf472e4b2817f855db1e6ce13c55bd8f6.



##########
doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownSink.java:
##########
@@ -341,21 +339,34 @@ private String 
escapeForTableCell(LastTwoLinesBufferingWriter writer, String tex
     // ----------------------------------------------------------------------
 
     protected static MarkdownSink newInstance(Writer writer) {
-        LastTwoLinesBufferingWriter bufferingWriter = new 
LastTwoLinesBufferingWriter(writer);
-        return new MarkdownSink(bufferingWriter, new 
PrintWriter(bufferingWriter));
+        BufferingStackWriter bufferingStackWriter = new 
BufferingStackWriter(writer);
+        LastTwoLinesAwareWriter lineAwareWriter = new 
LastTwoLinesAwareWriter(bufferingStackWriter);
+        return new MarkdownSink(lineAwareWriter, bufferingStackWriter);
     }
 
     /**
      * Constructor, initialize the Writer and the variables.
      *
      * @param writer not null writer to write the result. <b>Should</b> be an 
UTF-8 Writer.
      */
-    private MarkdownSink(LastTwoLinesBufferingWriter bufferingWriter, 
PrintWriter writer) {
-        super(writer);
-        this.bufferingWriter = bufferingWriter;
-        this.writer = writer;
+    private MarkdownSink(LastTwoLinesAwareWriter lineAwareWriter, 
BufferingStackWriter bufferingStackWriter) {
+        super(lineAwareWriter);
+        this.lineAwareWriter = lineAwareWriter;
+        this.bufferingStackWriter = bufferingStackWriter;
+        doInit();
+    }
 
-        init();
+    private void doInit() {

Review Comment:
   Renamed in 
https://github.com/apache/maven-doxia/pull/1042/commits/977d4f6bf472e4b2817f855db1e6ce13c55bd8f6



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to