Skip to content

Commit

Permalink
Cleanup usages of System.getProperty calls. (#261)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
turbanoff committed Sep 14, 2024
1 parent 5b24341 commit c805b8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
* @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";

Expand Down Expand Up @@ -834,7 +834,7 @@ public void execute() {
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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
@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
Expand Down

0 comments on commit c805b8f

Please sign in to comment.