From 1df4efccd5bad6da9198dacbdd03cf0996c709c0 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 27 Apr 2016 17:48:56 -0400 Subject: [PATCH] Wrap settings at 140 columns and remove the checkstyle suppressions. --- .../resources/checkstyle_suppressions.xml | 10 ------ .../settings/AbstractScopedSettings.java | 34 +++++++++++++------ .../common/settings/IndexScopedSettings.java | 8 +++-- .../common/settings/Setting.java | 29 +++++++++------- .../common/settings/Settings.java | 14 ++++---- .../loader/XContentSettingsLoader.java | 24 ++++++------- .../common/settings/ScopedSettingsTests.java | 9 +++-- .../common/settings/SettingTests.java | 16 +++++---- .../common/settings/SettingsModuleTests.java | 7 ++-- 9 files changed, 87 insertions(+), 64 deletions(-) diff --git a/buildSrc/src/main/resources/checkstyle_suppressions.xml b/buildSrc/src/main/resources/checkstyle_suppressions.xml index ecd95b27ae3..152405fcffc 100644 --- a/buildSrc/src/main/resources/checkstyle_suppressions.xml +++ b/buildSrc/src/main/resources/checkstyle_suppressions.xml @@ -344,12 +344,6 @@ - - - - - - @@ -943,8 +937,6 @@ - - @@ -1462,12 +1454,10 @@ - - diff --git a/core/src/main/java/org/elasticsearch/common/settings/AbstractScopedSettings.java b/core/src/main/java/org/elasticsearch/common/settings/AbstractScopedSettings.java index 00dd235aee9..0170c4218a2 100644 --- a/core/src/main/java/org/elasticsearch/common/settings/AbstractScopedSettings.java +++ b/core/src/main/java/org/elasticsearch/common/settings/AbstractScopedSettings.java @@ -391,10 +391,13 @@ public abstract class AbstractScopedSettings extends AbstractComponent { /** * Updates a target settings builder with new, updated or deleted settings from a given settings builder. *

- * Note: This method will only allow updates to dynamic settings. if a non-dynamic setting is updated an {@link IllegalArgumentException} is thrown instead. - *

+ * Note: This method will only allow updates to dynamic settings. if a non-dynamic setting is updated an + * {@link IllegalArgumentException} is thrown instead. + *

+ * * @param toApply the new settings to apply - * @param target the target settings builder that the updates are applied to. All keys that have explicit null value in toApply will be removed from this builder + * @param target the target settings builder that the updates are applied to. All keys that have explicit null value in toApply will be + * removed from this builder * @param updates a settings builder that holds all updates applied to target * @param type a free text string to allow better exceptions messages * @return true if the target has changed otherwise false @@ -405,8 +408,10 @@ public abstract class AbstractScopedSettings extends AbstractComponent { /** * Updates a target settings builder with new, updated or deleted settings from a given settings builder. + * * @param toApply the new settings to apply - * @param target the target settings builder that the updates are applied to. All keys that have explicit null value in toApply will be removed from this builder + * @param target the target settings builder that the updates are applied to. All keys that have explicit null value in toApply will be + * removed from this builder * @param updates a settings builder that holds all updates applied to target * @param type a free text string to allow better exceptions messages * @return true if the target has changed otherwise false @@ -417,11 +422,14 @@ public abstract class AbstractScopedSettings extends AbstractComponent { /** * Updates a target settings builder with new, updated or deleted settings from a given settings builder. + * * @param toApply the new settings to apply - * @param target the target settings builder that the updates are applied to. All keys that have explicit null value in toApply will be removed from this builder + * @param target the target settings builder that the updates are applied to. All keys that have explicit null value in toApply will be + * removed from this builder * @param updates a settings builder that holds all updates applied to target * @param type a free text string to allow better exceptions messages - * @param onlyDynamic if false all settings are updated otherwise only dynamic settings are updated. if set to true and a non-dynamic setting is updated an exception is thrown. + * @param onlyDynamic if false all settings are updated otherwise only dynamic settings are updated. if set to + * true and a non-dynamic setting is updated an exception is thrown. * @return true if the target has changed otherwise false */ private boolean updateSettings(Settings toApply, Settings.Builder target, Settings.Builder updates, String type, boolean onlyDynamic) { @@ -500,16 +508,22 @@ public abstract class AbstractScopedSettings extends AbstractComponent { } else { changed = true; logger.warn("found unknown setting: {} value: {} - archiving", entry.getKey(), entry.getValue()); - // we put them back in here such that tools can check from the outside if there are any indices with broken settings. The setting can remain there - // but we want users to be aware that some of their setting are broken and they can research why and what they need to do to replace them. + /* + * We put them back in here such that tools can check from the outside if there are any indices with broken + * settings. The setting can remain there but we want users to be aware that some of their setting are broken and + * they can research why and what they need to do to replace them. + */ builder.put(ARCHIVED_SETTINGS_PREFIX + entry.getKey(), entry.getValue()); } } } catch (IllegalArgumentException ex) { changed = true; logger.warn("found invalid setting: {} value: {} - archiving",ex , entry.getKey(), entry.getValue()); - // we put them back in here such that tools can check from the outside if there are any indices with broken settings. The setting can remain there - // but we want users to be aware that some of their setting sare broken and they can research why and what they need to do to replace them. + /* + * We put them back in here such that tools can check from the outside if there are any indices with broken settings. The + * setting can remain there but we want users to be aware that some of their setting are broken and they can research why + * and what they need to do to replace them. + */ builder.put(ARCHIVED_SETTINGS_PREFIX + entry.getKey(), entry.getValue()); } } diff --git a/core/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java b/core/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java index fabda1b62bb..1b795239457 100644 --- a/core/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java +++ b/core/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java @@ -58,7 +58,7 @@ public final class IndexScopedSettings extends AbstractScopedSettings { public static final Predicate INDEX_SETTINGS_KEY_PREDICATE = (s) -> s.startsWith(IndexMetaData.INDEX_SETTING_PREFIX); - public static Set> BUILT_IN_INDEX_SETTINGS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( + public static final Set> BUILT_IN_INDEX_SETTINGS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList( IndexSettings.INDEX_TTL_DISABLE_PURGE_SETTING, IndexStore.INDEX_STORE_THROTTLE_TYPE_SETTING, IndexStore.INDEX_STORE_THROTTLE_MAX_BYTES_PER_SEC_SETTING, @@ -143,7 +143,8 @@ public final class IndexScopedSettings extends AbstractScopedSettings { Map groups = s.getAsGroups(); for (String key : SimilarityService.BUILT_IN.keySet()) { if (groups.containsKey(key)) { - throw new IllegalArgumentException("illegal value for [index.similarity."+ key + "] cannot redefine built-in similarity"); + throw new IllegalArgumentException("illegal value for [index.similarity." + key + + "] cannot redefine built-in similarity"); } } }, Property.IndexScope), // this allows similarity settings to be passed @@ -151,7 +152,8 @@ public final class IndexScopedSettings extends AbstractScopedSettings { ))); - public static final IndexScopedSettings DEFAULT_SCOPED_SETTINGS = new IndexScopedSettings(Settings.EMPTY, IndexScopedSettings.BUILT_IN_INDEX_SETTINGS); + public static final IndexScopedSettings DEFAULT_SCOPED_SETTINGS = new IndexScopedSettings(Settings.EMPTY, + BUILT_IN_INDEX_SETTINGS); public IndexScopedSettings(Settings settings, Set> settingsSet) { super(settings, settingsSet, Property.IndexScope); diff --git a/core/src/main/java/org/elasticsearch/common/settings/Setting.java b/core/src/main/java/org/elasticsearch/common/settings/Setting.java index 52ff7475c88..ed113b0d51b 100644 --- a/core/src/main/java/org/elasticsearch/common/settings/Setting.java +++ b/core/src/main/java/org/elasticsearch/common/settings/Setting.java @@ -248,9 +248,9 @@ public class Setting extends ToXContentToBytes { } /** - * Returns true iff this setting is a group setting. Group settings represent a set of settings - * rather than a single value. The key, see {@link #getKey()}, in contrast to non-group settings is a prefix like cluster.store. - * that matches all settings with this prefix. + * Returns true iff this setting is a group setting. Group settings represent a set of settings rather than a single value. + * The key, see {@link #getKey()}, in contrast to non-group settings is a prefix like cluster.store. that matches all settings + * with this prefix. */ boolean isGroupSetting() { return false; @@ -356,7 +356,8 @@ public class Setting extends ToXContentToBytes { } public Setting getConcreteSetting(String key) { - assert key.startsWith(this.getKey()) : "was " + key + " expected: " + getKey(); // we use startsWith here since the key might be foo.bar.0 if it's an array + // we use startsWith here since the key might be foo.bar.0 if it's an array + assert key.startsWith(this.getKey()) : "was " + key + " expected: " + getKey(); return this; } @@ -380,10 +381,11 @@ public class Setting extends ToXContentToBytes { } /** - * this is used for settings that depend on each other... see {@link org.elasticsearch.common.settings.AbstractScopedSettings#addSettingsUpdateConsumer(Setting, Setting, BiConsumer)} and it's - * usage for details. + * Updates settings that depend on eachother. See {@link AbstractScopedSettings#addSettingsUpdateConsumer(Setting, Setting, BiConsumer)} + * and its usage for details. */ - static AbstractScopedSettings.SettingUpdater> compoundUpdater(final BiConsumer consumer, final Setting aSetting, final Setting bSetting, ESLogger logger) { + static AbstractScopedSettings.SettingUpdater> compoundUpdater(final BiConsumer consumer, + final Setting aSetting, final Setting bSetting, ESLogger logger) { final AbstractScopedSettings.SettingUpdater aSettingUpdater = aSetting.newUpdater(null, logger); final AbstractScopedSettings.SettingUpdater bSettingUpdater = bSetting.newUpdater(null, logger); return new AbstractScopedSettings.SettingUpdater>() { @@ -444,7 +446,8 @@ public class Setting extends ToXContentToBytes { try { accept.accept(inst); } catch (Exception | AssertionError e) { - throw new IllegalArgumentException("illegal value can't update [" + key + "] from [" + value + "] to [" + newValue + "]", e); + throw new IllegalArgumentException("illegal value can't update [" + key + "] from [" + value + "] to [" + newValue + "]", + e); } return inst; } @@ -552,8 +555,8 @@ public class Setting extends ToXContentToBytes { return new Setting<>(key, defaultValue, (s) -> ByteSizeValue.parseBytesSizeValue(s, key), properties); } - public static Setting byteSizeSetting(String key, ByteSizeValue defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, - Property... properties) { + public static Setting byteSizeSetting(String key, ByteSizeValue defaultValue, ByteSizeValue minValue, + ByteSizeValue maxValue, Property... properties) { return byteSizeSetting(key, (s) -> defaultValue.toString(), minValue, maxValue, properties); } @@ -685,7 +688,8 @@ public class Setting extends ToXContentToBytes { } @Override - public AbstractScopedSettings.SettingUpdater newUpdater(Consumer consumer, ESLogger logger, Consumer validator) { + public AbstractScopedSettings.SettingUpdater newUpdater(Consumer consumer, ESLogger logger, + Consumer validator) { if (isDynamic() == false) { throw new IllegalStateException("setting [" + getKey() + "] is not dynamic"); } @@ -706,7 +710,8 @@ public class Setting extends ToXContentToBytes { try { validator.accept(currentSettings); } catch (Exception | AssertionError e) { - throw new IllegalArgumentException("illegal value can't update [" + key + "] from [" + previousSettings.getAsMap() + "] to [" + currentSettings.getAsMap() + "]", e); + throw new IllegalArgumentException("illegal value can't update [" + key + "] from [" + + previousSettings.getAsMap() + "] to [" + currentSettings.getAsMap() + "]", e); } return currentSettings; } diff --git a/core/src/main/java/org/elasticsearch/common/settings/Settings.java b/core/src/main/java/org/elasticsearch/common/settings/Settings.java index 94735ce4952..1c243255454 100644 --- a/core/src/main/java/org/elasticsearch/common/settings/Settings.java +++ b/core/src/main/java/org/elasticsearch/common/settings/Settings.java @@ -62,8 +62,6 @@ import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static java.util.Collections.emptyMap; -import static java.util.Collections.unmodifiableMap; import static org.elasticsearch.common.unit.ByteSizeValue.parseBytesSizeValue; import static org.elasticsearch.common.unit.SizeValue.parseSizeValue; import static org.elasticsearch.common.unit.TimeValue.parseTimeValue; @@ -456,7 +454,8 @@ public final class Settings implements ToXContent { if (ignoreNonGrouped) { continue; } - throw new SettingsException("Failed to get setting group for [" + settingPrefix + "] setting prefix and setting [" + setting + "] because of a missing '.'"); + throw new SettingsException("Failed to get setting group for [" + settingPrefix + "] setting prefix and setting [" + + setting + "] because of a missing '.'"); } String name = nameValue.substring(0, dotIndex); String value = nameValue.substring(dotIndex + 1); @@ -638,7 +637,8 @@ public final class Settings implements ToXContent { } } if ((settings.length % 2) != 0) { - throw new IllegalArgumentException("array settings of key + value order doesn't hold correct number of arguments (" + settings.length + ")"); + throw new IllegalArgumentException( + "array settings of key + value order doesn't hold correct number of arguments (" + settings.length + ")"); } for (int i = 0; i < settings.length; i++) { put(settings[i++].toString(), settings[i].toString()); @@ -904,7 +904,8 @@ public final class Settings implements ToXContent { for (String s : values) { int index = s.indexOf('='); if (index == -1) { - throw new IllegalArgumentException("value [" + s + "] for settings loaded with delimiter [" + delimiter + "] is malformed, missing ="); + throw new IllegalArgumentException( + "value [" + s + "] for settings loaded with delimiter [" + delimiter + "] is malformed, missing ="); } map.put(s.substring(0, index), s.substring(index + 1)); } @@ -945,7 +946,8 @@ public final class Settings implements ToXContent { public Builder loadFromStream(String resourceName, InputStream is) throws SettingsException { SettingsLoader settingsLoader = SettingsLoaderFactory.loaderFromResource(resourceName); try { - Map loadedSettings = settingsLoader.load(Streams.copyToString(new InputStreamReader(is, StandardCharsets.UTF_8))); + Map loadedSettings = settingsLoader + .load(Streams.copyToString(new InputStreamReader(is, StandardCharsets.UTF_8))); put(loadedSettings); } catch (Exception e) { throw new SettingsException("Failed to load settings from [" + resourceName + "]", e); diff --git a/core/src/main/java/org/elasticsearch/common/settings/loader/XContentSettingsLoader.java b/core/src/main/java/org/elasticsearch/common/settings/loader/XContentSettingsLoader.java index 3875c1ef85a..30c62b91c79 100644 --- a/core/src/main/java/org/elasticsearch/common/settings/loader/XContentSettingsLoader.java +++ b/core/src/main/java/org/elasticsearch/common/settings/loader/XContentSettingsLoader.java @@ -77,24 +77,22 @@ public abstract class XContentSettingsLoader implements SettingsLoader { while (!jp.isClosed() && (lastToken = jp.nextToken()) == null); } catch (Exception e) { throw new ElasticsearchParseException( - "malformed, expected end of settings but encountered additional content starting at line number: [{}], column number: [{}]", - e, - jp.getTokenLocation().lineNumber, - jp.getTokenLocation().columnNumber - ); + "malformed, expected end of settings but encountered additional content starting at line number: [{}], " + + "column number: [{}]", + e, jp.getTokenLocation().lineNumber, jp.getTokenLocation().columnNumber); } if (lastToken != null) { throw new ElasticsearchParseException( - "malformed, expected end of settings but encountered additional content starting at line number: [{}], column number: [{}]", - jp.getTokenLocation().lineNumber, - jp.getTokenLocation().columnNumber - ); + "malformed, expected end of settings but encountered additional content starting at line number: [{}], " + + "column number: [{}]", + jp.getTokenLocation().lineNumber, jp.getTokenLocation().columnNumber); } return settings; } - private void serializeObject(Map settings, StringBuilder sb, List path, XContentParser parser, String objFieldName) throws IOException { + private void serializeObject(Map settings, StringBuilder sb, List path, XContentParser parser, + String objFieldName) throws IOException { if (objFieldName != null) { path.add(objFieldName); } @@ -121,7 +119,8 @@ public abstract class XContentSettingsLoader implements SettingsLoader { } } - private void serializeArray(Map settings, StringBuilder sb, List path, XContentParser parser, String fieldName) throws IOException { + private void serializeArray(Map settings, StringBuilder sb, List path, XContentParser parser, String fieldName) + throws IOException { XContentParser.Token token; int counter = 0; while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) { @@ -140,7 +139,8 @@ public abstract class XContentSettingsLoader implements SettingsLoader { } } - private void serializeValue(Map settings, StringBuilder sb, List path, XContentParser parser, String fieldName, boolean isNull) throws IOException { + private void serializeValue(Map settings, StringBuilder sb, List path, XContentParser parser, String fieldName, + boolean isNull) throws IOException { sb.setLength(0); for (String pathEle : path) { sb.append(pathEle).append('.'); diff --git a/core/src/test/java/org/elasticsearch/common/settings/ScopedSettingsTests.java b/core/src/test/java/org/elasticsearch/common/settings/ScopedSettingsTests.java index ae5342513ca..aa8614aee71 100644 --- a/core/src/test/java/org/elasticsearch/common/settings/ScopedSettingsTests.java +++ b/core/src/test/java/org/elasticsearch/common/settings/ScopedSettingsTests.java @@ -170,7 +170,8 @@ public class ScopedSettingsTests extends ESTestCase { ClusterSettings settings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); AtomicReference> ref = new AtomicReference<>(); settings.addSettingsUpdateConsumer(TransportService.TRACE_LOG_INCLUDE_SETTING, ref::set); - settings.applySettings(Settings.builder().putArray("transport.tracer.include", "internal:index/shard/recovery/*", "internal:gateway/local*").build()); + settings.applySettings(Settings.builder() + .putArray("transport.tracer.include", "internal:index/shard/recovery/*", "internal:gateway/local*").build()); assertNotNull(ref.get().size()); assertEquals(ref.get().size(), 2); assertTrue(ref.get().contains("internal:index/shard/recovery/*")); @@ -181,7 +182,8 @@ public class ScopedSettingsTests extends ESTestCase { IndexScopedSettings settings = new IndexScopedSettings( Settings.EMPTY, IndexScopedSettings.BUILT_IN_INDEX_SETTINGS); - IndexScopedSettings copy = settings.copy(Settings.builder().put("index.store.type", "boom").build(), newIndexMeta("foo", Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 3).build())); + IndexScopedSettings copy = settings.copy(Settings.builder().put("index.store.type", "boom").build(), + newIndexMeta("foo", Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 3).build())); assertEquals(3, copy.get(IndexMetaData.INDEX_NUMBER_OF_REPLICAS_SETTING).intValue()); assertEquals(1, copy.get(IndexMetaData.INDEX_NUMBER_OF_SHARDS_SETTING).intValue()); assertEquals("boom", copy.get(IndexModule.INDEX_STORE_TYPE_SETTING)); // test fallback to node settings @@ -331,7 +333,8 @@ public class ScopedSettingsTests extends ESTestCase { public void testFallbackToLoggerLevel() { final String level = ESLoggerFactory.getRootLogger().getLevel(); try { - ClusterSettings settings = new ClusterSettings(Settings.builder().put("logger.level", "ERROR").build(), ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); + ClusterSettings settings = new ClusterSettings(Settings.builder().put("logger.level", "ERROR").build(), + ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); assertEquals(level, ESLoggerFactory.getRootLogger().getLevel()); settings.applySettings(Settings.builder().put("logger._root", "TRACE").build()); assertEquals("TRACE", ESLoggerFactory.getRootLogger().getLevel()); diff --git a/core/src/test/java/org/elasticsearch/common/settings/SettingTests.java b/core/src/test/java/org/elasticsearch/common/settings/SettingTests.java index 29c27222ff8..6153f3b7d71 100644 --- a/core/src/test/java/org/elasticsearch/common/settings/SettingTests.java +++ b/core/src/test/java/org/elasticsearch/common/settings/SettingTests.java @@ -35,8 +35,6 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; public class SettingTests extends ESTestCase { - - public void testGet() { Setting booleanSetting = Setting.boolSetting("foo.bar", false, Property.Dynamic, Property.NodeScope); assertFalse(booleanSetting.get(Settings.EMPTY)); @@ -62,7 +60,8 @@ public class SettingTests extends ESTestCase { settingUpdater.apply(Settings.builder().put("a.byte.size", 12).build(), Settings.EMPTY); fail("no unit"); } catch (IllegalArgumentException ex) { - assertEquals("failed to parse setting [a.byte.size] with value [12] as a size in bytes: unit is missing or unrecognized", ex.getMessage()); + assertEquals("failed to parse setting [a.byte.size] with value [12] as a size in bytes: unit is missing or unrecognized", + ex.getMessage()); } assertTrue(settingUpdater.apply(Settings.builder().put("a.byte.size", "12b").build(), Settings.EMPTY)); @@ -86,7 +85,8 @@ public class SettingTests extends ESTestCase { settingUpdater.apply(build, Settings.EMPTY); fail("not a boolean"); } catch (IllegalArgumentException ex) { - assertEquals("Failed to parse value [I am not a boolean] cannot be parsed to boolean [ true/1/on/yes OR false/0/off/no ]", ex.getMessage()); + assertEquals("Failed to parse value [I am not a boolean] cannot be parsed to boolean [ true/1/on/yes OR false/0/off/no ]", + ex.getMessage()); } } @@ -184,7 +184,10 @@ public class SettingTests extends ESTestCase { assertTrue(setting.isGroupSetting()); ClusterSettings.SettingUpdater settingUpdater = setting.newUpdater(ref::set, logger); - Settings currentInput = Settings.builder().put("foo.bar.1.value", "1").put("foo.bar.2.value", "2").put("foo.bar.3.value", "3").build(); + Settings currentInput = Settings.builder() + .put("foo.bar.1.value", "1") + .put("foo.bar.2.value", "2") + .put("foo.bar.3.value", "3").build(); Settings previousInput = Settings.EMPTY; assertTrue(settingUpdater.apply(currentInput, previousInput)); assertNotNull(ref.get()); @@ -228,7 +231,8 @@ public class SettingTests extends ESTestCase { ClusterSettings.SettingUpdater predicateSettingUpdater = setting.newUpdater(ref::set, logger,(s) -> assertFalse(true)); try { - predicateSettingUpdater.apply(Settings.builder().put("foo.bar.1.value", "1").put("foo.bar.2.value", "2").build(), Settings.EMPTY); + predicateSettingUpdater.apply(Settings.builder().put("foo.bar.1.value", "1").put("foo.bar.2.value", "2").build(), + Settings.EMPTY); fail("not accepted"); } catch (IllegalArgumentException ex) { assertEquals(ex.getMessage(), "illegal value can't update [foo.bar.] from [{}] to [{1.value=1, 2.value=2}]"); diff --git a/core/src/test/java/org/elasticsearch/common/settings/SettingsModuleTests.java b/core/src/test/java/org/elasticsearch/common/settings/SettingsModuleTests.java index 7401164a4f6..977d5fa7b09 100644 --- a/core/src/test/java/org/elasticsearch/common/settings/SettingsModuleTests.java +++ b/core/src/test/java/org/elasticsearch/common/settings/SettingsModuleTests.java @@ -101,7 +101,9 @@ public class SettingsModuleTests extends ModuleTestCase { assertInstanceBinding(module, Settings.class, (s) -> s == settings); fail(); } catch (IllegalArgumentException ex) { - assertEquals("tribe.t1 validation failed: Failed to parse value [[2.0]] for setting [cluster.routing.allocation.balance.shard]", ex.getMessage()); + assertEquals( + "tribe.t1 validation failed: Failed to parse value [[2.0]] for setting [cluster.routing.allocation.balance.shard]", + ex.getMessage()); } } } @@ -119,7 +121,8 @@ public class SettingsModuleTests extends ModuleTestCase { assertInstanceBinding(module, Settings.class, (s) -> s == settings); fail(); } catch (IllegalArgumentException ex) { - assertEquals("Failed to parse value [BOOM] cannot be parsed to boolean [ true/1/on/yes OR false/0/off/no ]", ex.getMessage()); + assertEquals("Failed to parse value [BOOM] cannot be parsed to boolean [ true/1/on/yes OR false/0/off/no ]", + ex.getMessage()); } } {