Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Spotbugs 6.0.15 #1398

Merged
merged 4 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ buildscript {
}
dependencies {
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:7.0.0'
classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.13"
classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.15"
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.2'

// Scala plugins
Expand Down
21 changes: 20 additions & 1 deletion config/spotbugs/exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,29 @@
~ limitations under the License.
-->

<!-- See https://spotbugs.readthedocs.io/en/latest/filter.html#rank
<!--
To determine the rank of a newly-detected bug that you would like to exclude,
run spotbugsMain task with xml.enabled, then examine the XML report in
<module>/build/reports/spotbugs/main.xml, where the rankings are
included as part of the report, e.g.

<BugInstance type="PA_PUBLIC_PRIMITIVE_ATTRIBUTE" priority="2" rank="16" ...

See https://spotbugs.readthedocs.io/en/latest/filter.html#rank
for the mapping from SpotBugs rank to verbal labels.
-->
<FindBugsFilter>
<Match>
<!-- MongoDB status: "No Fix Needed", SpotBugs rank: 16 -->
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>

<Match>
<!-- MongoDB status: "No Fix Needed", SpotBugs rank: 16 -->
<Class name="com.mongodb.internal.connection.tlschannel.impl.BufferHolder"/>
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
</Match>

<Match>
<!-- MongoDB status: "No Fix Needed", SpotBugs rank: 18 -->
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import static com.mongodb.assertions.Assertions.assertNotNull;
import static com.mongodb.assertions.Assertions.isTrue;
import static com.mongodb.connection.ClusterConnectionMode.MULTIPLE;
import static com.mongodb.connection.ClusterType.UNKNOWN;
Expand Down Expand Up @@ -234,7 +235,7 @@ private boolean handleReplicaSetMemberChanged(final ServerDescription newDescrip
}

if (replicaSetName == null) {
replicaSetName = newDescription.getSetName();
replicaSetName = assertNotNull(newDescription.getSetName());
}

if (!replicaSetName.equals(newDescription.getSetName())) {
Expand Down