maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject [maven] branch maven-3.8.x updated: [MNG-6816] Prefer System.lineSeparator() over system properties
Date Sat, 26 Jun 2021 21:46:21 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/maven-3.8.x by this push:
     new d4ad077  [MNG-6816] Prefer System.lineSeparator() over system properties
d4ad077 is described below

commit d4ad077ef5c440d86f3c9110e96ae00cf7d246bf
Author: Artem Krosheninnikov <feeblehamster@gmail.com>
AuthorDate: Mon Dec 9 15:53:58 2019 +0300

    [MNG-6816] Prefer System.lineSeparator() over system properties
    
    This closes #300
---
 .../artifact/resolver/AbstractArtifactResolutionException.java      | 2 +-
 .../org/apache/maven/project/validation/ModelValidationResult.java  | 6 +++---
 .../maven/artifact/resolver/ArtifactResolutionExceptionTest.java    | 2 +-
 .../apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java | 2 +-
 .../maven/toolchain/building/DefaultToolchainsBuilderTest.java      | 2 +-
 .../maven/toolchain/building/ToolchainsBuildingExceptionTest.java   | 2 +-
 .../src/main/java/org/apache/maven/cli/CLIReportingUtils.java       | 2 +-
 .../cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java      | 2 +-
 .../test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java | 2 +-
 9 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
index b63428e..a2917b5 100644
--- a/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
+++ b/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
@@ -52,7 +52,7 @@ public class AbstractArtifactResolutionException
 
     private final String path;
 
-    static final String LS = System.getProperty( "line.separator" );
+    static final String LS = System.lineSeparator();
 
     @SuppressWarnings( "checkstyle:parameternumber" )
     protected AbstractArtifactResolutionException( String message,
diff --git a/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
b/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
index 5033b99..9e2966e 100644
--- a/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
+++ b/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
@@ -30,7 +30,7 @@ public class ModelValidationResult
 {
 
     /** */
-    private static final String NEWLINE = System.getProperty( "line.separator" );
+    private static final String LS = System.lineSeparator();
 
     /** */
     private List<String> messages;
@@ -80,13 +80,13 @@ public class ModelValidationResult
 //        }
 //        else
 //        {
-//            message.append( "There was " + messages.size() + " validation errors: " + NEWLINE
);
+//            message.append( "There was " + messages.size() + " validation errors: " + LS
);
 //        }
 //
         for ( int i = 0; i < messages.size(); i++ )
         {
             message.append( indentation ).append( '[' ).append( i ).append( "]  " ).append(
messages.get( i ) ).append(
-                NEWLINE );
+                LS );
         }
 
         return message.toString();
diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolutionExceptionTest.java
b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolutionExceptionTest.java
index 059aa2c..8b75149 100644
--- a/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolutionExceptionTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/artifact/resolver/ArtifactResolutionExceptionTest.java
@@ -32,7 +32,7 @@ import junit.framework.TestCase;
 public class ArtifactResolutionExceptionTest
     extends TestCase
 {
-    private static final String LS = System.getProperty( "line.separator" );
+    private static final String LS = System.lineSeparator();
 
     public void testMissingArtifactMessageFormat()
     {
diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java
b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java
index e380949..04a7ee5 100644
--- a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java
+++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorTest.java
@@ -53,7 +53,7 @@ import org.codehaus.plexus.util.dag.CycleDetectedException;
 public class PluginParameterExpressionEvaluatorTest
     extends AbstractCoreMavenComponentTestCase
 {
-    private static final String FS = System.getProperty( "file.separator" );
+    private static final String FS = File.separator;
 
     private RepositorySystem factory;
 
diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java
b/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java
index 2c20d3c..f04d248 100644
--- a/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java
+++ b/maven-core/src/test/java/org/apache/maven/toolchain/building/DefaultToolchainsBuilderTest.java
@@ -47,7 +47,7 @@ import static org.mockito.Mockito.doThrow;
 
 public class DefaultToolchainsBuilderTest
 {
-    private static final String LS = System.getProperty( "line.separator" );
+    private static final String LS = System.lineSeparator();
 
     @Spy
     private DefaultToolchainsReader toolchainsReader;
diff --git a/maven-core/src/test/java/org/apache/maven/toolchain/building/ToolchainsBuildingExceptionTest.java
b/maven-core/src/test/java/org/apache/maven/toolchain/building/ToolchainsBuildingExceptionTest.java
index bf745c2..0efda4d 100644
--- a/maven-core/src/test/java/org/apache/maven/toolchain/building/ToolchainsBuildingExceptionTest.java
+++ b/maven-core/src/test/java/org/apache/maven/toolchain/building/ToolchainsBuildingExceptionTest.java
@@ -30,7 +30,7 @@ import org.junit.Test;
 
 public class ToolchainsBuildingExceptionTest
 {
-    private static final String LS = System.getProperty( "line.separator" );
+    private static final String LS = System.lineSeparator();
 
     @Test
     public void testNoProblems()
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
index fb78239..d562c88 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
@@ -55,7 +55,7 @@ public final class CLIReportingUtils
 
     public static String showVersion()
     {
-        final String ls = System.getProperty( "line.separator" );
+        final String ls = System.lineSeparator();
         Properties properties = getBuildProperties();
         StringBuilder version = new StringBuilder( 256 );
         version.append( buffer().strong( createMavenVersionString( properties ) ) ).append(
ls );
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java
b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java
index 4757cff..222ab4d 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java
@@ -54,7 +54,7 @@ public class UnsupportedSlf4jBindingConfiguration
         logger.warn( "The SLF4J binding actually used is not supported by Maven: {}", slf4jBinding
);
         logger.warn( "Maven supported bindings are:" );
 
-        String ls = System.getProperty( "line.separator" );
+        String ls = System.lineSeparator();
 
         for ( Map.Entry<URL, Set<Object>> entry : supported.entrySet() )
         {
diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java
b/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java
index 3a78f33..2c82a72 100644
--- a/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java
+++ b/maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java
@@ -39,7 +39,7 @@ import junit.framework.TestCase;
 public class CLIManagerDocumentationTest
     extends TestCase
 {
-    private final static String LS = System.getProperty( "line.separator" );
+    private final static String LS = System.lineSeparator();
 
     private static class OptionComparator
         implements Comparator<Option>

Mime
View raw message