Skip to content

Commit 655e60b

Browse files
committed
Backport all changes to last java 8 line
1 parent ab12ce2 commit 655e60b

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<groupId>com.github.spotbugs</groupId>
3131
<artifactId>spotbugs-maven-plugin</artifactId>
32-
<version>4.9.4.2-SNAPSHOT</version>
32+
<version>4.8.6.7-SNAPSHOT</version>
3333
<packaging>maven-plugin</packaging>
3434

3535
<name>spotbugs-maven-plugin</name>
@@ -109,9 +109,9 @@
109109

110110
<properties>
111111
<!-- Align java runtime with spotbugs -->
112-
<java.version>11</java.version>
113-
<java.release.version>11</java.release.version>
114-
<javadoc.java.release.version>11</javadoc.java.release.version>
112+
<java.version>8</java.version>
113+
<java.release.version>8</java.release.version>
114+
<javadoc.java.release.version>8</javadoc.java.release.version>
115115

116116
<sourceDirectory>${project.basedir}/src/main/groovy</sourceDirectory>
117117
<testSourceDirectory>${project.basedir}/src/test/groovy</testSourceDirectory>
@@ -122,16 +122,16 @@
122122
<jacoco.minimum.coverage>0.11</jacoco.minimum.coverage>
123123

124124
<!-- Override spotbugs to this version from base-parent -->
125-
<spotbugs.version>4.9.4</spotbugs.version>
126-
<spotbugs.plugin>4.9.4.0</spotbugs.plugin>
125+
<spotbugs.version>4.8.6</spotbugs.version>
126+
<spotbugs.plugin>4.8.6.6</spotbugs.plugin>
127127

128128
<byte-buddy.version>1.17.7</byte-buddy.version>
129129
<javabean-tester.version>2.11.0</javabean-tester.version>
130130
<junitVersion>5.13.4</junitVersion>
131131
<slf4jVersion>2.0.17</slf4jVersion>
132132

133133
<antVersion>1.10.15</antVersion>
134-
<groovyVersion>5.0.0</groovyVersion>
134+
<groovyVersion>4.0.28</groovyVersion>
135135
<javaparserVersion>3.27.0</javaparserVersion>
136136

137137
<doxiaVersion>2.0.0</doxiaVersion>

src/stubfixer/java/com/github/spotbugs/StubOverrideFixer.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
import java.nio.charset.StandardCharsets;
2525
import java.nio.file.Files;
2626
import java.nio.file.Path;
27+
import java.nio.file.Paths;
28+
import java.util.Collections;
29+
import java.util.HashSet;
2730
import java.util.Set;
2831
import java.util.stream.Stream;
2932

@@ -39,8 +42,16 @@ public class StubOverrideFixer {
3942
private static final Logger logger = LoggerFactory.getLogger(StubOverrideFixer.class);
4043

4144
/** The Constant GROOVY_METHODS. */
42-
private static final Set<String> GROOVY_METHODS = Set.of("getMetaClass", "setMetaClass", "invokeMethod",
43-
"getProperty", "setProperty");
45+
private static final Set<String> GROOVY_METHODS;
46+
static {
47+
Set<String> tempSet = new HashSet<>();
48+
tempSet.add("getMetaClass");
49+
tempSet.add("setMetaClass");
50+
tempSet.add("invokeMethod");
51+
tempSet.add("getProperty");
52+
tempSet.add("setProperty");
53+
GROOVY_METHODS = Collections.unmodifiableSet(tempSet);
54+
}
4455

4556
/**
4657
* The main method.
@@ -49,7 +60,7 @@ public class StubOverrideFixer {
4960
* @throws IOException Signals that an I/O exception has occurred.
5061
*/
5162
public static void main(String[] args) throws IOException {
52-
Path stubsDir = Path.of(args[0]);
63+
Path stubsDir = Paths.get(args[0]);
5364
try (Stream<Path> stream = Files.walk(stubsDir)) {
5465
stream.filter(p -> p.toString().endsWith(".java")).forEach(StubOverrideFixer::processStub);
5566
}

0 commit comments

Comments
 (0)