diff --git a/core/src/main/java/org/elasticsearch/common/settings/loader/PropertiesSettingsLoader.java b/core/src/main/java/org/elasticsearch/common/settings/loader/PropertiesSettingsLoader.java index 6d3e87d03fa..6ee1f58cf4b 100644 --- a/core/src/main/java/org/elasticsearch/common/settings/loader/PropertiesSettingsLoader.java +++ b/core/src/main/java/org/elasticsearch/common/settings/loader/PropertiesSettingsLoader.java @@ -73,7 +73,7 @@ public class PropertiesSettingsLoader implements SettingsLoader { class NoDuplicatesProperties extends Properties { @Override public synchronized Object put(Object key, Object value) { - Object previousValue = super.put(key, value); + final Object previousValue = super.put(key, value); if (previousValue != null) { throw new ElasticsearchParseException( "duplicate settings key [{}] found, previous value [{}], current value [{}]", diff --git a/core/src/test/java/org/elasticsearch/common/settings/loader/JsonSettingsLoaderTests.java b/core/src/test/java/org/elasticsearch/common/settings/loader/JsonSettingsLoaderTests.java index fadbd2bee46..154ef8ee039 100644 --- a/core/src/test/java/org/elasticsearch/common/settings/loader/JsonSettingsLoaderTests.java +++ b/core/src/test/java/org/elasticsearch/common/settings/loader/JsonSettingsLoaderTests.java @@ -31,8 +31,8 @@ import static org.hamcrest.Matchers.equalTo; public class JsonSettingsLoaderTests extends ESTestCase { public void testSimpleJsonSettings() throws Exception { - String json = "/org/elasticsearch/common/settings/loader/test-settings.json"; - Settings settings = settingsBuilder() + final String json = "/org/elasticsearch/common/settings/loader/test-settings.json"; + final Settings settings = settingsBuilder() .loadFromStream(json, getClass().getResourceAsStream(json)) .build(); diff --git a/core/src/test/java/org/elasticsearch/common/settings/loader/PropertiesSettingsLoaderTests.java b/core/src/test/java/org/elasticsearch/common/settings/loader/PropertiesSettingsLoaderTests.java index ab96f763a88..c13ae7cc68b 100644 --- a/core/src/test/java/org/elasticsearch/common/settings/loader/PropertiesSettingsLoaderTests.java +++ b/core/src/test/java/org/elasticsearch/common/settings/loader/PropertiesSettingsLoaderTests.java @@ -50,7 +50,7 @@ public class PropertiesSettingsLoaderTests extends ESTestCase { } public void testThatNoDuplicatesPropertiesDoesNotAcceptNullValues() { - PropertiesSettingsLoader.NoDuplicatesProperties properties = loader.new NoDuplicatesProperties(); + final PropertiesSettingsLoader.NoDuplicatesProperties properties = loader.new NoDuplicatesProperties(); expectThrows(NullPointerException.class, () -> properties.put("key", null)); } diff --git a/core/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java b/core/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java index 62350f55023..2e2a187da0b 100644 --- a/core/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java +++ b/core/src/test/java/org/elasticsearch/common/settings/loader/YamlSettingsLoaderTests.java @@ -31,8 +31,8 @@ import static org.hamcrest.Matchers.equalTo; public class YamlSettingsLoaderTests extends ESTestCase { public void testSimpleYamlSettings() throws Exception { - String yaml = "/org/elasticsearch/common/settings/loader/test-settings.yml"; - Settings settings = settingsBuilder() + final String yaml = "/org/elasticsearch/common/settings/loader/test-settings.yml"; + final Settings settings = settingsBuilder() .loadFromStream(yaml, getClass().getResourceAsStream(yaml)) .build();