Add SuppressWarnings SS_SHOULD_BE_STATIC (#8138)

* Spotbugs: SS_SHOULD_BE_STATIC (#8073)

* Add SuppressWarnings SS_SHOULD_BE_STATIC

Fixes #8073

* Fix the voilation

* Make them non-final

* Remove @Nonnull
This commit is contained in:
Fokko Driesprong 2019-07-31 18:44:42 +02:00 committed by Roman Leventov
parent 63461311f8
commit faf51107d5
3 changed files with 7 additions and 11 deletions

View File

@ -83,7 +83,6 @@
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
<Bug pattern="SF_SWITCH_NO_DEFAULT"/>
<Bug pattern="SR_NOT_CHECKED"/>
<Bug pattern="SS_SHOULD_BE_STATIC"/>
<Bug pattern="SWL_SLEEP_WITH_LOCK_HELD"/>
<Bug pattern="UL_UNRELEASED_LOCK_EXCEPTION_PATH"/>
<Bug pattern="URF_UNREAD_FIELD"/>

View File

@ -25,32 +25,29 @@ import org.apache.druid.utils.JvmUtils;
import org.joda.time.Period;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
*/
public class WorkerConfig
{
@JsonProperty
@NotNull
private final String ip = DruidNode.getDefaultHost();
private String ip = DruidNode.getDefaultHost();
@JsonProperty
@NotNull
private final String version = "0";
private String version = "0";
@JsonProperty
@Min(1)
private final int capacity = Math.max(1, JvmUtils.getRuntimeInfo().getAvailableProcessors() - 1);
private int capacity = Math.max(1, JvmUtils.getRuntimeInfo().getAvailableProcessors() - 1);
@JsonProperty
private final long intermediaryPartitionDiscoveryPeriodSec = 60L;
private long intermediaryPartitionDiscoveryPeriodSec = 60L;
@JsonProperty
private final long intermediaryPartitionCleanupPeriodSec = 300L;
private long intermediaryPartitionCleanupPeriodSec = 300L;
@JsonProperty
private final Period intermediaryPartitionTimeout = new Period("P1D");
private Period intermediaryPartitionTimeout = new Period("P1D");
public String getIp()
{

View File

@ -40,8 +40,8 @@ import java.util.Map;
@JsonTypeName("anonymous")
public class AnonymousAuthenticator implements Authenticator
{
private static final String DEFAULT_IDENTITY = "defaultUser";
private final AuthenticationResult anonymousResult;
private final String DEFAULT_IDENTITY = "defaultUser";
@JsonCreator
public AnonymousAuthenticator(