Skip to content

Commit 7fbb6c8

Browse files
chore(deps): update plugin com.github.spotbugs to v6.2.2 (#2509)
* chore(deps): update plugin com.github.spotbugs to v6.2.2 * Configure spotbugs-exclude.xml to exclude `THROWS_METHOD_THROWS_RUNTIMEEXCEPTION` * Remove extra SuppressFBWarnings * Suppress THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION * Suppress things for lib-extra as well * Remove extra SuppressFBWarnings in lib-extra --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Goooler <[email protected]>
1 parent 433c580 commit 7fbb6c8

File tree

11 files changed

+22
-21
lines changed

11 files changed

+22
-21
lines changed

lib-extra/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,5 @@ p2deps {
102102
spotbugs {
103103
// LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes).
104104
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('LOW')
105+
excludeFilter = file("spotbugs-exclude.xml")
105106
}

lib-extra/spotbugs-exclude.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<FindBugsFilter>
2+
<Match>
3+
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
4+
</Match>
5+
<Match>
6+
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
7+
</Match>
8+
</FindBugsFilter>

lib-extra/src/main/java/com/diffplug/spotless/extra/GitAttributesLineEndings.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ static class RuntimeInit {
188188
/** git worktree root, might not exist if we're not in a git repo. */
189189
final @Nullable File workTree;
190190

191-
@SuppressFBWarnings("SIC_INNER_SHOULD_BE_STATIC_ANON")
192191
RuntimeInit(File projectDir) {
193192
/////////////////////////////////
194193
// USER AND SYSTEM-WIDE VALUES //

lib/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ dependencies {
139139
spotbugs {
140140
// LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes).
141141
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('LOW')
142+
excludeFilter = file("spotbugs-exclude.xml")
142143
}
143144

144145
apply from: rootProject.file('gradle/special-tests.gradle')

lib/spotbugs-exclude.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<FindBugsFilter>
2+
<Match>
3+
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
4+
</Match>
5+
<Match>
6+
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
7+
</Match>
8+
</FindBugsFilter>

lib/src/main/java/com/diffplug/spotless/ConfigurationCacheHackList.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
import com.diffplug.spotless.yaml.SerializeToByteArrayHack;
2626

27-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
28-
2927
/**
3028
* Gradle requires three things:
3129
* - Gradle defines cache equality based on your serialized representation
@@ -78,7 +76,6 @@ private void writeObject(java.io.ObjectOutputStream out) throws IOException {
7876
}
7977
}
8078

81-
@SuppressFBWarnings("MC_OVERRIDABLE_METHOD_CALL_IN_READ_OBJECT")
8279
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
8380
boolean serializeToByteArrayFirst = in.readBoolean();
8481
optimizeForEquality = in.readBoolean();

lib/src/main/java/com/diffplug/spotless/ProcessRunner.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2024 DiffPlug
2+
* Copyright 2020-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,8 +37,6 @@
3737
import javax.annotation.Nonnull;
3838
import javax.annotation.Nullable;
3939

40-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
41-
4240
/**
4341
* Shelling out to a process is harder than it ought to be in Java.
4442
* If you don't read stdout and stderr on their own threads, you risk
@@ -195,7 +193,6 @@ private void checkState() {
195193
}
196194
}
197195

198-
@SuppressFBWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
199196
public static class Result {
200197
private final List<String> args;
201198
private final int exitCode;

lib/src/main/java/com/diffplug/spotless/SpotlessCache.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,8 +30,6 @@
3030
import org.slf4j.Logger;
3131
import org.slf4j.LoggerFactory;
3232

33-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
34-
3533
/**
3634
* Spotless' global cache. {@link SpotlessCache#clear()} should be called
3735
* when Spotless is no longer in use to release any resources it has grabbed.
@@ -64,12 +62,10 @@ public final int hashCode() {
6462

6563
final Map<SerializedKey, URLClassLoader> cache = new HashMap<>();
6664

67-
@SuppressFBWarnings("DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED")
6865
synchronized ClassLoader classloader(JarState state) {
6966
return classloader(state, state);
7067
}
7168

72-
@SuppressFBWarnings("DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED")
7369
synchronized ClassLoader classloader(Serializable key, JarState state) {
7470
SerializedKey serializedKey = new SerializedKey(key);
7571
return cache

lib/src/main/java/com/diffplug/spotless/generic/FenceStep.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import com.diffplug.spotless.LineEnding;
3232
import com.diffplug.spotless.Lint;
3333

34-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
35-
3634
public class FenceStep {
3735
/** Declares the name of the step. */
3836
public static FenceStep named(String name) {
@@ -135,7 +133,6 @@ public BaseFormatter toFormatterFunc() {
135133
}
136134
}
137135

138-
@SuppressFBWarnings("SE_TRANSIENT_FIELD_NOT_RESTORED")
139136
private static class BaseFormatter implements FormatterFunc.NeedsFile, FormatterFunc.Closeable {
140137
final Kind kind;
141138
final Pattern regex;

lib/src/main/java/com/diffplug/spotless/java/ImportOrderStep.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,8 +40,6 @@
4040
import com.diffplug.spotless.FormatterStep;
4141
import com.diffplug.spotless.SerializedFunction;
4242

43-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
44-
4543
public final class ImportOrderStep implements Serializable {
4644
private static final long serialVersionUID = 1L;
4745
private static final boolean WILDCARDS_LAST_DEFAULT = false;
@@ -94,7 +92,6 @@ private FormatterStep createFrom(boolean wildcardsLast, boolean semanticSort, Se
9492
State::toFormatter);
9593
}
9694

97-
@SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE") // workaround https://github.com/spotbugs/spotbugs/issues/756
9895
private static List<String> getImportOrder(File importsFile) {
9996
try (Stream<String> lines = Files.lines(importsFile.toPath())) {
10097
return lines.filter(line -> !line.startsWith("#"))

0 commit comments

Comments
 (0)