You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/07/27 15:48:30 UTC

[maven-doxia] branch simplify-ls created (now 55ab163f)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch simplify-ls
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git


      at 55ab163f Try

This branch includes the following new commits:

     new 768a5ffa Simplify line separator handling
     new 55ab163f Try

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-doxia] 02/02: Try

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch simplify-ls
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git

commit 55ab163f86c75c9bfa9c72933c9bf9aef15930cb
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Jul 27 17:48:11 2022 +0200

    Try
---
 .../maven/doxia/parser/AbstractXmlParser.java      |  5 ++--
 .../org/apache/maven/doxia/AbstractModuleTest.java | 16 +------------
 .../maven/doxia/parser/AbstractParserTest.java     |  9 ++++----
 .../maven/doxia/parser/Xhtml5BaseParserTest.java   |  1 +
 .../org/apache/maven/doxia/module/apt/AptSink.java |  2 +-
 .../maven/doxia/module/xdoc/XdocParserTest.java    | 13 ++++++-----
 .../maven/doxia/module/xdoc/XdocSinkTest.java      | 12 ++++++----
 .../maven/doxia/module/xhtml5/Xhtml5SinkTest.java  | 27 +++++++++++-----------
 8 files changed, 39 insertions(+), 46 deletions(-)

diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
index 61363bbd..28c2a22c 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
@@ -37,6 +37,7 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import org.apache.maven.doxia.macro.MacroExecutionException;
+import org.apache.maven.doxia.markup.Markup;
 import org.apache.maven.doxia.markup.XmlMarkup;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
