diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy index 270e079c..e7c6de57 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy @@ -45,7 +45,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.0.0 */ - @Parameter(defaultValue = "false", property = "spotbugs.xmlOutput", required = true) + @Parameter(defaultValue = 'false', property = 'spotbugs.xmlOutput', required = true) boolean xmlOutput /** @@ -69,7 +69,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 3.1.12.2 */ - @Parameter(defaultValue = "spotbugsXml.xml", property = "spotbugs.outputXmlFilename") + @Parameter(defaultValue = 'spotbugsXml.xml', property = 'spotbugs.outputXmlFilename') String spotbugsXmlOutputFilename /** Doxia Site Renderer. */ @@ -97,15 +97,15 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.0 */ - @Parameter(defaultValue = "false", property = "spotbugs.includeTests") + @Parameter(defaultValue = 'false', property = 'spotbugs.includeTests') boolean includeTests /** List of artifacts this plugin depends on. Used for resolving the Spotbugs core plugin. */ - @Parameter(property = "plugin.artifacts", required = true, readonly = true) + @Parameter(property = 'plugin.artifacts', readonly = true, required = true) List pluginArtifacts /** Maven Session. */ - @Parameter (defaultValue = '${session}', required = true, readonly = true) + @Parameter (defaultValue = '${session}', readonly = true, required = true) MavenSession session /** @@ -114,7 +114,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.2 */ - @Parameter(defaultValue = '${project.build.sourceEncoding}', property = "encoding") + @Parameter(defaultValue = '${project.build.sourceEncoding}', property = 'encoding') String sourceEncoding /** @@ -123,11 +123,14 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.2 */ - @Parameter(defaultValue = '${project.reporting.outputEncoding}', property = "outputEncoding") + @Parameter(defaultValue = '${project.reporting.outputEncoding}', property = 'outputEncoding') String outputEncoding - /** Threshold of minimum bug severity to report. Valid values are High, Default, Low, Ignore, and Exp (for experimental). */ - @Parameter(defaultValue = "Default", property = "spotbugs.threshold") + /** + * Threshold of minimum bug severity to report. Valid values are 'High', 'Default', 'Low', 'Ignore', + * and 'Exp' (for experimental). + */ + @Parameter(defaultValue = 'Default', property = 'spotbugs.threshold') String threshold /** Artifact resolver, needed to download the coreplugin jar. */ @@ -147,7 +150,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.0-beta-1 */ - @Parameter(property = "spotbugs.includeFilterFile") + @Parameter(property = 'spotbugs.includeFilterFile') String includeFilterFile /** @@ -163,7 +166,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.0-beta-1 */ - @Parameter(property = "spotbugs.excludeFilterFile") + @Parameter(property = 'spotbugs.excludeFilterFile') String excludeFilterFile /** @@ -180,7 +183,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.4.1 */ - @Parameter(property = "spotbugs.excludeBugsFile") + @Parameter(property = 'spotbugs.excludeBugsFile') String excludeBugsFile /** @@ -188,11 +191,11 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.0-beta-1 */ - @Parameter(defaultValue = "Default", property = "spotbugs.effort") + @Parameter(defaultValue = 'Default', property = 'spotbugs.effort') String effort /** Turn on Spotbugs debugging. */ - @Parameter(defaultValue = "false", property = "spotbugs.debug") + @Parameter(defaultValue = 'false', property = 'spotbugs.debug') boolean debug /** @@ -201,7 +204,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.1 */ - @Parameter(defaultValue = "false", property = "spotbugs.relaxed") + @Parameter(defaultValue = 'false', property = 'spotbugs.relaxed') boolean relaxed /** @@ -209,7 +212,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.0-beta-1 */ - @Parameter(property = "spotbugs.visitors") + @Parameter(property = 'spotbugs.visitors') String visitors /** @@ -217,7 +220,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.0-beta-1 */ - @Parameter(property = "spotbugs.omitVisitors") + @Parameter(property = 'spotbugs.omitVisitors') String omitVisitors /** @@ -232,7 +235,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.0-beta-1 */ - @Parameter(property="spotbugs.pluginList") + @Parameter(property = 'spotbugs.pluginList') String pluginList /** @@ -240,7 +243,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.1 */ - @Parameter(property = "spotbugs.onlyAnalyze") + @Parameter(property = 'spotbugs.onlyAnalyze') String onlyAnalyze /** @@ -249,7 +252,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.3.2 */ - @Parameter(property = "spotbugs.nested", defaultValue = "false") + @Parameter(defaultValue = 'false', property = 'spotbugs.nested') boolean nested /** @@ -258,7 +261,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.3.2 */ - @Parameter(property = "spotbugs.trace", defaultValue = "false") + @Parameter(defaultValue = 'false', property = 'spotbugs.trace') boolean trace /** @@ -266,7 +269,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.4.1 */ - @Parameter(property = "spotbugs.maxRank") + @Parameter(property = 'spotbugs.maxRank') int maxRank /** @@ -274,7 +277,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 1.1 */ - @Parameter(property = "spotbugs.skip", defaultValue = "false") + @Parameter(defaultValue = 'false', property = 'spotbugs.skip') boolean skip /** @@ -298,7 +301,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.0 */ - @Parameter(property = "spotbugs.failOnError", defaultValue = "true") + @Parameter(defaultValue = 'true', property = 'spotbugs.failOnError') boolean failOnError /** @@ -307,7 +310,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 4.0.1 */ - @Parameter(property = "spotbugs.failThreshold") + @Parameter(property = 'spotbugs.failThreshold') String failThreshold /** @@ -315,7 +318,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.3.2 */ - @Parameter(property = "spotbugs.fork", defaultValue = "true") + @Parameter(defaultValue = 'true', property = 'spotbugs.fork') boolean fork /** @@ -324,7 +327,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.2 */ - @Parameter(property = "spotbugs.maxHeap", defaultValue = "512") + @Parameter(defaultValue = '512', property = 'spotbugs.maxHeap') int maxHeap /** @@ -335,7 +338,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.2 */ - @Parameter(property = "spotbugs.timeout", defaultValue = "600000") + @Parameter(defaultValue = '600000', property = 'spotbugs.timeout') int timeout /** @@ -343,7 +346,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.4.1 */ - @Parameter(property = "spotbugs.jvmArgs") + @Parameter(property = 'spotbugs.jvmArgs') String jvmArgs /** @@ -351,29 +354,29 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { * * @since 2.4.1 */ - @Parameter(property = "spotbugs.maxAllowedViolations", defaultValue = "0") + @Parameter(defaultValue = '0', property = 'spotbugs.maxAllowedViolations') int maxAllowedViolations /** Disable bugs log. */ - @Parameter(defaultValue = "false", property = "spotbugs.quiet") + @Parameter(defaultValue = 'false', property = 'spotbugs.quiet') boolean quiet @Override void execute() { - log.debug("Executing spotbugs:check") + log.debug('Executing spotbugs:check') if (skip) { - log.info("Spotbugs plugin skipped") + log.info('Spotbugs plugin skipped') return } else if (!doSourceFilesExist()) { - log.debug("Nothing for SpotBugs to do here.") + log.debug('Nothing for SpotBugs to do here.') return } - log.debug("Here goes...............Executing spotbugs:check") + log.debug('Here goes...............Executing spotbugs:check') if (!spotbugsXmlOutputDirectory.exists() && !spotbugsXmlOutputDirectory.mkdirs()) { - throw new MojoExecutionException("Cannot create xml output directory") + throw new MojoExecutionException('Cannot create xml output directory') } File outputFile = new File("${spotbugsXmlOutputDirectory}/${spotbugsXmlOutputFilename}") @@ -393,7 +396,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 + "." + SpotBugsInfo.EOL + "Below are list of bugs ignored :" + SpotBugsInfo.EOL) + 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 } @@ -427,7 +430,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { 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 ") + throw new MojoExecutionException("failed with ${bugCountAboveThreshold} bugs and ${errorCount} errors") } } } @@ -436,16 +439,16 @@ abstract class BaseViolationCheckMojo extends AbstractMojo { Collection sourceFiles = new ArrayList<>() if (this.classFilesDirectory.isDirectory()) { - log.debug("looking for class files with extensions: " + SpotBugsInfo.EXTENSIONS) + log.debug('looking for class files with extensions: ' + SpotBugsInfo.EXTENSIONS) sourceFiles.addAll(FileUtils.listFiles(classFilesDirectory, SpotBugsInfo.EXTENSIONS, true)) } if (this.includeTests && this.testClassFilesDirectory.isDirectory()) { - log.debug("looking for test class files: " + SpotBugsInfo.EXTENSIONS) + log.debug('looking for test class files: ' + SpotBugsInfo.EXTENSIONS) sourceFiles.addAll(FileUtils.listFiles(testClassFilesDirectory, SpotBugsInfo.EXTENSIONS, true)) } - log.debug("SourceFiles: " + Arrays.toString(sourceFiles)); + log.debug('SourceFiles: ' + Arrays.toString(sourceFiles)); !sourceFiles.isEmpty() } diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/CheckMojo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/CheckMojo.groovy index b7652e3e..d13a348b 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/CheckMojo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/CheckMojo.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2005-2023 the original author or authors. + * Copyright 2005-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,8 +27,8 @@ import org.apache.maven.plugins.annotations.ResolutionScope * * @since 2.0 */ -@Mojo(name = "check", defaultPhase = LifecyclePhase.VERIFY, requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true, threadSafe = true) -@Execute(goal = "spotbugs") +@Mojo(name = 'check', defaultPhase = LifecyclePhase.VERIFY, requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true, threadSafe = true) +@Execute(goal = 'spotbugs') class CheckMojo extends BaseViolationCheckMojo { // Check Mojo to run spotbugs execution } diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy index 155a03ad..82a66488 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy @@ -76,13 +76,13 @@ final class ResourceHelper { location = location?.replaceAll("[\\?\\:\\&\\=\\%]", "_") artifact = artifact?.replaceAll("[\\?\\:\\&\\=\\%]", "_") - log.debug("resource is " + resource) - log.debug("location is " + location) - log.debug("artifact is " + artifact) + log.debug('resource is ' + resource) + log.debug('location is ' + location) + log.debug('artifact is ' + artifact) File resourceFile = getResourceAsFile(resource, artifact) - log.debug("location of resourceFile file is " + resourceFile.absolutePath) + log.debug('location of resourceFile file is ' + resourceFile.absolutePath) return resourceFile @@ -99,7 +99,7 @@ final class ResourceHelper { File outputResourceFile if (outputPath == null) { - outputResourceFile = Files.createTempFile("plexus-resources", "tmp") + outputResourceFile = Files.createTempFile('plexus-resources', 'tmp') } else if (outputDirectory != null) { outputResourceFile = new File(outputDirectory, outputPath) } else { @@ -117,7 +117,7 @@ final class ResourceHelper { os << is } catch (IOException e) { - throw new FileResourceCreationException("Cannot create file-based resource.", e) + throw new FileResourceCreationException('Cannot create file-based resource.', e) } return outputResourceFile diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SourceFileIndexer.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SourceFileIndexer.groovy index e22e7f74..b3073aae 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/SourceFileIndexer.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SourceFileIndexer.groovy @@ -59,9 +59,9 @@ class SourceFileIndexer { } //While not perfect, add the following paths will add basic support for Kotlin and Groovy - scanDirectory(new File(session.getCurrentProject().getBasedir(),"src/main/webapp"), allSourceFiles, basePath) - scanDirectory(new File(session.getCurrentProject().getBasedir(),"src/main/groovy"), allSourceFiles, basePath) - scanDirectory(new File(session.getCurrentProject().getBasedir(),"src/main/kotlin"), allSourceFiles, basePath) + scanDirectory(new File(session.getCurrentProject().getBasedir(), 'src/main/groovy'), allSourceFiles, basePath) + scanDirectory(new File(session.getCurrentProject().getBasedir(), 'src/main/kotlin'), allSourceFiles, basePath) + scanDirectory(new File(session.getCurrentProject().getBasedir(), 'src/main/webapp'), allSourceFiles, basePath) this.allSourceFiles = allSourceFiles } @@ -74,7 +74,7 @@ class SourceFileIndexer { * @param files ArrayList where files found will be stored * @param baseDirectory This part will be truncated from path stored */ - private void scanDirectory(File directory,List files,String baseDirectory) { + private void scanDirectory(File directory, List files, String baseDirectory) { if (!directory.exists()) { return @@ -124,15 +124,13 @@ class SourceFileIndexer { protected String searchActualFilesLocation(String filename) { if (allSourceFiles == null) { - throw new RuntimeException("Source files cache must be built prior to searches.") + throw new RuntimeException('Source files cache must be built prior to searches.') } for (String fileFound in allSourceFiles) { - if (fileFound.endsWith(filename)) { return fileFound } - } // Not found diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy index a72a0482..49153a20 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy @@ -39,7 +39,7 @@ import org.codehaus.plexus.resource.ResourceManager * * @description Launch the Spotbugs GUI using the parameters in the POM fle. */ -@Mojo(name = "gui", requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true) +@Mojo(name = 'gui', requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true) class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { /** Locale to use for Resource bundle. */ @@ -50,19 +50,19 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { File classFilesDirectory /** Turn on Spotbugs debugging. */ - @Parameter(defaultValue = "false", property="spotbugs.debug") + @Parameter(defaultValue = 'false', property = 'spotbugs.debug') boolean debug /** List of artifacts this plugin depends on. Used for resolving the Spotbugs core plugin. */ - @Parameter(property="plugin.artifacts", required = true, readonly = true) + @Parameter(property = 'plugin.artifacts', readonly = true, required = true) List pluginArtifacts /** Effort of the bug finders. Valid values are Min, Default and Max. */ - @Parameter(defaultValue = "Default", property="spotbugs.effort") + @Parameter(defaultValue = 'Default', property = 'spotbugs.effort') String effort /** The plugin list to include in the report. This is a SpotbugsInfo.COMMA-delimited list. */ - @Parameter(property="spotbugs.pluginList") + @Parameter(property = 'spotbugs.pluginList') String pluginList /** @@ -84,7 +84,7 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { RepositorySystem factory /** Maven Session. */ - @Parameter (defaultValue = '${session}', required = true, readonly = true) + @Parameter (defaultValue = '${session}', readonly = true, required = true) MavenSession session /** Specifies the directory where the Spotbugs native xml output will be generated. */ @@ -96,7 +96,7 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { * * @since 3.1.12.2 */ - @Parameter(defaultValue = "spotbugsXml.xml", property = "spotbugs.outputXmlFilename") + @Parameter(defaultValue = 'spotbugsXml.xml', property = 'spotbugs.outputXmlFilename') String spotbugsXmlOutputFilename /** @@ -106,7 +106,7 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { * * @since 2.2 */ - @Parameter(defaultValue = '${project.build.sourceEncoding}', property="encoding") + @Parameter(defaultValue = '${project.build.sourceEncoding}', property = 'encoding') String encoding /** @@ -114,7 +114,7 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { * * @since 2.2 */ - @Parameter(defaultValue = "512", property="spotbugs.maxHeap") + @Parameter(defaultValue = '512', property = 'spotbugs.maxHeap') int maxHeap /** @@ -133,13 +133,13 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { List auxClasspathElements = session.getCurrentProject().compileClasspathElements if (debug) { - log.debug(" Plugin Artifacts to be added ->" + pluginArtifacts.toString()) + log.debug(' Plugin Artifacts to be added -> ' + pluginArtifacts.toString()) } ant.project.setProperty('basedir', spotbugsXmlOutputDirectory.getAbsolutePath()) - ant.project.setProperty('verbose', "true") + ant.project.setProperty('verbose', 'true') - ant.java(classname: "edu.umd.cs.findbugs.LaunchAppropriateUI", fork: "true", failonerror: "true", clonevm: "true", maxmemory: "${maxHeap}m") { + ant.java(classname: 'edu.umd.cs.findbugs.LaunchAppropriateUI', fork: 'true', failonerror: 'true', clonevm: 'true', maxmemory: "${maxHeap}m") { Charset effectiveEncoding = Charset.defaultCharset() ?: StandardCharsets.UTF_8 @@ -147,12 +147,12 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { effectiveEncoding = Charset.forName(encoding) } - log.info("File Encoding is " + effectiveEncoding.name()) + log.info('File Encoding is ' + effectiveEncoding.name()) sysproperty(key: "file.encoding" , value: effectiveEncoding.name()) // spotbugs assumes that multiple arguments (because of options) means text mode, so need to request gui explicitly - jvmarg(value: "-Dfindbugs.launchUI=gui2") + jvmarg(value: '-Dfindbugs.launchUI=gui2') // options must be added before the spotbugsXml path List spotbugsArgs = new ArrayList<>() @@ -160,7 +160,7 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { spotbugsArgs << getEffortParameter() if (pluginList || plugins) { - spotbugsArgs << "-pluginList" + spotbugsArgs << '-pluginList' spotbugsArgs << getSpotbugsPlugins() } spotbugsArgs.each { spotbugsArg -> @@ -168,11 +168,11 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { arg(value: spotbugsArg) } - String spotbugsXmlName = spotbugsXmlOutputDirectory.toString() + "/" + spotbugsXmlOutputFilename + String spotbugsXmlName = spotbugsXmlOutputDirectory.toString() + SpotBugsInfo.FORWARD_SLASH + spotbugsXmlOutputFilename File spotbugsXml = new File(spotbugsXmlName) if (spotbugsXml.exists()) { - log.debug(" Found an SpotBugs XML at ->" + spotbugsXml.toString()) + log.debug(' Found an SpotBugs XML at -> ' + spotbugsXml.toString()) arg(value: spotbugsXml) } @@ -180,7 +180,7 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait { pluginArtifacts.each() { pluginArtifact -> if (debug) { - log.debug(" Trying to Add to pluginArtifact ->" + pluginArtifact.file.toString()) + log.debug(' Trying to Add to pluginArtifact -> ' + pluginArtifact.file.toString()) } pathelement(location: pluginArtifact.file) diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy index f707e05e..f075e643 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy @@ -25,31 +25,31 @@ package org.codehaus.mojo.spotbugs interface SpotBugsInfo { /** The name of the Plug-In. */ - static final String PLUGIN_NAME = "spotbugs" + static final String PLUGIN_NAME = 'spotbugs' /** The name of the property resource bundle (Filesystem). */ - static final String BUNDLE_NAME = "spotbugs" + static final String BUNDLE_NAME = 'spotbugs' /** The key to get the name of the Plug-In from the bundle. */ - static final String NAME_KEY = "report.spotbugs.name" + static final String NAME_KEY = 'report.spotbugs.name' /** The key to get the description of the Plug-In from the bundle. */ - static final String DESCRIPTION_KEY = "report.spotbugs.description" + static final String DESCRIPTION_KEY = 'report.spotbugs.description' /** The key to get the source directory message of the Plug-In from the bundle. */ - static final String SOURCE_ROOT_KEY = "report.spotbugs.sourceRoot" + static final String SOURCE_ROOT_KEY = 'report.spotbugs.sourceRoot' /** The key to get the source directory message of the Plug-In from the bundle. */ - static final String TEST_SOURCE_ROOT_KEY = "report.spotbugs.testSourceRoot" + static final String TEST_SOURCE_ROOT_KEY = 'report.spotbugs.testSourceRoot' /** The key to get the java source message of the Plug-In from the bundle. */ - static final String JAVA_SOURCES_KEY = "report.spotbugs.javasources" + static final String JAVA_SOURCES_KEY = 'report.spotbugs.javasources' /** The extensions to search files for. */ - static final String[] EXTENSIONS = [ "class" ] + static final String[] EXTENSIONS = [ 'class' ] /** The comma character. */ - static final String COMMA = "," + static final String COMMA = ',' /** The forward slash character. */ static final String FORWARD_SLASH = '/' @@ -58,29 +58,29 @@ interface SpotBugsInfo { static final String BACKWARD_SLASH = '\\' /** The character to separate URL tokens. */ - static final String URL_SEPARATOR = "/" + static final String URL_SEPARATOR = '/' /** The blank character. */ - static final String BLANK = " " + static final String BLANK = ' ' /** The period character. */ - static final String PERIOD = "." + static final String PERIOD = '.' /** The end of line separator. */ static final EOL = System.lineSeparator() /** The url static string. */ - static final String URL = "url" + static final String URL = 'url' /** The static class suffix. */ static final String CLASS_SUFFIX = '.class' /** The spotbugs efforts as max, min, and default as default. */ - Map spotbugsEfforts = [Max: "max", Min: "min", Default: "default"] + Map spotbugsEfforts = [Max: 'max', Min: 'min', Default: 'default'] /** The spotbugs thresholds as high, experimental, low, medium, and default as medium. */ - Map spotbugsThresholds = [High: "high", Exp: "experimental", Low: "low", Medium: "medium", Default: "medium"] + Map spotbugsThresholds = [High: 'high', Exp: 'experimental', Low: 'low', Medium: 'medium', Default: 'medium'] /** The spotbugs priority as unknown, high, medium, and low. */ - List spotbugsPriority = ["unknown", "High", "Medium", "Low"] + List spotbugsPriority = ['unknown', 'High', 'Medium', 'Low'] } diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy index 4fa81e57..b5f0c395 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy @@ -48,7 +48,7 @@ import javax.inject.Inject * Generates a SpotBugs Report when the site plugin is run. * The HTML report is generated for site commands only. */ -@Mojo(name = "spotbugs", requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true, threadSafe = true) +@Mojo(name = 'spotbugs', requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true, threadSafe = true) class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { /** Location where generated html will be created allowed to be not read only as defined in AbstractMavenParent. */ @@ -60,7 +60,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.0.0 */ - @Parameter(defaultValue = "false", property = "spotbugs.xmlOutput", required = true) + @Parameter(defaultValue = 'false', property = 'spotbugs.xmlOutput', required = true) boolean xmlOutput /** @@ -68,7 +68,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.8.3.0 */ - @Parameter(defaultValue = "false", property = "spotbugs.noClassOk", required = true) + @Parameter(defaultValue = 'false', property = 'spotbugs.noClassOk', required = true) boolean noClassOk /** @@ -76,7 +76,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.7.3.1 */ - @Parameter(defaultValue = "false", property = "spotbugs.htmlOutput", required = true) + @Parameter(defaultValue = 'false', property = 'spotbugs.htmlOutput', required = true) boolean htmlOutput /** @@ -86,7 +86,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.3.1 */ - @Parameter(defaultValue = "false", property = "spotbugs.sarifOutput", required = true) + @Parameter(defaultValue = 'false', property = 'spotbugs.sarifOutput', required = true) boolean sarifOutput /** @@ -94,7 +94,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.3.1 */ - @Parameter(defaultValue = "false", property = "spotbugs.sarifFullPath", required = true) + @Parameter(defaultValue = 'false', property = 'spotbugs.sarifFullPath', required = true) boolean sarifFullPath /** @@ -102,7 +102,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.7.2.2 */ - @Parameter(defaultValue = '${project.build.directory}', property = "spotbugs.sarifOutputDirectory", required = true) + @Parameter(defaultValue = '${project.build.directory}', property = 'spotbugs.sarifOutputDirectory', required = true) File sarifOutputDirectory @@ -111,7 +111,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.7.2.2 */ - @Parameter(defaultValue = "spotbugsSarif.json", property = "spotbugs.sarifOutputFilename", required = true) + @Parameter(defaultValue = 'spotbugsSarif.json', property = 'spotbugs.sarifOutputFilename', required = true) String sarifOutputFilename /** @@ -135,7 +135,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 3.1.12.2 */ - @Parameter(defaultValue = "spotbugsXml.xml", property = "spotbugs.outputXmlFilename") + @Parameter(defaultValue = 'spotbugsXml.xml', property = 'spotbugs.outputXmlFilename') String spotbugsXmlOutputFilename /** Doxia Site Renderer. */ @@ -163,19 +163,19 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.0 */ - @Parameter(defaultValue = "false", property = "spotbugs.includeTests") + @Parameter(defaultValue = 'false', property = 'spotbugs.includeTests') boolean includeTests /** Run Spotbugs with -sourcepath parameter populated with the known source roots. */ - @Parameter(defaultValue = "false", property = "spotbugs.addSourceDirs") + @Parameter(defaultValue = 'false', property = 'spotbugs.addSourceDirs') boolean addSourceDirs /** List of artifacts this plugin depends on. Used for resolving the Spotbugs core plugin. */ - @Parameter(property = "plugin.artifacts", required = true, readonly = true) + @Parameter(property = 'plugin.artifacts', readonly = true, required = true) List pluginArtifacts /** Maven Session. */ - @Parameter (defaultValue = '${session}', required = true, readonly = true) + @Parameter (defaultValue = '${session}', readonly = true, required = true) MavenSession session /** @@ -184,7 +184,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.2 */ - @Parameter(defaultValue = '${project.build.sourceEncoding}', property = "encoding") + @Parameter(defaultValue = '${project.build.sourceEncoding}', property = 'encoding') String sourceEncoding /** @@ -193,11 +193,11 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.2 */ - @Parameter(defaultValue = '${project.reporting.outputEncoding}', property = "outputEncoding") + @Parameter(defaultValue = '${project.reporting.outputEncoding}', property = 'outputEncoding') String outputEncoding /** Threshold of minimum bug severity to report. Valid values are High, Default, Low, Ignore, and Exp (for experimental). */ - @Parameter(defaultValue = "Default", property = "spotbugs.threshold") + @Parameter(defaultValue = 'Default', property = 'spotbugs.threshold') String threshold /** Artifact resolver, needed to download the coreplugin jar. */ @@ -221,7 +221,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.0-beta-1 */ - @Parameter(property = "spotbugs.includeFilterFile") + @Parameter(property = 'spotbugs.includeFilterFile') String includeFilterFile /** @@ -239,7 +239,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.7.1.0 */ - @Parameter(property = "spotbugs.includeFilterFiles") + @Parameter(property = 'spotbugs.includeFilterFiles') List includeFilterFiles /** @@ -255,7 +255,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.0-beta-1 */ - @Parameter(property = "spotbugs.excludeFilterFile") + @Parameter(property = 'spotbugs.excludeFilterFile') String excludeFilterFile /** @@ -271,7 +271,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.7.1.0 */ - @Parameter(property = "spotbugs.excludeFilterFiles") + @Parameter(property = 'spotbugs.excludeFilterFiles') List excludeFilterFiles /** @@ -288,7 +288,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.4.1 */ - @Parameter(property = "spotbugs.excludeBugsFile") + @Parameter(property = 'spotbugs.excludeBugsFile') String excludeBugsFile /** @@ -306,7 +306,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.7.1.0 */ - @Parameter(property = "spotbugs.excludeBugsFiles") + @Parameter(property = 'spotbugs.excludeBugsFiles') List excludeBugsFiles /** @@ -314,11 +314,11 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.0-beta-1 */ - @Parameter(defaultValue = "Default", property = "spotbugs.effort") + @Parameter(defaultValue = 'Default', property = 'spotbugs.effort') String effort /** Turn on Spotbugs debugging. */ - @Parameter(defaultValue = "false", property = "spotbugs.debug") + @Parameter(defaultValue = 'false', property = 'spotbugs.debug') boolean debug /** @@ -327,7 +327,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.1 */ - @Parameter(defaultValue = "false", property = "spotbugs.relaxed") + @Parameter(defaultValue = 'false', property = 'spotbugs.relaxed') boolean relaxed /** @@ -335,7 +335,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.0-beta-1 */ - @Parameter(property = "spotbugs.visitors") + @Parameter(property = 'spotbugs.visitors') String visitors /** @@ -343,7 +343,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.0-beta-1 */ - @Parameter(property = "spotbugs.omitVisitors") + @Parameter(property = 'spotbugs.omitVisitors') String omitVisitors /** @@ -358,7 +358,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.0-beta-1 */ - @Parameter(property = "spotbugs.pluginList") + @Parameter(property = 'spotbugs.pluginList') String pluginList /** @@ -366,7 +366,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * See Usage for details. * * @since 2.4.1 - * @since 4.8.3.0 includes classfier + * @since 4.8.3.0 includes classifier */ @Parameter PluginArtifact[] plugins; @@ -376,7 +376,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.1 */ - @Parameter(property = "spotbugs.onlyAnalyze") + @Parameter(property = 'spotbugs.onlyAnalyze') String onlyAnalyze /** @@ -385,7 +385,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.3.2 */ - @Parameter(property = "spotbugs.nested", defaultValue = "false") + @Parameter(defaultValue = 'false', property = 'spotbugs.nested') boolean nested /** @@ -394,7 +394,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.3.2 */ - @Parameter(property = "spotbugs.trace", defaultValue = "false") + @Parameter(defaultValue = 'false', property = 'spotbugs.trace') boolean trace /** @@ -402,7 +402,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.4.1 */ - @Parameter(property = "spotbugs.maxRank") + @Parameter(property = 'spotbugs.maxRank') int maxRank /** @@ -410,7 +410,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 1.1 */ - @Parameter(property = "spotbugs.skip", defaultValue = "false") + @Parameter(defaultValue = 'false', property = 'spotbugs.skip') boolean skip /** @@ -434,7 +434,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.0 */ - @Parameter(property = "spotbugs.failOnError", defaultValue = "true") + @Parameter(defaultValue = 'true', property = 'spotbugs.failOnError') boolean failOnError /** @@ -442,7 +442,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.3.2 */ - @Parameter(property = "spotbugs.fork", defaultValue = "true") + @Parameter(defaultValue = 'true', property = 'spotbugs.fork') boolean fork /** @@ -451,7 +451,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.2 */ - @Parameter(property = "spotbugs.maxHeap", defaultValue = "512") + @Parameter(defaultValue = '512', property = 'spotbugs.maxHeap') int maxHeap /** @@ -462,7 +462,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.2 */ - @Parameter(property = "spotbugs.timeout", defaultValue = "600000") + @Parameter(defaultValue = '600000', property = 'spotbugs.timeout') int timeout /** @@ -470,7 +470,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 2.4.1 */ - @Parameter(property = "spotbugs.jvmArgs") + @Parameter(property = 'spotbugs.jvmArgs') String jvmArgs /** @@ -479,7 +479,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 3.0.1 */ - @Parameter(property = "spotbugs.skipEmptyReport", defaultValue = "false") + @Parameter(defaultValue = "false", property = 'spotbugs.skipEmptyReport') boolean skipEmptyReport /** @@ -492,7 +492,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 3.0.2 */ - @Parameter(property = "spotbugs.userPrefs") + @Parameter(property = 'spotbugs.userPrefs') String userPrefs /** @@ -500,7 +500,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { * * @since 4.3.0 */ - @Parameter(property = "spotbugs.systemPropertyVariables") + @Parameter(property = 'spotbugs.systemPropertyVariables') Map systemPropertyVariables /** The bug count. */ @@ -525,7 +525,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { boolean canGenerateReport() { boolean canGenerate - log.debug("****** SpotBugsMojo canGenerateReport *******") + log.debug('****** SpotBugsMojo canGenerateReport *******') if (!skip && classFilesDirectory.exists()) { @@ -615,35 +615,35 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { @Override void executeReport(Locale locale) { - log.debug("****** SpotBugsMojo executeReport *******") + log.debug('****** SpotBugsMojo executeReport *******') executeCheck() if (skip || !canGenerateReport()) { - log.info("cannot generate report") + log.info('cannot generate report') return } if (log.isDebugEnabled()) { log.debug("Locale is ${locale.getLanguage()}") - log.debug("****** SpotBugsMojo executeReport *******") - log.debug("report Output Directory is " + getReportOutputDirectory()) - log.debug("Output Directory is " + outputDirectory) - log.debug("Classes Directory is " + classFilesDirectory) - log.debug(" Plugin Artifacts to be added ->" + pluginArtifacts.toString()) + log.debug('****** SpotBugsMojo executeReport *******') + log.debug('report Output Directory is ' + getReportOutputDirectory()) + log.debug('Output Directory is ' + outputDirectory) + log.debug('Classes Directory is ' + classFilesDirectory) + log.debug(' Plugin Artifacts to be added -> ' + pluginArtifacts.toString()) } generateXDoc(locale) if (!outputDirectory.exists() && !outputDirectory.mkdirs()) { - throw new MojoExecutionException("Cannot create html output directory") + throw new MojoExecutionException('Cannot create html output directory') } if (outputSpotbugsFile != null && outputSpotbugsFile.exists()) { if (skipEmptyReport && bugCount == 0) { - log.info("Skipping Generation Spotbugs HTML since there are not any bugs") + log.info('Skipping Generation Spotbugs HTML since there are not any bugs') } else { - log.debug("Generating Spotbugs HTML") + log.debug('Generating Spotbugs HTML') SpotbugsReportGenerator generator = new SpotbugsReportGenerator(getSink(), getBundle(locale), this.session.getCurrentProject().getBasedir(), siteTool) @@ -672,7 +672,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { @Override public void execute() { - log.debug("****** SpotBugsMojo execute *******") + log.debug('****** SpotBugsMojo execute *******') if (!skip) { executeCheck() @@ -684,17 +684,17 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { } private void executeCheck() { - log.debug("****** SpotBugsMojo executeCheck *******") + log.debug('****** SpotBugsMojo executeCheck *******') - log.debug("Generating Spotbugs XML") + log.debug('Generating Spotbugs XML') if (!spotbugsXmlOutputDirectory.exists() && !spotbugsXmlOutputDirectory.mkdirs()) { - throw new MojoExecutionException("Cannot create xml output directory") + throw new MojoExecutionException('Cannot create xml output directory') } } private void generateXDoc(Locale locale) { - log.debug("****** SpotBugsMojo generateXDoc *******") + log.debug('****** SpotBugsMojo generateXDoc *******') if (outputSpotbugsFile == null || !outputSpotbugsFile.exists()) { return @@ -703,10 +703,10 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { log.debug("xmlOutput is ${xmlOutput}") if (xmlOutput) { - log.debug(" Using the xdoc format") + log.debug(' Using the xdoc format') if (!xmlOutputDirectory.exists() && !xmlOutputDirectory.mkdirs()) { - throw new MojoExecutionException("Cannot create xdoc output directory") + throw new MojoExecutionException('Cannot create xdoc output directory') } XDocsReporter xDocsReporter = new XDocsReporter(getBundle(locale), log, threshold, effort, outputEncoding) @@ -755,19 +755,19 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { return true } - List reportPlugins = session.getCurrentProject().getReportPlugins() + List reportPlugins = session.getCurrentProject().getModel().getReporting().getPlugins() boolean isEnabled reportPlugins.each() { reportPlugin -> log.debug("report plugin -> ${reportPlugin.getArtifactId()}") - if ("maven-jxr-plugin".equals(reportPlugin.getArtifactId())) { + if ('maven-jxr-plugin'.equals(reportPlugin.getArtifactId())) { isEnabled = true } } - log.debug("jxr report links are ${isEnabled ? "enabled" : "disabled"}") + log.debug("jxr report links are ${isEnabled ? 'enabled' : 'disabled'}") return isEnabled } @@ -775,7 +775,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { this.bundle = ResourceBundle.getBundle(SpotBugsInfo.BUNDLE_NAME, locale, SpotBugsMojo.class.getClassLoader()) - log.debug("Mojo Locale is " + this.bundle.getLocale().getLanguage()) + log.debug('Mojo Locale is ' + this.bundle.getLocale().getLanguage()) return bundle } @@ -798,134 +798,134 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { if (userPrefs) { log.debug(" Adding User Preferences File -> ${userPrefs}") - args << "-userPrefs" + args << '-userPrefs' args << resourceHelper.getResourceFile(userPrefs.trim()) } if (htmlOutput) { - args << "-html=" + htmlTempFile.getAbsolutePath() + args << '-html=' + htmlTempFile.getAbsolutePath() } - args << "-xml:withMessages=" + xmlTempFile.getAbsolutePath() + args << '-xml:withMessages=' + xmlTempFile.getAbsolutePath() if (sarifOutput) { - args << "-sarif=" + sarifTempFile.getAbsolutePath() + args << '-sarif=' + sarifTempFile.getAbsolutePath() } if (auxClasspathFile) { - args << "-auxclasspathFromFile" + args << '-auxclasspathFromFile' args << auxClasspathFile.getAbsolutePath() } - args << "-projectName" + args << '-projectName' args << "${project.name}" args << getEffortParameter() args << getThresholdParameter() if (debug) { - log.debug("progress on") - args << "-progress" + log.debug('progress on') + args << '-progress' } if (pluginList || plugins) { - args << "-pluginList" + args << '-pluginList' args << getSpotbugsPlugins() } if (visitors) { - args << "-visitors" + args << '-visitors' args << visitors } if (omitVisitors) { - args << "-omitVisitors" + args << '-omitVisitors' args << omitVisitors } if (relaxed) { - args << "-relaxed" + args << '-relaxed' } if (nested) { - args << "-nested:true" + args << '-nested:true' } else { - args << "-nested:false" + args << '-nested:false' } if (onlyAnalyze) { - args << "-onlyAnalyze" - args << Arrays.stream(onlyAnalyze.split(",")).map { - it.startsWith("file:") ? Files.lines(resourceHelper.getResourceFile(it.substring(5)).toPath()).collect(Collectors.joining(",")) : it + args << '-onlyAnalyze' + args << Arrays.stream(onlyAnalyze.split(SpotBugsInfo.COMMA)).map { + it.startsWith("file:") ? Files.lines(resourceHelper.getResourceFile(it.substring(5)).toPath()).collect(Collectors.joining(SpotBugsInfo.COMMA)) : it }.collect(Collectors.joining(",")) } if (includeFilterFile) { - log.debug(" Adding Include Filter File ") + log.debug(' Adding Include Filter File ') String[] includefilters = includeFilterFile.split(SpotBugsInfo.COMMA) includefilters.each { includefilter -> - args << "-include" + args << '-include' args << resourceHelper.getResourceFile(includefilter.trim()) } } if (includeFilterFiles) { - log.debug(" Adding Include Filter Files ") + log.debug(' Adding Include Filter Files') includeFilterFiles.each { includefilter -> - args << "-include" + args << '-include' args << resourceHelper.getResourceFile(includefilter.trim()) } } if (excludeFilterFile) { - log.debug(" Adding Exclude Filter File ") + log.debug(' Adding Exclude Filter File') String[] excludefilters = excludeFilterFile.split(SpotBugsInfo.COMMA) excludefilters.each { excludeFilter -> - args << "-exclude" + args << '-exclude' args << resourceHelper.getResourceFile(excludeFilter.trim()) } } if (excludeFilterFiles) { - log.debug(" Adding Exclude Filter Files ") + log.debug(' Adding Exclude Filter Files') excludeFilterFiles.each { excludeFilter -> - args << "-exclude" + args << '-exclude' args << resourceHelper.getResourceFile(excludeFilter.trim()) } } if (excludeBugsFile) { - log.debug(" Adding Exclude Bug File (Baselines)") + log.debug(' Adding Exclude Bug File (Baselines)') String[] excludeFiles = excludeBugsFile.split(SpotBugsInfo.COMMA) excludeFiles.each() { excludeFile -> - args << "-excludeBugs" + args << '-excludeBugs' args << resourceHelper.getResourceFile(excludeFile.trim()) } } if (excludeBugsFiles) { - log.debug(" Adding Exclude Bug Files (Baselines)") + log.debug(' Adding Exclude Bug Files (Baselines)') excludeBugsFiles.each() { excludeFile -> - args << "-excludeBugs" + args << '-excludeBugs' args << resourceHelper.getResourceFile(excludeFile.trim()) } } if (addSourceDirs) { - log.debug(" Adding Source directories (To process source exclusions)") - args << "-sourcepath" + log.debug(' Adding Source directories (To process source exclusions)') + args << '-sourcepath' String sourceRoots = "" session.getCurrentProject().compileSourceRoots.each() { sourceRoots += it + File.pathSeparator } if (includeTests) { @@ -935,23 +935,23 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { } if (maxRank) { - args << "-maxRank" + args << '-maxRank' args << maxRank } if (classFilesDirectory.isDirectory()) { - log.debug(" Adding to Source Directory ->" + classFilesDirectory.absolutePath) + log.debug(' Adding to Source Directory -> ' + classFilesDirectory.absolutePath) args << classFilesDirectory.absolutePath } if (testClassFilesDirectory.isDirectory() && includeTests) { - log.debug(" Adding to Source Directory ->" + testClassFilesDirectory.absolutePath) + log.debug(' Adding to Source Directory -> ' + testClassFilesDirectory.absolutePath) args << testClassFilesDirectory.absolutePath } if (noClassOk) { - log.debug(" Adding no class ok") - args << "-noClassOk" + log.debug(' Adding no class ok') + args << '-noClassOk' } return args @@ -973,16 +973,16 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { File auxClasspathFile = null if (auxClasspathElements) { - auxClasspathFile = File.createTempFile("auxclasspath", ".tmp") + auxClasspathFile = File.createTempFile('auxclasspath', '.tmp') auxClasspathFile.deleteOnExit() - log.debug(" AuxClasspath Elements ->" + auxClasspathElements) + log.debug(' AuxClasspath Elements -> ' + auxClasspathElements) List auxClasspathList = auxClasspathElements.findAll { session.getCurrentProject().getBuild().outputDirectory != it.toString() } if (auxClasspathList.size() > 0) { - log.debug(" Last AuxClasspath is ->" + auxClasspathList[auxClasspathList.size() - 1]) + log.debug(' Last AuxClasspath is -> ' + auxClasspathList[auxClasspathList.size() - 1]) auxClasspathList.each() { auxClasspathElement -> - log.debug(" Adding to AuxClasspath ->" + auxClasspathElement.toString()) + log.debug(' Adding to AuxClasspath -> ' + auxClasspathElement.toString()) auxClasspathFile << auxClasspathElement.toString() + SpotBugsInfo.EOL } } @@ -1015,7 +1015,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { */ private void executeSpotbugs(File outputFile) { - log.debug("****** SpotBugsMojo executeSpotbugs *******") + log.debug('****** SpotBugsMojo executeSpotbugs *******') File htmlTempFile = new File("${outputDirectory}/spotbugs.html") if (htmlOutput) { @@ -1032,7 +1032,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { outputEncoding = outputEncoding ?: StandardCharsets.UTF_8 - log.debug("****** Executing SpotBugsMojo *******") + log.debug('****** Executing SpotBugsMojo *******') resourceManager.addSearchPath(FileResourceLoader.ID, session.getCurrentProject().getFile().getParentFile().getAbsolutePath()) resourceManager.addSearchPath(SpotBugsInfo.URL, "") @@ -1070,11 +1070,11 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { effectiveEncoding = Charset.forName(sourceEncoding) } - ant.java(classname: "edu.umd.cs.findbugs.FindBugs2", fork: "${fork}", failonerror: "true", clonevm: "false", timeout: "${timeout}", maxmemory: "${maxHeap}m") { + ant.java(classname: 'edu.umd.cs.findbugs.FindBugs2', fork: "${fork}", failonerror: 'true', clonevm: 'false', timeout: "${timeout}", maxmemory: "${maxHeap}m") { - log.debug("File Encoding is " + effectiveEncoding.name()) + log.debug('File Encoding is ' + effectiveEncoding.name()) - sysproperty(key: "file.encoding", value: effectiveEncoding.name()) + sysproperty(key: 'file.encoding', value: effectiveEncoding.name()) if (jvmArgs && fork) { log.debug("Adding JVM Args => ${jvmArgs}") @@ -1088,13 +1088,13 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { } if (debug || trace) { - sysproperty(key: "findbugs.debug", value: Boolean.TRUE) + sysproperty(key: 'findbugs.debug', value: Boolean.TRUE) } classpath() { pluginArtifacts.each() { pluginArtifact -> - log.debug(" Adding to pluginArtifact -> " + pluginArtifact.file.toString()) + log.debug(' Adding to pluginArtifact -> ' + pluginArtifact.file.toString()) pathelement(location: pluginArtifact.file) } @@ -1118,7 +1118,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { log.debug("SpotBugs duration is ${duration}") } - log.info("Done SpotBugs Analysis....") + log.info('Done SpotBugs Analysis....') if (htmlTempFile.exists() && htmlOutput && htmlTempFile.size() > 0) { // Do nothing more at this time @@ -1167,16 +1167,16 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { BufferedWriter writer = Files.newBufferedWriter(outputFile.toPath(), effectiveEncoding) if (effectiveEncoding.name().equalsIgnoreCase("Cp1252")) { - writer.write "" + writer.write '' } else { - writer.write "" + writer.write '' } writer.write SpotBugsInfo.EOL writer << xmlBuilder.bind { mkp.yield path } } else { - log.info("No bugs found") + log.info('No bugs found') } if (!log.isDebugEnabled()) { @@ -1214,8 +1214,8 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { } loc.physicalLocation.artifactLocation.uri = newFileName } else { - log.warn("No source file found for $originalFullPath. " + - "The path include in the SARIF report could be incomplete.") + log.warn("No source file found for ${originalFullPath}. " + + 'The path include in the SARIF report could be incomplete.') } } @@ -1249,24 +1249,24 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { String thresholdParameter switch (threshold) { - case "High": - thresholdParameter = "-high" + case 'High': + thresholdParameter = '-high' break - case "Exp": - thresholdParameter = "-experimental" + case 'Exp': + thresholdParameter = '-experimental' break - case "Low": - thresholdParameter = "-low" + case 'Low': + thresholdParameter = '-low' break - case "high": - thresholdParameter = "-high" + case 'high': + thresholdParameter = '-high' break default: - thresholdParameter = "-medium" + thresholdParameter = '-medium' break } log.debug("thresholdParameter is ${thresholdParameter}") diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsPluginsTrait.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsPluginsTrait.groovy index 146c22c2..7057fe6a 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsPluginsTrait.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsPluginsTrait.groovy @@ -57,28 +57,28 @@ trait SpotBugsPluginsTrait { String urlPlugins = "" if (pluginList) { - log.debug(" Adding Plugins ") + log.debug(' Adding Plugins ') String[] pluginJars = pluginList.split(SpotBugsInfo.COMMA) pluginJars.each() { pluginJar -> String pluginFileName = pluginJar.trim() - if (!pluginFileName.endsWith(".jar")) { + if (!pluginFileName.endsWith('.jar')) { throw new IllegalArgumentException("Plugin File is not a Jar file: " + pluginFileName) } try { - log.debug(" Processing Plugin: " + pluginFileName.toString()) + log.debug(' Processing Plugin: ' + pluginFileName.toString()) - urlPlugins += resourceHelper.getResourceFile(pluginFileName.toString()).absolutePath + ((pluginJar == pluginJars[pluginJars.size() - 1]) ? "" : File.pathSeparator) + urlPlugins += resourceHelper.getResourceFile(pluginFileName.toString()).absolutePath + ((pluginJar == pluginJars[pluginJars.size() - 1]) ? '' : File.pathSeparator) } catch (MalformedURLException e) { - throw new MojoExecutionException("The addin plugin has an invalid URL", e) + throw new MojoExecutionException('The addin plugin has an invalid URL', e) } } } if (plugins) { - log.debug(" Adding Plugins from a repository") + log.debug(' Adding Plugins from a repository') if (urlPlugins.size() > 0) { urlPlugins += File.pathSeparator @@ -87,13 +87,13 @@ trait SpotBugsPluginsTrait { Artifact pomArtifact ProjectBuildingRequest projectBuildingRequest = session.getProjectBuildingRequest() - log.debug(" Session is: " + session.toString()) + log.debug(' Session is: ' + session.toString()) projectBuildingRequest.setRemoteRepositories(session.getCurrentProject().getRemoteArtifactRepositories()) projectBuildingRequest.setLocalRepository(session.getLocalRepository()) plugins.each() { plugin -> - log.debug(" Processing Plugin: " + plugin.toString()) + log.debug(' Processing Plugin: ' + plugin.toString()) if (plugin['classifier'] == null) { log.debug("groupId is ${plugin['groupId']} ****** artifactId is ${plugin['artifactId']} ****** version is ${plugin['version']} ****** type is ${plugin['type']}") pomArtifact = this.factory.createArtifact(plugin['groupId'], plugin['artifactId'], plugin['version'], "", plugin['type']) @@ -127,16 +127,16 @@ trait SpotBugsPluginsTrait { String effortParameter switch (effort) { - case "Max": - effortParameter = "max" + case 'Max': + effortParameter = 'max' break - case "Min": - effortParameter = "min" + case 'Min': + effortParameter = 'min' break default: - effortParameter = "default" + effortParameter = 'default' break } diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotbugsReportGenerator.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotbugsReportGenerator.groovy index 3e1203bd..f70ffef6 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotbugsReportGenerator.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotbugsReportGenerator.groovy @@ -33,71 +33,71 @@ import org.codehaus.plexus.util.PathTool class SpotbugsReportGenerator implements SpotBugsInfo { /** The key to get the value if the line number is not available. */ - static final String NOLINE_KEY = "report.spotbugs.noline" + static final String NOLINE_KEY = 'report.spotbugs.noline' /** The key to get the column title for the line. */ - static final String COLUMN_LINE_KEY = "report.spotbugs.column.line" + static final String COLUMN_LINE_KEY = 'report.spotbugs.column.line' /** The key to get the column title for the bug. */ - static final String COLUMN_BUG_KEY = "report.spotbugs.column.bug" + static final String COLUMN_BUG_KEY = 'report.spotbugs.column.bug' /** The key to get the column title for the bugs. */ - static final String COLUMN_BUGS_KEY = "report.spotbugs.column.bugs" + static final String COLUMN_BUGS_KEY = 'report.spotbugs.column.bugs' /** The key to get the column title for the category. */ - static final String COLUMN_CATEGORY_KEY = "report.spotbugs.column.category" + static final String COLUMN_CATEGORY_KEY = 'report.spotbugs.column.category' /** The key to get the column title for the priority. */ - static final String COLUMN_PRIORITY_KEY = "report.spotbugs.column.priority" + static final String COLUMN_PRIORITY_KEY = 'report.spotbugs.column.priority' /** The key to get the column title for the details. */ - static final String COLUMN_DETAILS_KEY = "report.spotbugs.column.details" + static final String COLUMN_DETAILS_KEY = 'report.spotbugs.column.details' /** The key to get the report title of the Plug-In from the bundle. */ - static final String REPORT_TITLE_KEY = "report.spotbugs.reporttitle" + static final String REPORT_TITLE_KEY = 'report.spotbugs.reporttitle' /** The key to get the report link title of the Plug-In from the bundle. */ - static final String LINKTITLE_KEY = "report.spotbugs.linktitle" + static final String LINKTITLE_KEY = 'report.spotbugs.linktitle' /** The key to get the report link of the Plug-In from the bundle. */ - static final String LINK_KEY = "report.spotbugs.link" + static final String LINK_KEY = 'report.spotbugs.link' /** The key to get the files title of the Plug-In from the bundle. */ - static final String FILES_KEY = "report.spotbugs.files" + static final String FILES_KEY = 'report.spotbugs.files' /** The key to get the threshold of the report from the bundle. */ - static final String THRESHOLD_KEY = "report.spotbugs.threshold" + static final String THRESHOLD_KEY = 'report.spotbugs.threshold' /** The key to get the effort of the report from the bundle. */ - static final String EFFORT_KEY = "report.spotbugs.effort" + static final String EFFORT_KEY = 'report.spotbugs.effort' /** The key to get the link to SpotBugs description page from the bundle. */ - static final String DETAILSLINK_KEY = "report.spotbugs.detailslink" + static final String DETAILSLINK_KEY = 'report.spotbugs.detailslink' /** The key to get the version title for SpotBugs from the bundle. */ - static final String VERSIONTITLE_KEY = "report.spotbugs.versiontitle" + static final String VERSIONTITLE_KEY = 'report.spotbugs.versiontitle' /** The key to get the files title of the Plug-In from the bundle. */ - static final String SUMMARY_KEY = "report.spotbugs.summary" + static final String SUMMARY_KEY = 'report.spotbugs.summary' /** The key to column title for the Class. */ - static final String COLUMN_CLASS_KEY = "report.spotbugs.column.class" + static final String COLUMN_CLASS_KEY = 'report.spotbugs.column.class' /** The key to column title for the Classes. */ - static final String COLUMN_CLASSES_KEY = "report.spotbugs.column.classes" + static final String COLUMN_CLASSES_KEY = 'report.spotbugs.column.classes' /** The key to column title for the errors. */ - static final String COLUMN_ERRORS_KEY = "report.spotbugs.column.errors" + static final String COLUMN_ERRORS_KEY = 'report.spotbugs.column.errors' /** * The key to column title for the files. * * note: not used but throughout properties */ - static final String COLUMN_FILES_KEY = "report.spotbugs.column.files" + static final String COLUMN_FILES_KEY = 'report.spotbugs.column.files' /** The key to column title for the files. */ - static final String COLUMN_MISSINGCLASSES_KEY = "report.spotbugs.column.missingclasses" + static final String COLUMN_MISSINGCLASSES_KEY = 'report.spotbugs.column.missingclasses' /** The sink to write the report to. */ Sink sink @@ -191,7 +191,7 @@ class SpotbugsReportGenerator implements SpotBugsInfo { this.bugClasses = [] - this.currentClassName = "" + this.currentClassName = '' this.bugCount = 0 this.missingClassCount = 0 @@ -203,8 +203,8 @@ class SpotbugsReportGenerator implements SpotBugsInfo { * @see edu.umd.cs.findbugs.BugReporter#finish() */ void printBody() { - log.debug("Finished searching for bugs!...") - log.debug("sink is " + sink) + log.debug('Finished searching for bugs!...') + log.debug('sink is ' + sink) bugClasses.each() { bugClass -> log.debug("finish bugClass is ${bugClass}") @@ -214,7 +214,6 @@ class SpotbugsReportGenerator implements SpotBugsInfo { // close the report, write it sink.body_() - } /** @@ -264,7 +263,6 @@ class SpotbugsReportGenerator implements SpotBugsInfo { sink.italic_() sink.paragraph_() sink.section1_() - } /** @@ -274,7 +272,6 @@ class SpotbugsReportGenerator implements SpotBugsInfo { * the bug to print */ protected void printBug(String bugClass) { - log.debug("printBug bugClass is ${bugClass}") openClassReportSection(bugClass) @@ -319,7 +316,7 @@ class SpotbugsReportGenerator implements SpotBugsInfo { sink.tableCell() if (isJXRReportEnabled) { - log.debug("isJXRReportEnabled is enabled") + log.debug('isJXRReportEnabled is enabled') sink.rawText(assembleJxrHyperlink(line)) } else { sink.text(line.@start.text()) @@ -339,7 +336,6 @@ class SpotbugsReportGenerator implements SpotBugsInfo { sink.table_() sink.section2_() - } /** @@ -353,11 +349,11 @@ class SpotbugsReportGenerator implements SpotBugsInfo { * */ protected String assembleJxrHyperlink(GPathResult line) { - log.debug("Inside assembleJxrHyperlink") - log.debug("line is " + line.text()) - log.debug("outputDirectory is " + outputDirectory.getAbsolutePath()) - log.debug("xrefLocation is " + xrefLocation.getAbsolutePath()) - log.debug("xrefTestLocation is " + xrefTestLocation.getAbsolutePath()) + log.debug('Inside assembleJxrHyperlink') + log.debug('line is ' + line.text()) + log.debug('outputDirectory is ' + outputDirectory.getAbsolutePath()) + log.debug('xrefLocation is ' + xrefLocation.getAbsolutePath()) + log.debug('xrefTestLocation is ' + xrefTestLocation.getAbsolutePath()) String prefix compileSourceRoots.each { compileSourceRoot -> @@ -378,12 +374,12 @@ class SpotbugsReportGenerator implements SpotBugsInfo { } } - String path = prefix + line.@classname.text().replaceAll("[.]", "/").replaceAll("[\$].*", "") + String path = prefix + line.@classname.text().replaceAll('[.]', '/').replaceAll('[$].*', '') String lineNumber = valueForLine(line) String hyperlink if (lineNumber != bundle.getString(NOLINE_KEY)) { - hyperlink = "" + lineNumber + "" + hyperlink = '' + lineNumber + '' } else { hyperlink = lineNumber } @@ -413,7 +409,7 @@ class SpotbugsReportGenerator implements SpotBugsInfo { log.debug("openClassReportSection bugClass is ${bugClass}") - log.debug("Opening Class Report Section") + log.debug('Opening Class Report Section') // Dollar '$' for nested classes is not valid character in sink.anchor() and therefore it is ignored // https://github.com/spotbugs/spotbugs-maven-plugin/issues/236 @@ -460,8 +456,7 @@ class SpotbugsReportGenerator implements SpotBugsInfo { * Print the Summary Section. */ protected void printSummary() { - - log.debug("Entering printSummary") + log.debug('Entering printSummary') sink.section1() @@ -524,14 +519,14 @@ class SpotbugsReportGenerator implements SpotBugsInfo { sink.section1_() - log.debug("Exiting printSummary") + log.debug('Exiting printSummary') } /** * Print the File Summary Section. */ protected void printFilesSummary() { - log.debug("Entering printFilesSummary") + log.debug('Entering printFilesSummary') sink.section1() @@ -596,8 +591,7 @@ class SpotbugsReportGenerator implements SpotBugsInfo { } public void generateReport() { - - log.debug("Reporter Locale is " + this.bundle.getLocale().getLanguage()) + log.debug('Reporter Locale is ' + this.bundle.getLocale().getLanguage()) doHeading() @@ -607,7 +601,7 @@ class SpotbugsReportGenerator implements SpotBugsInfo { printBody() - log.debug("Closing up report....................") + log.debug('Closing up report....................') sink.flush() sink.close() @@ -636,7 +630,7 @@ class SpotbugsReportGenerator implements SpotBugsInfo { value = bundle.getString(NOLINE_KEY) } } else { - value = startLine + "-" + endLine + value = startLine + '-' + endLine } } else { value = bundle.getString(NOLINE_KEY) diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/VerifyMojo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/VerifyMojo.groovy index bd352a6a..04c3f238 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/VerifyMojo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/VerifyMojo.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2005-2023 the original author or authors. + * Copyright 2005-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import org.apache.maven.plugins.annotations.ResolutionScope * * @since 4.7 */ -@Mojo(name = "verify", defaultPhase = LifecyclePhase.VERIFY, requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true, threadSafe = true) +@Mojo(name = 'verify', defaultPhase = LifecyclePhase.VERIFY, requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true, threadSafe = true) class VerifyMojo extends BaseViolationCheckMojo { // Verification Mojo to verify existing bugs rather than run spotbugs } diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/XDocsReporter.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/XDocsReporter.groovy index 0064af5d..5430694a 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/XDocsReporter.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/XDocsReporter.groovy @@ -30,7 +30,7 @@ import org.apache.maven.plugin.logging.Log class XDocsReporter { /** The key to get the value if the line number is not available. */ - static final String NOLINE_KEY = "report.spotbugs.noline" + static final String NOLINE_KEY = 'report.spotbugs.noline' /** The bundle to get the messages from. */ ResourceBundle bundle @@ -100,23 +100,23 @@ class XDocsReporter { String thresholdName switch (thresholdValue) { - case "1": - thresholdName = "High" + case '1': + thresholdName = 'High' break - case "2": - thresholdName = "Normal" + case '2': + thresholdName = 'Normal' break - case "3": - thresholdName = "Low" + case '3': + thresholdName = 'Low' break - case "4": - thresholdName = "Exp" + case '4': + thresholdName = 'Exp' break - case "5": - thresholdName = "Ignore" + case '5': + thresholdName = 'Ignore' break default: - thresholdName = "Invalid Priority" + thresholdName = 'Invalid Priority' } return thresholdName @@ -132,7 +132,6 @@ class XDocsReporter { } public void generateReport() { - StreamingMarkupBuilder xmlBuilder = new StreamingMarkupBuilder() xmlBuilder.encoding = StandardCharsets.UTF_8.name() @@ -149,7 +148,7 @@ class XDocsReporter { String classStatsValue = classStats.'@class'.text() String classStatsBugCount = classStats.'@bugs'.text() - log.debug("classStats...") + log.debug('classStats...') log.debug("classStatsValue is ${classStatsValue}") log.debug("classStatsBugCount is ${classStatsBugCount}")