Skip to content

Commit

Permalink
[cross] For better cross platform support, use the system line separator
Browse files Browse the repository at this point in the history
  • Loading branch information
hazendaz committed Mar 12, 2023
1 parent 94eece5 commit 17d39ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
log.info('No errors/warnings found')
return
} else if (maxAllowedViolations > 0 && bugCount <= maxAllowedViolations) {
log.info("total ${bugCount} violations are found which is set to be acceptable using configured property maxAllowedViolations :"+maxAllowedViolations +".\nBelow are list of bugs ignored :\n")
log.info("total ${bugCount} violations are found which is set to be acceptable using configured property maxAllowedViolations :" + maxAllowedViolations + "." + SpotBugsInfo.EOL + "Below are list of bugs ignored :" + SpotBugsInfo.EOL)
printBugs(bugCount, bugs)
return;
}
Expand Down Expand Up @@ -536,7 +536,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
}
}

log.info('\n\n\nTo see bug detail using the Spotbugs GUI, use the following command "mvn spotbugs:gui"\n\n\n')
log.info(SpotBugsInfo.EOL + SpotBugsInfo.EOL + SpotBugsInfo.EOL + 'To see bug detail using the Spotbugs GUI, use the following command "mvn spotbugs:gui"' + SpotBugsInfo.EOL + SpotBugsInfo.EOL + SpotBugsInfo.EOL)

if ((bugCountAboveThreshold || errorCount) && failOnError) {
throw new MojoExecutionException("failed with ${bugCountAboveThreshold} bugs and ${errorCount} errors ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ interface SpotBugsInfo {

static final String PERIOD = "."

static final EOL = "\n"
static final EOL = System.lineSeparator()

static final String URL = "url"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {

auxClasspathList.each() { auxClasspathElement ->
log.debug(" Adding to AuxClasspath ->" + auxClasspathElement.toString())
auxClasspathFile << auxClasspathElement.toString() + "\n"
auxClasspathFile << auxClasspathElement.toString() + SpotBugsInfo.EOL
}
}
}
Expand Down Expand Up @@ -1244,7 +1244,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
writer.write "<?xml version=\"1.0\" encoding=\"" + effectiveEncoding.toLowerCase(Locale.ENGLISH) + "\"?>"
}

writer.write "\n"
writer.write SpotBugsInfo.EOL

writer << xmlBuilder.bind { mkp.yield path }
} else {
Expand Down

0 comments on commit 17d39ae

Please sign in to comment.