Skip to content

Commit cf9ebd1

Browse files
committed
[ci] Run eclipse formatter against the code
1 parent 62ddea0 commit cf9ebd1

9 files changed

+16
-32
lines changed

src/main/groovy/org/codehaus/mojo/spotbugs/BaseViolationCheckMojo.groovy

+1-2
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
448448
sourceFiles.addAll(FileUtils.listFiles(testClassFilesDirectory, SpotBugsInfo.EXTENSIONS, true))
449449
}
450450

451-
log.debug('SourceFiles: ' + Arrays.toString(sourceFiles));
451+
log.debug('SourceFiles: ' + Arrays.toString(sourceFiles))
452452
!sourceFiles.isEmpty()
453453
}
454454

@@ -458,5 +458,4 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
458458
log.error(bug.LongMessage.text() + SpotBugsInfo.BLANK + bug.SourceLine.'@classname' + SpotBugsInfo.BLANK + bug.SourceLine.Message.text() + SpotBugsInfo.BLANK + bug.'@type')
459459
}
460460
}
461-
462461
}

src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy

-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ final class ResourceHelper {
8585
log.debug('location of resourceFile file is ' + resourceFile.absolutePath)
8686

8787
return resourceFile
88-
8988
}
9089

9190
private File getResourceAsFile(String name, String outputPath) {
@@ -115,12 +114,10 @@ final class ResourceHelper {
115114
FileOutputStream os = new FileOutputStream(outputResourceFile)
116115

117116
os << is
118-
119117
} catch (IOException e) {
120118
throw new FileResourceCreationException('Cannot create file-based resource.', e)
121119
}
122120

123121
return outputResourceFile
124122
}
125-
126123
}

src/main/groovy/org/codehaus/mojo/spotbugs/SourceFileIndexer.groovy

-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ class SourceFileIndexer {
100100
}
101101
}
102102
}
103-
104103
}
105104

106105
/**
@@ -136,5 +135,4 @@ class SourceFileIndexer {
136135
// Not found
137136
return null
138137
}
139-
140138
}

src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsGui.groovy

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ package org.codehaus.mojo.spotbugs
1717

1818
import groovy.ant.AntBuilder
1919

20-
import java.nio.charset.Charset;
21-
import java.nio.charset.StandardCharsets;
20+
import java.nio.charset.Charset
21+
import java.nio.charset.StandardCharsets
2222

2323
import javax.inject.Inject
2424

@@ -188,5 +188,4 @@ class SpotBugsGui extends AbstractMojo implements SpotBugsPluginsTrait {
188188
}
189189
}
190190
}
191-
192191
}

src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsInfo.groovy

+7-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ interface SpotBugsInfo {
4646
static final String JAVA_SOURCES_KEY = 'report.spotbugs.javasources'
4747

4848
/** The extensions to search files for. */
49-
static final String[] EXTENSIONS = [ 'class' ]
49+
static final String[] EXTENSIONS = ['class']
5050

5151
/** The comma character. */
5252
static final String COMMA = ','
@@ -82,5 +82,10 @@ interface SpotBugsInfo {
8282
Map<String, String> spotbugsThresholds = [High: 'high', Exp: 'experimental', Low: 'low', Medium: 'medium', Default: 'medium']
8383

8484
/** The spotbugs priority as unknown, high, medium, and low. */
85-
List<String> spotbugsPriority = ['unknown', 'High', 'Medium', 'Low']
85+
List<String> spotbugsPriority = [
86+
'unknown',
87+
'High',
88+
'Medium',
89+
'Low'
90+
]
8691
}

src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy

+4-15
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import groovy.ant.AntBuilder
1919
import groovy.json.JsonBuilder
2020
import groovy.json.JsonSlurper
2121
import groovy.xml.XmlSlurper
22-
import groovy.xml.slurpersupport.GPathResult;
22+
import groovy.xml.slurpersupport.GPathResult
2323
import groovy.xml.StreamingMarkupBuilder
2424

2525
import org.apache.maven.doxia.siterenderer.Renderer
@@ -37,7 +37,7 @@ import org.codehaus.plexus.resource.ResourceManager
3737
import org.codehaus.plexus.resource.loader.FileResourceLoader
3838

3939
import java.nio.charset.Charset
40-
import java.nio.charset.StandardCharsets;
40+
import java.nio.charset.StandardCharsets
4141
import java.nio.file.Files
4242
import java.nio.file.Paths
4343
import java.util.stream.Collectors
@@ -369,7 +369,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
369369
* @since 4.8.3.0 includes classifier
370370
*/
371371
@Parameter
372-
PluginArtifact[] plugins;
372+
PluginArtifact[] plugins
373373

