Upgrade to SpotBugs 3.1.3

This replaces FindBugs.  Also address a few violations.
This commit is contained in:
Andrew Gaul 2018-05-21 21:23:41 -07:00
parent a918550e57
commit 1f6ec343c0
6 changed files with 16 additions and 8 deletions

View File

@ -75,7 +75,7 @@ public class AutomaticHardwareIdSpec {
@Override
public String toString() {
if (disk.isPresent()) {
return String.format("automatic:cores=%s;ram=%s;disk=%.0f", cores, ram, disk.get().floatValue());
return String.format("automatic:cores=%s;ram=%s;disk=%.0f", cores, ram, disk.get());
}
else {
return String.format("automatic:cores=%s;ram=%s", cores, ram);

View File

@ -180,7 +180,7 @@ public class PasswordGenerator {
if (exclusions == null || exclusions.length == 0) {
this.characters = characters.toCharArray();
} else {
this.characters = new String(characters).replaceAll("[" + new String(exclusions) + "]", "").toCharArray();
this.characters = characters.replaceAll("[" + new String(exclusions) + "]", "").toCharArray();
}
}

View File

@ -1052,8 +1052,8 @@
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<xmlOutput>true</xmlOutput>
</configuration>
@ -1079,12 +1079,13 @@
<version>0.12</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.3</version>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>3.1.3</version>
<configuration>
<omitVisitors>
CloneIdiom,
ComparatorIdiom,
DefaultEncodingDetector,
EqualsOperandShouldHaveClassCompatibleWithThis,
FindBadCast2,

View File

@ -127,6 +127,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>3.1.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
<profiles>

View File

@ -59,6 +59,7 @@ public abstract class ResourceGroupAndNameAndIngressRules {
return Objects.hashCode(resourceGroup(), name());
}
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "EQ_UNUSUAL")
@Override
public boolean equals(Object obj) {
if (obj == this) {

View File

@ -57,7 +57,7 @@ public class AzureRateLimitRetryHandler extends RateLimitRetryHandler {
@Override
protected Optional<Long> millisToNextAvailableRequest(HttpCommand command, HttpResponse response) {
String secondsToNextAvailableRequest = response.getFirstHeaderOrNull(HttpHeaders.RETRY_AFTER);
return secondsToNextAvailableRequest != null ? Optional.of(Long.valueOf(secondsToNextAvailableRequest) * 1000)
return secondsToNextAvailableRequest != null ? Optional.of(Long.parseLong(secondsToNextAvailableRequest) * 1000)
: Optional.<Long> absent();
}