diff --git a/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/DateUtils.java b/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/DateUtils.java index 80b42aa82bf..3a25ebebe50 100644 --- a/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/DateUtils.java +++ b/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/DateUtils.java @@ -13,11 +13,11 @@ import org.joda.time.format.ISODateTimeFormat; public class DateUtils { - private final static FormatDateTimeFormatter formatDateOnlyFormatter = Joda.forPattern("yyyy-MM-dd"); + private static final FormatDateTimeFormatter formatDateOnlyFormatter = Joda.forPattern("yyyy-MM-dd"); - private final static DateTimeFormatter dateOnlyFormatter = formatDateOnlyFormatter.parser().withZoneUTC(); + private static final DateTimeFormatter dateOnlyFormatter = formatDateOnlyFormatter.parser().withZoneUTC(); - private final static DateTimeFormatter dateTimeFormatter = ISODateTimeFormat.dateTime().withZoneUTC(); + private static final DateTimeFormatter dateTimeFormatter = ISODateTimeFormat.dateTime().withZoneUTC(); public static long endOfTheDay(String date) { try { diff --git a/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java b/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java index 9acb3a6f4ee..403b9870f3c 100644 --- a/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java +++ b/elasticsearch/license/base/src/main/java/org/elasticsearch/license/core/License.java @@ -29,9 +29,9 @@ import java.util.Locale; * Provides serialization/deserialization & validation methods for license object */ public class License implements ToXContent { - public final static int VERSION_START = 1; - public final static int VERSION_NO_FEATURE_TYPE = 2; - public final static int VERSION_CURRENT = VERSION_NO_FEATURE_TYPE; + public static final int VERSION_START = 1; + public static final int VERSION_NO_FEATURE_TYPE = 2; + public static final int VERSION_CURRENT = VERSION_NO_FEATURE_TYPE; /** * XContent param name to deserialize license(s) with @@ -51,7 +51,7 @@ public class License implements ToXContent { */ public static final String LICENSE_VERSION_MODE = "license_version"; - public final static Comparator LATEST_ISSUE_DATE_FIRST = new Comparator() { + public static final Comparator LATEST_ISSUE_DATE_FIRST = new Comparator() { @Override public int compare(License right, License left) { return Long.compare(left.issueDate(), right.issueDate()); @@ -506,7 +506,7 @@ public class License implements ToXContent { return result; } - public final static class Fields { + public static final class Fields { public static final String STATUS = "status"; public static final String UID = "uid"; public static final String TYPE = "type"; diff --git a/elasticsearch/license/base/src/test/java/org/elasticsearch/license/core/TestUtils.java b/elasticsearch/license/base/src/test/java/org/elasticsearch/license/core/TestUtils.java index 1468ad422f3..d2b8e998e43 100644 --- a/elasticsearch/license/base/src/test/java/org/elasticsearch/license/core/TestUtils.java +++ b/elasticsearch/license/base/src/test/java/org/elasticsearch/license/core/TestUtils.java @@ -25,9 +25,9 @@ import static org.hamcrest.core.IsEqual.equalTo; public class TestUtils { - private final static FormatDateTimeFormatter formatDateTimeFormatter = Joda.forPattern("yyyy-MM-dd"); - private final static DateMathParser dateMathParser = new DateMathParser(formatDateTimeFormatter); - private final static DateTimeFormatter dateTimeFormatter = formatDateTimeFormatter.printer(); + private static final FormatDateTimeFormatter formatDateTimeFormatter = Joda.forPattern("yyyy-MM-dd"); + private static final DateMathParser dateMathParser = new DateMathParser(formatDateTimeFormatter); + private static final DateTimeFormatter dateTimeFormatter = formatDateTimeFormatter.printer(); public static String dateMathString(String time, final long now) { return dateTimeFormatter.print(dateMathParser.parse(time, new Callable() { diff --git a/elasticsearch/license/licensor/src/main/java/org/elasticsearch/license/licensor/LicenseSigner.java b/elasticsearch/license/licensor/src/main/java/org/elasticsearch/license/licensor/LicenseSigner.java index 34c6f2c4393..0bebf26532f 100644 --- a/elasticsearch/license/licensor/src/main/java/org/elasticsearch/license/licensor/LicenseSigner.java +++ b/elasticsearch/license/licensor/src/main/java/org/elasticsearch/license/licensor/LicenseSigner.java @@ -33,7 +33,7 @@ import java.util.Collections; */ public class LicenseSigner { - private final static int MAGIC_LENGTH = 13; + private static final int MAGIC_LENGTH = 13; private final Path publicKeyPath; diff --git a/elasticsearch/license/licensor/src/test/java/org/elasticsearch/license/licensor/TestUtils.java b/elasticsearch/license/licensor/src/test/java/org/elasticsearch/license/licensor/TestUtils.java index fd913257f04..3dc45d2d0ad 100644 --- a/elasticsearch/license/licensor/src/test/java/org/elasticsearch/license/licensor/TestUtils.java +++ b/elasticsearch/license/licensor/src/test/java/org/elasticsearch/license/licensor/TestUtils.java @@ -36,9 +36,9 @@ public class TestUtils { public static final String PUBLIC_KEY_RESOURCE = "/public.key"; public static final String PRIVATE_KEY_RESOURCE = "/private.key"; - private final static FormatDateTimeFormatter formatDateTimeFormatter = Joda.forPattern("yyyy-MM-dd"); - private final static DateMathParser dateMathParser = new DateMathParser(formatDateTimeFormatter); - private final static DateTimeFormatter dateTimeFormatter = formatDateTimeFormatter.printer(); + private static final FormatDateTimeFormatter formatDateTimeFormatter = Joda.forPattern("yyyy-MM-dd"); + private static final DateMathParser dateMathParser = new DateMathParser(formatDateTimeFormatter); + private static final DateTimeFormatter dateTimeFormatter = formatDateTimeFormatter.printer(); public static String dumpLicense(License license) throws Exception { XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java index 2e7600ca438..d0f15f2f26e 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java @@ -93,7 +93,7 @@ public class SearchInputIT extends ESIntegTestCase { return types; } - private final static String TEMPLATE_QUERY = "{\"query\":{\"bool\":{\"must\":{\"match\":{\"event_type\":{\"query\":\"a\"," + + private static final String TEMPLATE_QUERY = "{\"query\":{\"bool\":{\"must\":{\"match\":{\"event_type\":{\"query\":\"a\"," + "\"type\":\"boolean\"}}},\"filter\":{\"range\":{\"_timestamp\":" + "{\"from\":\"{{ctx.trigger.scheduled_time}}||-{{seconds_param}}\",\"to\":\"{{ctx.trigger.scheduled_time}}\"," + "\"include_lower\":true,\"include_upper\":true}}}}}}"; diff --git a/elasticsearch/qa/smoke-test-graph-with-security/src/test/java/org/elasticsearch/smoketest/GraphWithSecurityIT.java b/elasticsearch/qa/smoke-test-graph-with-security/src/test/java/org/elasticsearch/smoketest/GraphWithSecurityIT.java index d4d92244c7c..01556a37fde 100644 --- a/elasticsearch/qa/smoke-test-graph-with-security/src/test/java/org/elasticsearch/smoketest/GraphWithSecurityIT.java +++ b/elasticsearch/qa/smoke-test-graph-with-security/src/test/java/org/elasticsearch/smoketest/GraphWithSecurityIT.java @@ -22,8 +22,8 @@ import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordTok public class GraphWithSecurityIT extends ESRestTestCase { - private final static String TEST_ADMIN_USERNAME = "test_admin"; - private final static String TEST_ADMIN_PASSWORD = "changeme"; + private static final String TEST_ADMIN_USERNAME = "test_admin"; + private static final String TEST_ADMIN_PASSWORD = "changeme"; public GraphWithSecurityIT(@Name("yaml") RestTestCandidate testCandidate) { super(testCandidate); diff --git a/elasticsearch/qa/smoke-test-watcher-with-security/src/test/java/org/elasticsearch/smoketest/WatcherWithSecurityIT.java b/elasticsearch/qa/smoke-test-watcher-with-security/src/test/java/org/elasticsearch/smoketest/WatcherWithSecurityIT.java index 67ef62fcbaa..7c449e251b0 100644 --- a/elasticsearch/qa/smoke-test-watcher-with-security/src/test/java/org/elasticsearch/smoketest/WatcherWithSecurityIT.java +++ b/elasticsearch/qa/smoke-test-watcher-with-security/src/test/java/org/elasticsearch/smoketest/WatcherWithSecurityIT.java @@ -27,8 +27,8 @@ import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordTok public class WatcherWithSecurityIT extends ESRestTestCase { - private final static String TEST_ADMIN_USERNAME = "test_admin"; - private final static String TEST_ADMIN_PASSWORD = "changeme"; + private static final String TEST_ADMIN_USERNAME = "test_admin"; + private static final String TEST_ADMIN_PASSWORD = "changeme"; public WatcherWithSecurityIT(@Name("yaml") RestTestCandidate testCandidate) { super(testCandidate); diff --git a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicenseUtils.java b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicenseUtils.java index 09c4b1dac49..2f7a3ca7470 100644 --- a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicenseUtils.java +++ b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicenseUtils.java @@ -10,7 +10,7 @@ import org.elasticsearch.rest.RestStatus; public class LicenseUtils { - public final static String EXPIRED_FEATURE_HEADER = "es.license.expired.feature"; + public static final String EXPIRED_FEATURE_HEADER = "es.license.expired.feature"; /** * Exception to be thrown when a feature action requires a valid license, but license diff --git a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesMetaData.java b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesMetaData.java index cc1dabb24bb..afba390049b 100644 --- a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesMetaData.java +++ b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesMetaData.java @@ -239,7 +239,7 @@ public class LicensesMetaData extends AbstractDiffable implemen return new LicensesMetaData(license); } - private final static class Fields { + private static final class Fields { private static final String SIGNED_LICENCES = "signed_licenses"; private static final String TRIAL_LICENSES = "trial_licenses"; private static final String LICENSE = "license"; diff --git a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java index 3438fdbda8d..1b1d14e5add 100644 --- a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java +++ b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java @@ -643,11 +643,11 @@ public class LicensesService extends AbstractLifecycleComponent } } - public static abstract class ExpirationCallback { + public abstract static class ExpirationCallback { public enum Orientation {PRE, POST} - public static abstract class Pre extends ExpirationCallback { + public abstract static class Pre extends ExpirationCallback { /** * Callback schedule prior to license expiry @@ -677,7 +677,7 @@ public class LicensesService extends AbstractLifecycleComponent } } - public static abstract class Post extends ExpirationCallback { + public abstract static class Post extends ExpirationCallback { /** * Callback schedule after license expiry diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/TestUtils.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/TestUtils.java index 0dc69597a89..a0dd4f5a0da 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/TestUtils.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/TestUtils.java @@ -48,8 +48,8 @@ import static org.junit.Assert.assertThat; public class TestUtils { - private final static FormatDateTimeFormatter formatDateTimeFormatter = Joda.forPattern("yyyy-MM-dd"); - private final static DateMathParser dateMathParser = new DateMathParser(formatDateTimeFormatter); + private static final FormatDateTimeFormatter formatDateTimeFormatter = Joda.forPattern("yyyy-MM-dd"); + private static final DateMathParser dateMathParser = new DateMathParser(formatDateTimeFormatter); public static long dateMath(String time, final long now) { return dateMathParser.parse(time, new Callable() { diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/consumer/EagerLicenseRegistrationConsumerPlugin.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/consumer/EagerLicenseRegistrationConsumerPlugin.java index ed07814b408..d3fcd8e72d7 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/consumer/EagerLicenseRegistrationConsumerPlugin.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/consumer/EagerLicenseRegistrationConsumerPlugin.java @@ -16,7 +16,7 @@ import org.elasticsearch.common.settings.Settings; */ public class EagerLicenseRegistrationConsumerPlugin extends TestConsumerPluginBase { - public final static String NAME = "test_consumer_plugin_1"; + public static final String NAME = "test_consumer_plugin_1"; @Inject public EagerLicenseRegistrationConsumerPlugin(Settings settings) { diff --git a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSet.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSet.java index 717c40dbb02..cef76ffd35a 100644 --- a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSet.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringFeatureSet.java @@ -82,7 +82,7 @@ public class MonitoringFeatureSet implements XPackFeatureSet { private static final String ENABLED_EXPORTERS_XFIELD = "enabled_exporters"; - private @Nullable Map exporters; + @Nullable private Map exporters; public Usage(StreamInput in) throws IOException { super(in); diff --git a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/exporter/Exporter.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/exporter/Exporter.java index 96aa4637032..f13a7173f4e 100644 --- a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/exporter/Exporter.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/exporter/Exporter.java @@ -23,7 +23,8 @@ public abstract class Exporter implements AutoCloseable { protected final Config config; protected final ESLogger logger; - protected final @Nullable TimeValue bulkTimeout; + @Nullable protected final TimeValue bulkTimeout; + private AtomicBoolean closed = new AtomicBoolean(false); public Exporter(String type, Config config) { @@ -103,7 +104,7 @@ public abstract class Exporter implements AutoCloseable { } } - public static abstract class Factory { + public abstract static class Factory { private final String type; private final boolean singleton; diff --git a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporter.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporter.java index 3237ef5f960..4f4027ba65e 100644 --- a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporter.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/exporter/http/HttpExporter.java @@ -535,7 +535,7 @@ public class HttpExporter extends Exporter { } } - static private void validateHosts(String[] hosts) { + private static void validateHosts(String[] hosts) { for (String host : hosts) { try { HttpExporterUtils.parseHostWithPath(host, ""); diff --git a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolver.java b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolver.java index 177e6a65635..e7b6eb692de 100644 --- a/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolver.java +++ b/elasticsearch/x-pack/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/agent/resolver/MonitoringIndexNameResolver.java @@ -126,7 +126,7 @@ public abstract class MonitoringIndexNameResolver { * Data index name resolvers are used used to index documents in * the monitoring data index (.monitoring-data-{VERSION}) */ - public static abstract class Data extends MonitoringIndexNameResolver { + public abstract static class Data extends MonitoringIndexNameResolver { public static final String DATA = "data"; @@ -166,7 +166,7 @@ public abstract class MonitoringIndexNameResolver { * Timestamped index name resolvers are used used to index documents in * a timestamped index (.monitoring-{ID}-{VERSION}-YYYY.MM.dd) */ - public static abstract class Timestamped extends MonitoringIndexNameResolver { + public abstract static class Timestamped extends MonitoringIndexNameResolver { public static final Setting INDEX_NAME_TIME_FORMAT_SETTING = new Setting<>("index.name.time_format", "YYYY.MM.dd", Function.identity(), Setting.Property.NodeScope); diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/SecurityFeatureSet.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/SecurityFeatureSet.java index ee09a04cf67..18d37bc0192 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/SecurityFeatureSet.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/SecurityFeatureSet.java @@ -32,7 +32,7 @@ public class SecurityFeatureSet implements XPackFeatureSet { private final boolean enabled; private final SecurityLicenseState licenseState; - private final @Nullable Realms realms; + @Nullable private final Realms realms; @Inject public SecurityFeatureSet(Settings settings, @Nullable SecurityLicenseState licenseState, diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/Realm.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/Realm.java index 53c0cdd55fb..dd5a9f404c3 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/Realm.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/Realm.java @@ -111,7 +111,7 @@ public abstract class Realm implements Comparable * settings. The factory will be called when creating a realm during the parsing of realms defined in the * elasticsearch.yml file */ - public static abstract class Factory { + public abstract static class Factory { private final String type; private final boolean internal; diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/activedirectory/ActiveDirectoryGroupsResolver.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/activedirectory/ActiveDirectoryGroupsResolver.java index 1d98ce6ea54..812a16ece33 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/activedirectory/ActiveDirectoryGroupsResolver.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/activedirectory/ActiveDirectoryGroupsResolver.java @@ -88,7 +88,7 @@ public class ActiveDirectoryGroupsResolver implements GroupsResolver { * * @param SID byte encoded security ID */ - static public String binarySidToStringSid(byte[] SID) { + public static String binarySidToStringSid(byte[] SID) { String strSID; //convert the SID into string format diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/AbstractLdapRealm.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/AbstractLdapRealm.java index 77e7a5baeb2..1f6c9611282 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/AbstractLdapRealm.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/AbstractLdapRealm.java @@ -101,7 +101,7 @@ public abstract class AbstractLdapRealm extends CachingUsernamePasswordRealm { } } - public static abstract class Factory extends UsernamePasswordRealm.Factory { + public abstract static class Factory extends UsernamePasswordRealm.Factory { public Factory(String type, RestController restController) { super(type, restController, false); diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/support/BCrypt.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/support/BCrypt.java index b4c323bc590..4242beee7af 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/support/BCrypt.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/support/BCrypt.java @@ -337,13 +337,13 @@ public class BCrypt { // bcrypt IV: "OrpheanBeholderScryDoubt". The C implementation calls // this "ciphertext", but it is really plaintext or an IV. We keep // the name to make code comparison easier. - static private final int bf_crypt_ciphertext[] = { + private static final int bf_crypt_ciphertext[] = { 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, 0x6f756274 }; // Table for Base64 encoding - static private final char base64_code[] = { + private static final char base64_code[] = { '.', '/', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', @@ -353,7 +353,7 @@ public class BCrypt { }; // Table for Base64 decoding - static private final byte index_64[] = { + private static final byte index_64[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/support/UsernamePasswordRealm.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/support/UsernamePasswordRealm.java index 4a471a44cac..c37f7f8458b 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/support/UsernamePasswordRealm.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authc/support/UsernamePasswordRealm.java @@ -31,7 +31,7 @@ public abstract class UsernamePasswordRealm extends Realm return token instanceof UsernamePasswordToken; } - public static abstract class Factory extends Realm.Factory { + public abstract static class Factory extends Realm.Factory { protected Factory(String type, RestController restController, boolean internal) { super(type, internal); diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/accesscontrol/DocumentSubsetReader.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/accesscontrol/DocumentSubsetReader.java index abacf63a69b..3667864caee 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/accesscontrol/DocumentSubsetReader.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/accesscontrol/DocumentSubsetReader.java @@ -31,7 +31,7 @@ public final class DocumentSubsetReader extends FilterLeafReader { return new DocumentSubsetDirectoryReader(in, bitsetFilterCache, roleQuery); } - final static class DocumentSubsetDirectoryReader extends FilterDirectoryReader { + static final class DocumentSubsetDirectoryReader extends FilterDirectoryReader { private final Query roleQuery; private final BitsetFilterCache bitsetFilterCache; diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/privilege/ClusterPrivilege.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/privilege/ClusterPrivilege.java index bcddec80786..cbbbc5fb33a 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/privilege/ClusterPrivilege.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/authz/privilege/ClusterPrivilege.java @@ -40,7 +40,7 @@ public class ClusterPrivilege extends AbstractAutomatonPrivilege ACTION_MATCHER = ClusterPrivilege.ALL.predicate(); + public static final Predicate ACTION_MATCHER = ClusterPrivilege.ALL.predicate(); private static final Set values = new CopyOnWriteArraySet<>(); diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/support/AbstractSecurityModule.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/support/AbstractSecurityModule.java index feef8fe746b..7569423a497 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/support/AbstractSecurityModule.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/support/AbstractSecurityModule.java @@ -33,7 +33,7 @@ public abstract class AbstractSecurityModule extends AbstractModule { protected abstract void configure(boolean clientMode); - public static abstract class Node extends AbstractSecurityModule { + public abstract static class Node extends AbstractSecurityModule { protected Node(Settings settings) { super(settings); diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportService.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportService.java index 851f7dc91a9..589a762eb82 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportService.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/SecurityServerTransportService.java @@ -211,7 +211,7 @@ public class SecurityServerTransportService extends TransportService { * This handler wrapper ensures that the response thread executes with the correct thread context. Before any of the4 handle methods * are invoked we restore the context. */ - private final static class ContextRestoreResponseHandler implements TransportResponseHandler { + private static final class ContextRestoreResponseHandler implements TransportResponseHandler { private final TransportResponseHandler delegate; private final ThreadContext.StoredContext threadContext; diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/netty/SecurityNettyTransport.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/netty/SecurityNettyTransport.java index 9b924372ffd..ae7f224f025 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/netty/SecurityNettyTransport.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/transport/netty/SecurityNettyTransport.java @@ -79,7 +79,7 @@ public class SecurityNettyTransport extends NettyTransport { private final ServerSSLService serverSslService; private final ClientSSLService clientSSLService; - private final @Nullable IPFilter authenticator; + @Nullable private final IPFilter authenticator; private final boolean ssl; @Inject diff --git a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/user/User.java b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/user/User.java index c22ddc8be27..b97baaabc44 100644 --- a/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/user/User.java +++ b/elasticsearch/x-pack/security/src/main/java/org/elasticsearch/xpack/security/user/User.java @@ -35,8 +35,8 @@ public class User implements ToXContent { private final User runAs; private final Map metadata; - private final @Nullable String fullName; - private final @Nullable String email; + @Nullable private final String fullName; + @Nullable private final String email; public User(String username, String... roles) { this(username, roles, null, null, null); diff --git a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java index f271a375067..2602db5f22b 100644 --- a/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java +++ b/elasticsearch/x-pack/security/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTestCase.java @@ -37,7 +37,7 @@ import static org.hamcrest.Matchers.is; * This test assumes all subclass tests will be of type SUITE. It picks a random realm configuration for the tests, and * writes a group to role mapping file for each node. */ -abstract public class AbstractAdLdapRealmTestCase extends SecurityIntegTestCase { +public abstract class AbstractAdLdapRealmTestCase extends SecurityIntegTestCase { public static final String XPACK_SECURITY_AUTHC_REALMS_EXTERNAL = "xpack.security.authc.realms.external"; public static final String PASSWORD = "NickFuryHeartsES"; diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/action/XPackInfoResponse.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/action/XPackInfoResponse.java index c7f08ae09c1..3dfb7852a1c 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/action/XPackInfoResponse.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/action/XPackInfoResponse.java @@ -29,9 +29,9 @@ import java.util.stream.Collectors; */ public class XPackInfoResponse extends ActionResponse { - private @Nullable BuildInfo buildInfo; - private @Nullable LicenseInfo licenseInfo; - private @Nullable FeatureSetsInfo featureSetsInfo; + @Nullable private BuildInfo buildInfo; + @Nullable private LicenseInfo licenseInfo; + @Nullable private FeatureSetsInfo featureSetsInfo; public XPackInfoResponse() {} @@ -221,7 +221,7 @@ public class XPackInfoResponse extends ActionResponse { public static class FeatureSet implements ToXContent, Writeable { private final String name; - private final @Nullable String description; + @Nullable private final String description; private final boolean available; private final boolean enabled; diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequest.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequest.java index 8bc7e446796..1f7730dd895 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequest.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequest.java @@ -41,14 +41,14 @@ public class HttpRequest implements ToXContent { final int port; final Scheme scheme; final HttpMethod method; - final @Nullable String path; + @Nullable final String path; final Map params; final Map headers; - final @Nullable HttpAuth auth; - final @Nullable String body; - final @Nullable TimeValue connectionTimeout; - final @Nullable TimeValue readTimeout; - final @Nullable HttpProxy proxy; + @Nullable final HttpAuth auth; + @Nullable final String body; + @Nullable final TimeValue connectionTimeout; + @Nullable final TimeValue readTimeout; + @Nullable final HttpProxy proxy; public HttpRequest(String host, int port, @Nullable Scheme scheme, @Nullable HttpMethod method, @Nullable String path, @Nullable Map params, @Nullable Map headers, diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequestTemplate.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequestTemplate.java index a97aec967c2..537cb5b2e1f 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequestTemplate.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/http/HttpRequestTemplate.java @@ -46,9 +46,9 @@ public class HttpRequestTemplate implements ToXContent { private final Map headers; private final HttpAuth auth; private final TextTemplate body; - private final @Nullable TimeValue connectionTimeout; - private final @Nullable TimeValue readTimeout; - private final @Nullable HttpProxy proxy; + @Nullable private final TimeValue connectionTimeout; + @Nullable private final TimeValue readTimeout; + @Nullable private final HttpProxy proxy; public HttpRequestTemplate(String host, int port, @Nullable Scheme scheme, @Nullable HttpMethod method, @Nullable TextTemplate path, Map params, Map headers, HttpAuth auth, diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/text/TextTemplate.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/text/TextTemplate.java index 9324efda640..7dabf71449b 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/text/TextTemplate.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/common/text/TextTemplate.java @@ -27,9 +27,9 @@ import java.util.Map; public class TextTemplate implements ToXContent { private final String template; - private final @Nullable XContentType contentType; - private final @Nullable ScriptType type; - private final @Nullable Map params; + @Nullable private final XContentType contentType; + @Nullable private final ScriptType type; + @Nullable private final Map params; public TextTemplate(String template) { this(template, null, null, null); @@ -190,7 +190,7 @@ public class TextTemplate implements ToXContent { return new Builder.DefaultType(text); } - public static abstract class Builder { + public abstract static class Builder { protected final ScriptType type; protected final String template; diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/HipChatMessage.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/HipChatMessage.java index 54c80f9004f..0c4e8f08537 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/HipChatMessage.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/HipChatMessage.java @@ -29,12 +29,12 @@ import java.util.Map; public class HipChatMessage implements ToXContent { final String body; - final @Nullable String[] rooms; - final @Nullable String[] users; - final @Nullable String from; - final @Nullable Format format; - final @Nullable Color color; - final @Nullable Boolean notify; + @Nullable final String[] rooms; + @Nullable final String[] users; + @Nullable final String from; + @Nullable final Format format; + @Nullable final Color color; + @Nullable final Boolean notify; public HipChatMessage(String body, String[] rooms, String[] users, String from, Format format, Color color, Boolean notify) { this.body = body; @@ -141,13 +141,13 @@ public class HipChatMessage implements ToXContent { public static class Template implements ToXContent { final TextTemplate body; - final @Nullable TextTemplate[] rooms; - final @Nullable TextTemplate[] users; - final @Nullable String from; - final @Nullable Format format; - final @Nullable + @Nullable final TextTemplate[] rooms; + @Nullable final TextTemplate[] users; + @Nullable final String from; + @Nullable final Format format; + @Nullable final TextTemplate color; - final @Nullable Boolean notify; + @Nullable final Boolean notify; public Template(TextTemplate body, TextTemplate[] rooms, diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/IntegrationAccount.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/IntegrationAccount.java index ba40060fc4f..9aa77fae308 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/IntegrationAccount.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/IntegrationAccount.java @@ -129,9 +129,9 @@ public class IntegrationAccount extends HipChatAccount { static class Defaults { - final @Nullable Format format; - final @Nullable Color color; - final @Nullable Boolean notify; + @Nullable final Format format; + @Nullable final Color color; + @Nullable final Boolean notify; public Defaults(Settings settings) { this.format = Format.resolve(settings, DEFAULT_FORMAT_SETTING, null); diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/SentMessages.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/SentMessages.java index 22a4f540d26..44aff7169a2 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/SentMessages.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/SentMessages.java @@ -70,9 +70,9 @@ public class SentMessages implements ToXContent, Iterable implements MetaData.Custom { - public final static String TYPE = "watcher"; - public final static WatcherMetaData PROTO = new WatcherMetaData(false); + public static final String TYPE = "watcher"; + public static final WatcherMetaData PROTO = new WatcherMetaData(false); private final boolean manuallyStopped; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionStatus.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionStatus.java index 1e6bc061dce..2ac481a518e 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionStatus.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionStatus.java @@ -30,9 +30,9 @@ import static org.elasticsearch.xpack.watcher.support.WatcherDateTimeUtils.dateT public class ActionStatus implements ToXContent { private AckStatus ackStatus; - private @Nullable Execution lastExecution; - private @Nullable Execution lastSuccessfulExecution; - private @Nullable Throttle lastThrottle; + @Nullable private Execution lastExecution; + @Nullable private Execution lastSuccessfulExecution; + @Nullable private Throttle lastThrottle; public ActionStatus(DateTime now) { this(new AckStatus(now, AckStatus.State.AWAITS_SUCCESSFUL_EXECUTION), null, null, null); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionWrapper.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionWrapper.java index a2ff6376685..8e71fab6e60 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionWrapper.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/ActionWrapper.java @@ -33,7 +33,7 @@ import java.io.IOException; public class ActionWrapper implements ToXContent { private String id; - private final @Nullable ExecutableTransform transform; + @Nullable private final ExecutableTransform transform; private final ActionThrottler throttler; private final ExecutableAction action; @@ -185,7 +185,7 @@ public class ActionWrapper implements ToXContent { public static class Result implements ToXContent { private final String id; - private final @Nullable Transform.Result transform; + @Nullable private final Transform.Result transform; private final Action.Result action; public Result(String id, Action.Result action) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailAction.java index 07130737b02..50daa3db895 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/email/EmailAction.java @@ -35,11 +35,11 @@ public class EmailAction implements Action { public static final String TYPE = "email"; private final EmailTemplate email; - private final @Nullable String account; - private final @Nullable Authentication auth; - private final @Nullable Profile profile; - private final @Nullable DataAttachment dataAttachment; - private final @Nullable EmailAttachments emailAttachments; + @Nullable private final String account; + @Nullable private final Authentication auth; + @Nullable private final Profile profile; + @Nullable private final DataAttachment dataAttachment; + @Nullable private final EmailAttachments emailAttachments; public EmailAction(EmailTemplate email, @Nullable String account, @Nullable Authentication auth, @Nullable Profile profile, @Nullable DataAttachment dataAttachment, @Nullable EmailAttachments emailAttachments) { @@ -186,7 +186,7 @@ public class EmailAction implements Action { return new Builder(email); } - public static abstract class Result extends Action.Result { + public abstract static class Result extends Action.Result { protected Result(Status status) { super(TYPE, status); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/hipchat/HipChatAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/hipchat/HipChatAction.java index 929218e78c4..bd8364e820a 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/hipchat/HipChatAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/hipchat/HipChatAction.java @@ -26,7 +26,7 @@ public class HipChatAction implements Action { public static final String TYPE = "hipchat"; - final @Nullable String account; + @Nullable final String account; final HipChatMessage.Template message; public HipChatAction(@Nullable String account, HipChatMessage.Template message) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java index df402b63c6e..1bf8469012c 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/index/IndexAction.java @@ -28,9 +28,9 @@ public class IndexAction implements Action { final String index; final String docType; - final @Nullable String executionTimeField; - final @Nullable TimeValue timeout; - final @Nullable DateTimeZone dynamicNameTimeZone; + @Nullable final String executionTimeField; + @Nullable final TimeValue timeout; + @Nullable final DateTimeZone dynamicNameTimeZone; public IndexAction(String index, String docType, @Nullable String executionTimeField, @Nullable TimeValue timeout, @Nullable DateTimeZone dynamicNameTimeZone) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingAction.java index bd637cda2af..496dc6c6804 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/logging/LoggingAction.java @@ -25,8 +25,8 @@ public class LoggingAction implements Action { public static final String TYPE = "logging"; final TextTemplate text; - final @Nullable LoggingLevel level; - final @Nullable String category; + @Nullable final LoggingLevel level; + @Nullable final String category; public LoggingAction(TextTemplate text, @Nullable LoggingLevel level, @Nullable String category) { this.text = text; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackAction.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackAction.java index 46ce78d6cd3..321662e5105 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackAction.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/slack/SlackAction.java @@ -25,9 +25,8 @@ public class SlackAction implements Action { public static final String TYPE = "slack"; - final - @Nullable - String account; + @Nullable final String account; + final SlackMessage.Template message; public SlackAction(@Nullable String account, SlackMessage.Template message) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/throttler/PeriodThrottler.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/throttler/PeriodThrottler.java index 43d1e53fe66..356ce8a7e31 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/throttler/PeriodThrottler.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/actions/throttler/PeriodThrottler.java @@ -18,7 +18,7 @@ import org.joda.time.PeriodType; */ public class PeriodThrottler implements Throttler { - private final @Nullable TimeValue period; + @Nullable private final TimeValue period; private final PeriodType periodType; private final Clock clock; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java index f2e7758383e..a8fb325e675 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/client/WatchSourceBuilder.java @@ -172,8 +172,8 @@ public class WatchSourceBuilder implements ToXContent { private final String id; private final Action action; - private final @Nullable TimeValue throttlePeriod; - private final @Nullable Transform transform; + @Nullable private final TimeValue throttlePeriod; + @Nullable private final Transform transform; public TransformedAction(String id, Action action, @Nullable TimeValue throttlePeriod, @Nullable Transform transform) { this.id = id; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/CompareCondition.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/CompareCondition.java index 191b10adcfb..82f5a75942e 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/CompareCondition.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/CompareCondition.java @@ -131,7 +131,7 @@ public class CompareCondition implements Condition { public static class Result extends Condition.Result { - private final @Nullable Map resolveValues; + @Nullable private final Map resolveValues; Result(Map resolveValues, boolean met) { super(TYPE, met); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/array/ArrayCompareCondition.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/array/ArrayCompareCondition.java index 271618bca23..3216776e676 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/array/ArrayCompareCondition.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/compare/array/ArrayCompareCondition.java @@ -202,7 +202,7 @@ public class ArrayCompareCondition implements Condition { } public static class Result extends Condition.Result { - private final @Nullable Map resolvedValues; + @Nullable private final Map resolvedValues; Result(Map resolvedValues, boolean met) { super(TYPE, met); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java index c885773f0d6..219f7941586 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/ExecutionService.java @@ -412,7 +412,7 @@ public class ExecutionService extends AbstractComponent { logger.debug("executed [{}] watches from the watch history", counter); } - private final static class StartupExecutionContext extends TriggeredExecutionContext { + private static final class StartupExecutionContext extends TriggeredExecutionContext { public StartupExecutionContext(Watch watch, DateTime executionTime, TriggerEvent triggerEvent, TimeValue defaultThrottlePeriod) { super(watch, executionTime, triggerEvent, defaultThrottlePeriod); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionResult.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionResult.java index dc1abe0a297..8e5f4f0783b 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionResult.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/execution/WatchExecutionResult.java @@ -25,9 +25,9 @@ public class WatchExecutionResult implements ToXContent { private final DateTime executionTime; private final long executionDurationMs; - private final @Nullable Input.Result inputResult; - private final @Nullable Condition.Result conditionResult; - private final @Nullable Transform.Result transformResult; + @Nullable private final Input.Result inputResult; + @Nullable private final Condition.Result conditionResult; + @Nullable private final Transform.Result transformResult; private final ExecutableActions.Results actionsResults; public WatchExecutionResult(WatchExecutionContext context, long executionDurationMs) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/WatchRecord.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/WatchRecord.java index bf8bdd57e57..6589e30eba6 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/WatchRecord.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/history/WatchRecord.java @@ -33,12 +33,12 @@ public class WatchRecord implements ToXContent { // only emitted to xcontent in "debug" mode private final Map vars; - private final @Nullable ExecutableInput input; - private final @Nullable Condition condition; - private final @Nullable Map metadata; + @Nullable private final ExecutableInput input; + @Nullable private final Condition condition; + @Nullable private final Map metadata; - private final @Nullable String[] messages; - private final @Nullable WatchExecutionResult executionResult; + @Nullable private final String[] messages; + @Nullable private final WatchExecutionResult executionResult; /** * Called when the execution was aborted before it started diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInput.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInput.java index 646cb76d934..1b53ca5b690 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInput.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/http/HttpInput.java @@ -33,8 +33,8 @@ public class HttpInput implements Input { public static final String TYPE = "http"; private final HttpRequestTemplate request; - private final @Nullable HttpContentType expectedResponseXContentType; - private final @Nullable Set extractKeys; + @Nullable private final HttpContentType expectedResponseXContentType; + @Nullable private final Set extractKeys; public HttpInput(HttpRequestTemplate request, @Nullable HttpContentType expectedResponseXContentType, @Nullable Set extractKeys) { @@ -142,7 +142,7 @@ public class HttpInput implements Input { public static class Result extends Input.Result { - private final @Nullable HttpRequest request; + @Nullable private final HttpRequest request; private final int statusCode; public Result(HttpRequest request, int statusCode, Payload payload) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/ExecutableSearchInput.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/ExecutableSearchInput.java index 64335419329..554ecb1b3dd 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/ExecutableSearchInput.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/input/search/ExecutableSearchInput.java @@ -35,7 +35,7 @@ public class ExecutableSearchInput extends ExecutableInput extractKeys; - private final @Nullable TimeValue timeout; - private final @Nullable DateTimeZone dynamicNameTimeZone; + @Nullable private final Set extractKeys; + @Nullable private final TimeValue timeout; + @Nullable private final DateTimeZone dynamicNameTimeZone; public SearchInput(WatcherSearchTemplateRequest request, @Nullable Set extractKeys, @Nullable TimeValue timeout, @Nullable DateTimeZone dynamicNameTimeZone) { @@ -176,7 +176,7 @@ public class SearchInput implements Input { public static class Result extends Input.Result { - private final @Nullable SearchRequest request; + @Nullable private final SearchRequest request; public Result(SearchRequest request, Payload payload) { super(TYPE, payload); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Script.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Script.java index bf907ea3677..4a9f8da03ec 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Script.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/Script.java @@ -27,9 +27,9 @@ public class Script implements ToXContent { public static final String DEFAULT_LANG = ScriptSettings.DEFAULT_LANG; private final String script; - private final @Nullable ScriptType type; - private final @Nullable String lang; - private final @Nullable Map params; + @Nullable private final ScriptType type; + @Nullable private final String lang; + @Nullable private final Map params; Script(String script) { this(script, null, null, null); @@ -189,7 +189,7 @@ public class Script implements ToXContent { return new Builder.DefaultType(text); } - public static abstract class Builder { + public abstract static class Builder { protected final ScriptType type; protected final String script; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/concurrent/FairKeyedLock.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/concurrent/FairKeyedLock.java index d1d30134c0e..a661f8d59f7 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/concurrent/FairKeyedLock.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/concurrent/FairKeyedLock.java @@ -102,7 +102,7 @@ public class FairKeyedLock { @SuppressWarnings("serial") - private final static class KeyLock extends ReentrantLock { + private static final class KeyLock extends ReentrantLock { private final AtomicInteger count = new AtomicInteger(1); public KeyLock(boolean fair) { @@ -118,7 +118,7 @@ public class FairKeyedLock { * A {@link FairKeyedLock} that allows to acquire a global lock that guarantees * exclusive access to the resource the KeyedLock is guarding. */ - public final static class GlobalLockable extends FairKeyedLock { + public static final class GlobalLockable extends FairKeyedLock { private final ReadWriteLock lock = new ReentrantReadWriteLock(true); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java index adc101d94e3..cdccd47c635 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/search/WatcherSearchTemplateRequest.java @@ -36,7 +36,7 @@ import java.util.Objects; public class WatcherSearchTemplateRequest implements ToXContent { private final SearchRequest request; - private final @Nullable Script template; + @Nullable private final Script template; public WatcherSearchTemplateRequest(SearchRequest searchRequest, @Nullable Script template) { this.request = Objects.requireNonNull(searchRequest); @@ -250,5 +250,5 @@ public class WatcherSearchTemplateRequest implements ToXContent { static final ParseField ALLOW_NO_INDICES_FIELD = new ParseField("allow_no_indices"); static final ParseField TEMPLATE_FIELD = new ParseField("template"); - public final static IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.lenientExpandOpen(); + public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.lenientExpandOpen(); } diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/xcontent/WatcherXContentParser.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/xcontent/WatcherXContentParser.java index 549357091e5..67afaf36634 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/xcontent/WatcherXContentParser.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/support/xcontent/WatcherXContentParser.java @@ -67,7 +67,7 @@ public class WatcherXContentParser implements XContentParser { private final Clock clock; private final XContentParser parser; - private final @Nullable SecretService secretService; + @Nullable private final SecretService secretService; public WatcherXContentParser(XContentParser parser, Clock clock, @Nullable SecretService secretService) { this.clock = clock; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/Transform.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/Transform.java index 0729dd6fe8c..4cd1442fc8d 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/Transform.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/Transform.java @@ -30,8 +30,8 @@ public interface Transform extends ToXContent { protected final String type; protected final Status status; - protected final @Nullable Payload payload; - protected final @Nullable String reason; + @Nullable protected final Payload payload; + @Nullable protected final String reason; public Result(String type, Payload payload) { this.type = type; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/ExecutableSearchTransform.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/ExecutableSearchTransform.java index 31b8d650ab3..c3d9112c1ef 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/ExecutableSearchTransform.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/search/ExecutableSearchTransform.java @@ -26,7 +26,7 @@ public class ExecutableSearchTransform extends ExecutableTransform triggerData = null; - private @Nullable Map alternativeInput = null; + @Nullable private Map triggerData = null; + @Nullable private Map alternativeInput = null; private Map actionModes = new HashMap<>(); private BytesReference watchSource; diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/Watch.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/Watch.java index 2da2cb98143..dc2e02d661a 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/Watch.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/Watch.java @@ -64,10 +64,10 @@ public class Watch implements TriggerEngine.Job, ToXContent { private final Trigger trigger; private final ExecutableInput input; private final ExecutableCondition condition; - private final @Nullable ExecutableTransform transform; + @Nullable private final ExecutableTransform transform; private final ExecutableActions actions; - private final @Nullable TimeValue throttlePeriod; - private final @Nullable Map metadata; + @Nullable private final TimeValue throttlePeriod; + @Nullable private final Map metadata; private final WatchStatus status; private final transient AtomicLong nonceCounter = new AtomicLong(); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java index 8fb570b4290..716356948e3 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/xpack/watcher/watch/WatchStatus.java @@ -47,8 +47,8 @@ public class WatchStatus implements ToXContent, Streamable { private State state; - private @Nullable DateTime lastChecked; - private @Nullable DateTime lastMetCondition; + @Nullable private DateTime lastChecked; + @Nullable private DateTime lastMetCondition; private Map actions; private volatile boolean dirty = false; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java index 3a55eb2205c..e40b45629ee 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherExecutorServiceBenchmark.java @@ -42,7 +42,7 @@ import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interva */ public class WatcherExecutorServiceBenchmark { - private final static Settings SETTINGS = Settings.builder() + private static final Settings SETTINGS = Settings.builder() .put("xpack.security.enabled", false) .put("cluster.name", "bench") .put("network.host", "localhost") diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java index 4c272b34dd9..67466b83212 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/xpack/watcher/test/bench/WatcherScheduleEngineBenchmark.java @@ -57,7 +57,7 @@ import static org.elasticsearch.xpack.watcher.trigger.schedule.Schedules.interva @SuppressForbidden(reason = "benchmark") public class WatcherScheduleEngineBenchmark { - private final static Settings SETTINGS = Settings.builder() + private static final Settings SETTINGS = Settings.builder() .put("xpack.security.enabled", false) .put("cluster.name", "bench") .put("script.disable_dynamic", false)