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

olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new c805b8f  Cleanup usages of System.getProperty calls. (#261)
c805b8f is described below

commit c805b8f2446e56f597acb80378427a2743ede0b0
Author: Andrey Turbanov <turban...@gmail.com>
AuthorDate: Sat Sep 14 11:58:55 2024 +0300

    Cleanup usages of System.getProperty calls. (#261)
    
    No need to call System.getPropery with magic names 'path.separator' and 
'line.separator'.
    Java does that for us and provides friendly methods/fields for them.
---
 .../java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java   | 4 ++--
 .../org/apache/maven/plugin/compiler/CompilationFailureException.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java 
b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
index f44bd81..8a5126e 100644
--- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
+++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
@@ -91,7 +91,7 @@ import org.objectweb.asm.Opcodes;
  * @since 2.0
  */
 public abstract class AbstractCompilerMojo implements Mojo {
-    protected static final String PS = System.getProperty("path.separator");
+    protected static final String PS = File.pathSeparator;
 
     private static final String INPUT_FILES_LST_FILENAME = "inputFiles.lst";
 
@@ -834,7 +834,7 @@ public abstract class AbstractCompilerMojo implements Mojo {
                     getLog().warn("You are in a multi-thread build and 
compilerReuseStrategy is set to reuseSame."
                             + " This can cause issues in some environments 
(os/jdk)!"
                             + " Consider using reuseCreated strategy."
-                            + System.getProperty("line.separator")
+                            + System.lineSeparator()
                             + "If your env is fine with reuseSame, you can 
skip this warning with the "
                             + "configuration field skipMultiThreadWarning "
                             + "or 
-Dmaven.compiler.skipMultiThreadWarning=true");
diff --git 
a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
 
b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
index 9efc5d8..53bbfa5 100644
--- 
a/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
+++ 
b/src/main/java/org/apache/maven/plugin/compiler/CompilationFailureException.java
@@ -29,7 +29,7 @@ import org.codehaus.plexus.compiler.CompilerMessage;
  */
 @SuppressWarnings("serial")
 public class CompilationFailureException extends MojoException {
-    private static final String LS = System.getProperty("line.separator");
+    private static final String LS = System.lineSeparator();
 
     /**
      * Wrap error messages from the compiler

Reply via email to