@@ -648,7 +649,7 @@ public abstract class AbstractXmlParser
         int entitiesCount = StringUtils.countMatches( text, ENTITY_START );
         if ( entitiesCount > 0 )
         {
-            final String txt = StringUtils.replace( text, ENTITY_START, "\n" + ENTITY_START );
+            final String txt = StringUtils.replace( text, ENTITY_START, Markup.EOL + ENTITY_START );
             try ( BufferedReader reader = new BufferedReader( new StringReader( txt ) ) )
             {
                 String line;
@@ -656,7 +657,7 @@ public abstract class AbstractXmlParser
                 Matcher matcher;
                 while ( ( line = reader.readLine() ) != null )
                 {
-                    tmpLine += "\n" + line;
+                    tmpLine += Markup.EOL + line;
                     matcher = PATTERN_ENTITY_1.matcher( tmpLine );
                     if ( matcher.find() && matcher.groupCount() == 7 )
                     {
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/AbstractModuleTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/AbstractModuleTest.java
index d7d77747..a9dd50df 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/AbstractModuleTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/AbstractModuleTest.java
@@ -44,20 +44,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 public abstract class AbstractModuleTest
     implements Markup
 {
-
-    /*
-     * Set the system properties:
-     * <ul>
-     * <li><code>line.separator</code> to <code>\n</code> (Unix) to prevent
-     * failure on windows.</li>
-     * </ul>
-     */
-    static
-    {
-        // Safety
-        System.setProperty( "line.separator", "\n" );
-    }
-
     // ----------------------------------------------------------------------
     // Methods for creating test reader and writer
     // ----------------------------------------------------------------------
@@ -110,7 +96,7 @@ public abstract class AbstractModuleTest
     {
         if ( s != null )
         {
-            return s.replaceAll( "\r\n", "\n" ).replaceAll( "\r", "\n" );
+            return s.replaceAll( "\r?\n", System.lineSeparator() );
         }
         else
         {
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java
index 625ed684..4c33c552 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java
@@ -20,6 +20,7 @@ package org.apache.maven.doxia.parser;
  */
 
 import org.apache.maven.doxia.AbstractModuleTest;
+import org.apache.maven.doxia.markup.Markup;
 import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
 import org.apache.maven.doxia.sink.impl.SinkEventElement;
 import org.apache.maven.doxia.sink.impl.TextSink;
@@ -125,12 +126,12 @@ public abstract class AbstractParserTest
 
         for ( String name : names )
         {
-            expected.append( name ).append( '\n' );
+            expected.append( name ).append( Markup.EOL );
         }
 
         while ( it.hasNext() )
         {
-            actual.append( it.next().getName() ).append( '\n' );
+            actual.append( it.next().getName() ).append( Markup.EOL );
         }
 
         Assertions.assertEquals( expected.toString(), actual.toString() );
@@ -143,10 +144,10 @@ public abstract class AbstractParserTest
 
         for ( String name : names )
         {
-            expected.append( name ).append( '\n' );
+            expected.append( name ).append( Markup.EOL );
             if ( it.hasNext() )
             {
-                actual.append( it.next().getName() ).append( '\n' );
+                actual.append( it.next().getName() ).append( Markup.EOL );
             }
         }
         Assertions.assertEquals( expected.toString(), actual.toString() );
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java
index 4dd446b0..0ab5495d 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java
@@ -21,6 +21,7 @@ package org.apache.maven.doxia.parser;
 
 import java.util.Iterator;
 
+import org.apache.maven.doxia.markup.Markup;
 import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
 import org.apache.maven.doxia.sink.impl.SinkEventElement;
 import org.apache.maven.doxia.sink.impl.SinkEventTestingSink;
diff --git a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
index 27ea91eb..c263fb9a 100644
--- a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
+++ b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
@@ -433,7 +433,7 @@ public class AptSink
     public void listItem()
     {
         //if ( !numberedList )
-        //write( LS + listNestingIndent + "*" );
+        //write( EOL + listNestingIndent + "*" );
         //else
         numberedListItem();
         itemFlag = true;
diff --git a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
index 4909b048..3a0b8327 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
+++ b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
@@ -30,6 +30,7 @@ import java.io.Writer;
 import java.util.Iterator;
 import java.util.regex.Pattern;
 
+import org.apache.maven.doxia.markup.Markup;
 import org.apache.maven.doxia.parser.AbstractParserTest;
 import org.apache.maven.doxia.parser.ParseException;
 import org.apache.maven.doxia.parser.Parser;
@@ -426,12 +427,12 @@ public class XdocParserTest
     public void testStyleWithCData() throws Exception
     {
         // DOXIA-449
-        final String text = "<style type=\"text/css\">\n" +
-                "<![CDATA[\n" +
-                "h2 {\n" +
-                "font-size: 50px;\n" +
-                "}\n" +
-                "]]>\n" +
+        final String text = "<style type=\"text/css\">" + Markup.EOL +
+                "<![CDATA" + Markup.EOL +
+                "h2 {" + Markup.EOL +
+                "font-size: 50px;" + Markup.EOL +
+                "}" + Markup.EOL +
+                "]]>" + Markup.EOL +
                 "</style>";
 
         SinkEventTestingSink sink = new SinkEventTestingSink();
diff --git a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
index 3f2ca708..530f1eb1 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
+++ b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
@@ -1,5 +1,7 @@
 package org.apache.maven.doxia.module.xdoc;
 
+import org.apache.maven.doxia.markup.Markup;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -202,19 +204,19 @@ public class XdocSinkTest
     /** {@inheritDoc} */
     protected String getListBlock( String item )
     {
-        return "<ul>\n<li>" + item + "</li></ul>";
+        return "<ul>" + Markup.EOL + "<li>" + item + "</li></ul>";
     }
 
     /** {@inheritDoc} */
     protected String getNumberedListBlock( String item )
     {
-        return "<ol style=\"list-style-type: lower-roman\">\n<li>" + item + "</li></ol>";
+        return "<ol style=\"list-style-type: lower-roman\">" + Markup.EOL + "<li>" + item + "</li></ol>";
     }
 
     /** {@inheritDoc} */
     protected String getDefinitionListBlock( String definum, String definition )
     {
-        return "<dl>\n<dt>" + definum + "</dt>\n<dd>" + definition + "</dd></dl>";
+        return "<dl>" + Markup.EOL + "<dt>" + definum + "</dt>" + Markup.EOL + "<dd>" + definition + "</dd></dl>";
     }
 
     /** {@inheritDoc} */
@@ -233,7 +235,7 @@ public class XdocSinkTest
     protected String getTableBlock( String cell, String caption )
     {
         return "<table border=\"0\"><caption>" + caption
-                + "</caption>\n<tr valign=\"top\">\n<td align=\"center\">" + cell + "</td></tr></table>";
+                + "</caption>" + Markup.EOL + "<tr valign=\"top\">" + Markup.EOL + "<td align=\"center\">" + cell + "</td></tr></table>";
     }
 
     /** {@inheritDoc} */
@@ -400,7 +402,7 @@ public class XdocSinkTest
             sink.close();
         }
 
-        assertEquals( "<pre></pre><source></source>\n<pre width=\"20%\"></pre>", writer.toString() );
+        assertEquals( "<pre></pre><source></source>" + Markup.EOL + "<pre width=\"20%\"></pre>", writer.toString() );
     }
 
     /**
diff --git a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java
index 093db562..b8875a48 100644
--- a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java
+++ b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java
@@ -23,6 +23,7 @@ import java.io.StringWriter;
 import java.io.Writer;
 
 import org.apache.maven.doxia.markup.HtmlMarkup;
+import org.apache.maven.doxia.markup.Markup;
 import org.apache.maven.doxia.module.xhtml5.Xhtml5Sink;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.impl.AbstractSinkTest;
@@ -112,7 +113,7 @@ public class Xhtml5SinkTest
     protected String getHeadBlock()
     {
         return "<!DOCTYPE html\">" +
-                "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title></title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/></head>";
+                "<html xmlns=\"http://www.w3.org/1999/xhtml\">" + Markup.EOL + "<head>" + Markup.EOL + "<title></title>" + Markup.EOL + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/></head>";
     }
 
     /** {@inheritDoc} */
@@ -148,31 +149,31 @@ public class Xhtml5SinkTest
     /** {@inheritDoc} */
     protected String getSection1Block( String title )
     {
-        return "<section><header>\n<h1>" + title + "</h1></header></section>";
+        return "<section><header>" + Markup.EOL + "<h1>" + title + "</h1></header></section>";
     }
 
     /** {@inheritDoc} */
     protected String getSection2Block( String title )
     {
-        return "<section><header>\n<h2>" + title + "</h2></header></section>";
+        return "<section><header>" + Markup.EOL + "<h2>" + title + "</h2></header></section>";
     }
 
     /** {@inheritDoc} */
     protected String getSection3Block( String title )
     {
-        return "<section><header>\n<h3>" + title + "</h3></header></section>";
+        return "<section><header>" + Markup.EOL + "<h3>" + title + "</h3></header></section>";
     }
 
     /** {@inheritDoc} */
     protected String getSection4Block( String title )
     {
-        return "<section><header>\n<h4>" + title + "</h4></header></section>";
+        return "<section><header>" + Markup.EOL + "<h4>" + title + "</h4></header></section>";
     }
 
     /** {@inheritDoc} */
     protected String getSection5Block( String title )
     {
-        return "<section><header>\n<h5>" + title + "</h5></header></section>";
+        return "<section><header>" + Markup.EOL + "<h5>" + title + "</h5></header></section>";
     }
 
     /** {@inheritDoc} */
@@ -196,19 +197,19 @@ public class Xhtml5SinkTest
     /** {@inheritDoc} */
     protected String getListBlock( String item )
     {
-        return "<ul>\n<li>" + item + "</li></ul>";
+        return "<ul>" + Markup.EOL + "<li>" + item + "</li></ul>";
     }
 
     /** {@inheritDoc} */
     protected String getNumberedListBlock( String item )
     {
-        return "<ol style=\"list-style-type: lower-roman\">\n<li>" + item + "</li></ol>";
+        return "<ol style=\"list-style-type: lower-roman\">" + Markup.EOL + "<li>" + item + "</li></ol>";
     }
 
     /** {@inheritDoc} */
     protected String getDefinitionListBlock( String definum, String definition )
     {
-        return "<dl>\n<dt>" + definum + "</dt>\n<dd>" + definition + "</dd></dl>";
+        return "<dl>" + Markup.EOL + "<dt>" + definum + "</dt>" + Markup.EOL + "<dd>" + definition + "</dd></dl>";
     }
 
     /** {@inheritDoc} */
@@ -227,7 +228,7 @@ public class Xhtml5SinkTest
     protected String getTableBlock( String cell, String caption )
     {
         return "<table border=\"0\" class=\"bodyTable\">"
-            + "<caption>Table caption</caption><tr class=\"a\">\n<td>cell</td></tr>"
+            + "<caption>Table caption</caption><tr class=\"a\">" + Markup.EOL + "<td>cell</td></tr>"
             + "</table>";
     }
 
@@ -279,7 +280,7 @@ public class Xhtml5SinkTest
     /** {@inheritDoc} */
     protected String getVerbatimBlock( String text )
     {
-        return "<div class=\"source\">\n<pre>" + text + "</pre></div>";
+        return "<div class=\"source\">" + Markup.EOL + "<pre>" + text + "</pre></div>";
     }
 
     /** {@inheritDoc} */
@@ -407,7 +408,7 @@ public class Xhtml5SinkTest
             sink.close();
         }
 
-        assertEquals( "<section><header>\n<h1>&amp;</h1></header>\n<p>&amp;</p></section>", writer.toString() );
+        assertEquals( "<section><header>" + Markup.EOL + "<h1>&amp;</h1></header>" + Markup.EOL + "<p>&amp;</p></section>", writer.toString() );
     }
 
     /**
@@ -442,7 +443,7 @@ public class Xhtml5SinkTest
         }
 
         String expected =
-            "<head>\n<title>Title</title><!--A comment--><meta name=\"author\" content=\"&#x123;&amp;\" />"
+            "<head>" + Markup.EOL + "<title>Title</title><!--A comment--><meta name=\"author\" content=\"&#x123;&amp;\" />"
                 + "<base href=\"http://maven.apache.org/\" /></head>";
         String actual = writer.toString();
         assertTrue( actual.contains( expected ), actual );


[maven-doxia] 01/02: Simplify line separator handling

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch simplify-ls
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git

commit 768a5ffa2c18103a0eb51d8d576b0794a49c9acf
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Jul 27 17:18:24 2022 +0200

    Simplify line separator handling
---
 .../java/org/apache/maven/doxia/index/IndexEntry.java  |  6 +++---
 .../main/java/org/apache/maven/doxia/macro/Macro.java  |  2 +-
 .../maven/doxia/macro/snippet/SnippetReader.java       |  8 ++++----
 .../java/org/apache/maven/doxia/markup/Markup.java     |  2 +-
 .../org/apache/maven/doxia/sink/impl/AbstractSink.java |  2 +-
 .../apache/maven/doxia/sink/impl/AbstractXmlSink.java  |  4 ++--
 .../java/org/apache/maven/doxia/util/LineBreaker.java  |  8 ++++----
 .../maven/doxia/parser/Xhtml5BaseParserTest.java       |  9 ++++-----
 .../apache/maven/doxia/sink/impl/SinkTestDocument.java |  5 ++---
 .../org/apache/maven/doxia/sink/impl/TextSink.java     |  2 +-
 .../apache/maven/doxia/xsd/AbstractXmlValidator.java   | 18 +++++++++---------
 .../org/apache/maven/doxia/module/apt/AptSink.java     |  2 +-
 .../apache/maven/doxia/module/xdoc/XdocParserTest.java |  2 +-
 13 files changed, 34 insertions(+), 36 deletions(-)

diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java
index 43536131..af0e98f0 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java
@@ -53,9 +53,9 @@ public class IndexEntry
     private List<IndexEntry> childEntries = new ArrayList<>();
 
     /**
-     * System-dependent EOL.
+     * System-dependent line separator.
      */
-    private static final String EOL = System.getProperty( "line.separator" );
+    private static final String LS = System.lineSeparator();
 
     /**
      * Constructor.
@@ -300,7 +300,7 @@ public class IndexEntry
             message.append( ", title: " ).append( title );
         }
 
-        message.append( EOL );
+        message.append( LS );
 
         StringBuilder indent = new StringBuilder();
 
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/macro/Macro.java b/doxia-core/src/main/java/org/apache/maven/doxia/macro/Macro.java
index 2ae82096..b8541bfd 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/macro/Macro.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/macro/Macro.java
@@ -31,7 +31,7 @@ public interface Macro
 {
 
     /** The vm line separator */
-    String EOL = System.getProperty( "line.separator" );
+    String EOL = System.lineSeparator();
 
     /**
      * Execute the current macro using the given MacroRequest,
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java b/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
index c313bd61..504e8ddf 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
@@ -35,8 +35,8 @@ import org.codehaus.plexus.util.IOUtil;
  */
 public class SnippetReader
 {
-    /** System-dependent EOL. */
-    private static final String EOL = System.getProperty( "line.separator" );
+    /** System-dependent line separator. */
+    private static final String LS = System.lineSeparator();
 
     /** The source. */
     private URL source;
@@ -82,7 +82,7 @@ public class SnippetReader
         for ( String line : lines )
         {
             result.append( line.substring( minIndent ) );
-            result.append( EOL );
+            result.append( LS );
         }
         return result;
     }
@@ -219,7 +219,7 @@ public class SnippetReader
         String snippetRegExp = "(^|\\W)(?i:SNIPPET)($|\\W)";
         String snippetIdRegExp = "(^|\\W)" + snippetId + "($|\\W)";
         String whatRegExp = "(^|\\W)(?i:" + what + ")($|\\W)";
-        
+
         return Pattern.compile( snippetRegExp ).matcher( line ).find()
             && Pattern.compile( whatRegExp ).matcher( line ).find()
             && Pattern.compile( snippetIdRegExp ).matcher( line ).find();
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/markup/Markup.java b/doxia-core/src/main/java/org/apache/maven/doxia/markup/Markup.java
index 0eff103b..08493a77 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/markup/Markup.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/markup/Markup.java
@@ -29,7 +29,7 @@ package org.apache.maven.doxia.markup;
 public interface Markup
 {
     /** The vm line separator */
-    String EOL = System.getProperty( "line.separator" );
+    String EOL = System.lineSeparator();
 
     // ----------------------------------------------------------------------
     // Generic separator characters
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/AbstractSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/AbstractSink.java
index e5495cf2..fa142373 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/AbstractSink.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/AbstractSink.java
@@ -34,7 +34,7 @@ public abstract class AbstractSink
 {
     /**
       * Parses the given String and replaces all occurrences of
-      * '\n', '\r' and '\r\n' with the system EOL. All Sinks should
+      * '\n', '\r' and '\r\n' with the system LS. All Sinks should
       * make sure that text output is filtered through this method.
       *
       * @param text the text to scan.
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/AbstractXmlSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/AbstractXmlSink.java
index 5dbb5591..a956a09f 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/AbstractXmlSink.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/AbstractXmlSink.java
@@ -148,7 +148,7 @@ public abstract class AbstractXmlSink
     }
 
     /**
-     * Writes a system EOL.
+     * Writes a system LS.
      *
      * @since 1.1
      */
@@ -158,7 +158,7 @@ public abstract class AbstractXmlSink
     }
 
     /**
-     * Ends a Tag without writing an EOL. For instance: <pre>&lt;/tag&gt;</pre>.
+     * Ends a Tag without writing an LS. For instance: <pre>&lt;/tag&gt;</pre>.
      *
      * @param t a tag.
      */
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java b/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java
index 6a0898e0..a7d7670c 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/util/LineBreaker.java
@@ -33,8 +33,8 @@ public class LineBreaker
     /** The default maximal line length. */
     public static final int DEFAULT_MAX_LINE_LENGTH = 78;
 
-    /** The system dependent EOL. */
-    private static final String EOL = System.getProperty( "line.separator" );
+    /** The system dependent line separator. */
+    private static final String LS = System.lineSeparator();
 
     /** The destination writer. */
     private Writer destination;
@@ -139,7 +139,7 @@ public class LineBreaker
 
                     case '\n':
                         writeWord();
-                        writer.write( EOL );
+                        writer.write( LS );
                         lineLength = 0;
                         break;
 
@@ -187,7 +187,7 @@ public class LineBreaker
             {
                 if ( lineLength + 1 + length > maxLineLength )
                 {
-                    writer.write( EOL );
+                    writer.write( LS );
                     lineLength = 0;
                 }
                 else
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java
index 9fd83ef4..4dd446b0 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java
@@ -211,9 +211,8 @@ public class Xhtml5BaseParserTest
         assertFalse( it.hasNext() );
 
 
-        // same test with EOL
-        String eol = System.getProperty( "line.separator" );
-        text = "<p><b>word</b>" + eol + "<i>word</i></p>";
+        // same test with system line separator
+        text = "<p><b>word</b>" + Xhtml5BaseParser.EOL + "<i>word</i></p>";
 
         sink.reset();
         parser.parse( text, sink );
@@ -236,7 +235,7 @@ public class Xhtml5BaseParserTest
         assertFalse( it.hasNext() );
 
 
-        // DOXIA-189: there should be no EOL after closing tag
+        // DOXIA-189: there should be no LS after closing tag
         text = "<p>There should be no space after the last <i>word</i>.</p>";
 
         sink.reset();
@@ -298,7 +297,7 @@ public class Xhtml5BaseParserTest
     public void testPreEOL()
         throws Exception
     {
-        // test EOLs within <pre>: the sink MUST receive a text event for the EOL
+        // test EOLs within <pre>: the sink MUST receive a text event for the LS
         String text = "<pre><a href=\"what.html\">what</a>" + Xhtml5BaseParser.EOL
                 + "<a href=\"what.html\">what</a></pre>";
 
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkTestDocument.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkTestDocument.java
index f11d9172..ea94d52a 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkTestDocument.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkTestDocument.java
@@ -1,5 +1,6 @@
 package org.apache.maven.doxia.sink.impl;
 
+import org.apache.maven.doxia.markup.Markup;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
 
@@ -248,8 +249,6 @@ public class SinkTestDocument
      */
     public static void generateDefinitionList( Sink sink )
     {
-        String eol = System.getProperty( "line.separator" );
-
         sink.definitionList();
 
         sink.definitionListItem();
@@ -268,7 +267,7 @@ public class SinkTestDocument
         sink.definition();
         sink.text( "of definition list." );
         sink.verbatim( SinkEventAttributeSet.BOXED );
-        sink.text( "Verbatim text" + eol + "                        in a box        " );
+        sink.text( "Verbatim text" + Markup.EOL + "                        in a box        " );
         sink.verbatim_();
         sink.definition_();
         sink.definitionListItem_();
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/TextSink.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/TextSink.java
index b5a34f76..dbccd672 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/TextSink.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/TextSink.java
@@ -1020,7 +1020,7 @@ public class TextSink
     }
 
     /**
-     * Writes the given string + EOL.
+     * Writes the given string + LS.
      *
      * @param text The text to write.
      */
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java b/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java
index 4ac46a59..412711d6 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java
@@ -55,7 +55,7 @@ import static org.junit.jupiter.api.Assertions.fail;
 public abstract class AbstractXmlValidator
 {
 
-    protected static final String EOL = System.getProperty( "line.separator" );
+    protected static final String LS = System.lineSeparator();
 
     protected final Logger logger = LoggerFactory.getLogger( getClass() );
 
@@ -113,13 +113,13 @@ public abstract class AbstractXmlValidator
             {
                 if ( isFailErrorMessage( error.getMessage() ) )
                 {
-                    fail( entry.getKey() + EOL + error.toString() );
+                    fail( entry.getKey() + LS + error );
                 }
                 else
                 {
                     if ( logger.isDebugEnabled() )
                     {
-                        logger.debug( entry.getKey() + EOL + error.toString() );
+                        logger.debug( entry.getKey() + LS + error );
                     }
                 }
             }
@@ -287,12 +287,12 @@ public abstract class AbstractXmlValidator
         {
             StringBuilder sb = new StringBuilder( 512 );
 
-            sb.append( level ).append( EOL );
-            sb.append( "  Public ID: " ).append( publicID ).append( EOL );
-            sb.append( "  System ID: " ).append( systemID ).append( EOL );
-            sb.append( "  Line number: " ).append( lineNumber ).append( EOL );
-            sb.append( "  Column number: " ).append( columnNumber ).append( EOL );
-            sb.append( "  Message: " ).append( message ).append( EOL );
+            sb.append( level ).append( LS );
+            sb.append( "  Public ID: " ).append( publicID ).append( LS );
+            sb.append( "  System ID: " ).append( systemID ).append( LS );
+            sb.append( "  Line number: " ).append( lineNumber ).append( LS );
+            sb.append( "  Column number: " ).append( columnNumber ).append( LS );
+            sb.append( "  Message: " ).append( message ).append( LS );
 
             return sb.toString();
         }
diff --git a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
index c263fb9a..27ea91eb 100644
--- a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
+++ b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
@@ -433,7 +433,7 @@ public class AptSink
     public void listItem()
     {
         //if ( !numberedList )
-        //write( EOL + listNestingIndent + "*" );
+        //write( LS + listNestingIndent + "*" );
         //else
         numberedListItem();
         itemFlag = true;
diff --git a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
index 7469c59a..4909b048 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
+++ b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
@@ -314,7 +314,7 @@ public class XdocParserTest
     public void testPreEOL()
         throws Exception
     {
-        // test EOLs within <source>: the sink MUST receive a text event for the EOL
+        // test EOLs within <source>: the sink MUST receive a text event for the LS
         String text = "<source><a href=\"what.html\">what</a>" + EOL
                 + "<a href=\"what.html\">what</a></source>";