374374
/**
375375
* Restrict analysis to the given comma-separated list of classes and packages.
@@ -717,7 +717,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
717717

718718
xDocsReporter.generateReport()
719719
}
720-
721720
}
722721

723722
/**
@@ -803,7 +802,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
803802
}
804803

805804
if (htmlOutput) {
806-
args << '-html=' + htmlTempFile.getAbsolutePath()
805+
args << '-html=' + htmlTempFile.getAbsolutePath()
807806
}
808807

809808
args << '-xml:withMessages=' + xmlTempFile.getAbsolutePath()
@@ -870,7 +869,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
870869
args << '-include'
871870
args << resourceHelper.getResourceFile(includefilter.trim())
872871
}
873-
874872
}
875873

876874
if (includeFilterFiles) {
@@ -880,7 +878,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
880878
args << '-include'
881879
args << resourceHelper.getResourceFile(includefilter.trim())
882880
}
883-
884881
}
885882

886883
if (excludeFilterFile) {
@@ -891,7 +888,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
891888
args << '-exclude'
892889
args << resourceHelper.getResourceFile(excludeFilter.trim())
893890
}
894-
895891
}
896892

897893
if (excludeFilterFiles) {
@@ -901,7 +897,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
901897
args << '-exclude'
902898
args << resourceHelper.getResourceFile(excludeFilter.trim())
903899
}
904-
905900
}
906901

907902
if (excludeBugsFile) {
@@ -1109,7 +1104,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
11091104
log.debug("System property ${sysProp.key} is ${sysProp.value}")
11101105
sysproperty(key: sysProp.key, value: sysProp.value)
11111106
}
1112-
11131107
}
11141108

11151109
long duration
@@ -1182,7 +1176,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
11821176
if (!log.isDebugEnabled()) {
11831177
xmlTempFile.delete()
11841178
}
1185-
11861179
}
11871180

11881181
if (sarifTempFile && sarifOutput && sarifTempFile.size() > 0) {
@@ -1218,7 +1211,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
12181211
+ 'The path include in the SARIF report could be incomplete.')
12191212
}
12201213
}
1221-
12221214
}
12231215
}
12241216

@@ -1233,7 +1225,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
12331225
sarifTempFile.delete()
12341226
}
12351227
}
1236-
12371228
}
12381229

12391230
/**
@@ -1272,7 +1263,6 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
12721263
log.debug("thresholdParameter is ${thresholdParameter}")
12731264

12741265
return thresholdParameter
1275-
12761266
}
12771267

12781268
/**
@@ -1285,5 +1275,4 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
12851275
super.setReportOutputDirectory(reportOutputDirectory)
12861276
this.outputDirectory = reportOutputDirectory
12871277
}
1288-
12891278
}

src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsPluginsTrait.groovy

-1
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,4 @@ trait SpotBugsPluginsTrait {
144144

145145
return "-effort:" + effortParameter
146146
}
147-
148147
}

src/main/groovy/org/codehaus/mojo/spotbugs/SpotbugsReportGenerator.groovy

-1
Original file line numberDiff line numberDiff line change
@@ -638,5 +638,4 @@ class SpotbugsReportGenerator implements SpotBugsInfo {
638638

639639
return value
640640
}
641-
642641
}

src/main/groovy/org/codehaus/mojo/spotbugs/XDocsReporter.groovy

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import edu.umd.cs.findbugs.Version
2020
import groovy.xml.slurpersupport.GPathResult
2121
import groovy.xml.StreamingMarkupBuilder
2222

23-
import java.nio.charset.StandardCharsets;
23+
import java.nio.charset.StandardCharsets
2424

2525
import org.apache.maven.plugin.logging.Log
2626

@@ -163,7 +163,7 @@ class XDocsReporter {
163163
spotbugsResults.BugInstance.each() { bugInstance ->
164164

165165
if (bugInstance.Class.find{ it.@primary == "true" }.@classname.text() != bugClass) {
166-
return
166+
return
167167
}
168168

169169
String type = bugInstance.@type.text()
@@ -215,5 +215,4 @@ class XDocsReporter {
215215
outputWriter << xmlBuilder.bind(xdoc)
216216
outputWriter.close()
217217
}
218-
219218
}

0 commit comments

Comments
 (0)