diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBuilder.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBuilder.java index 930d4bc769d..f019402e21c 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBuilder.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBuilder.java @@ -90,8 +90,8 @@ public class DataSourceBuilder { ConfigurationPropertySource source = new MapConfigurationPropertySource( this.properties); ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); - aliases.addAlaises("url", "jdbc-url"); - aliases.addAlaises("username", "user"); + aliases.addAliases("url", "jdbc-url"); + aliases.addAliases("username", "user"); Binder binder = new Binder(source.withAliases(aliases)); binder.bind(ConfigurationPropertyName.EMPTY, Bindable.ofInstance(result)); } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java index 11c9721c7ac..906d3f559b7 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java @@ -124,7 +124,7 @@ public class XADataSourceAutoConfiguration implements BeanClassLoaderAware { source.put("url", this.properties.determineUrl()); source.putAll(dataSourceProperties.getXa().getProperties()); ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); - aliases.addAlaises("user", "username"); + aliases.addAliases("user", "username"); return source.withAliases(aliases); } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationBeanFactoryMetaData.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationBeanFactoryMetaData.java index 536ab0a2a6c..32f0bff7b48 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationBeanFactoryMetaData.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationBeanFactoryMetaData.java @@ -41,7 +41,7 @@ public class ConfigurationBeanFactoryMetaData implements BeanFactoryPostProcesso private ConfigurableListableBeanFactory beanFactory; - private Map beans = new HashMap<>(); + private final Map beans = new HashMap<>(); @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) @@ -96,9 +96,9 @@ public class ConfigurationBeanFactoryMetaData implements BeanFactoryPostProcesso private static class MetaData { - private String bean; + private final String bean; - private String method; + private final String method; MetaData(String bean, String method) { this.bean = bean; diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java index 7d718f7f8e9..8f765be23dd 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java @@ -465,7 +465,7 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc */ private static class ChainingValidator implements Validator { - private Validator[] validators; + private final Validator[] validators; ChainingValidator(Validator... validators) { Assert.notNull(validators, "Validators must not be null"); diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BeanBinder.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BeanBinder.java index c1889f800c5..3f06b8ba11b 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BeanBinder.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BeanBinder.java @@ -29,7 +29,7 @@ interface BeanBinder { /** * Return a bound bean instance or {@code null} if the {@link BeanBinder} does not * support the specified {@link Bindable}. - * @param target the binable to bind + * @param target the bindable to bind * @param hasKnownBindableProperties if this binder has known bindable elements. If * names from underlying {@link ConfigurationPropertySource} cannot be iterated this * method can be {@code false}, even though binding may ultimately succeed. diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindException.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindException.java index ddf5d4ba62a..7f293b3f0bd 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindException.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindException.java @@ -78,7 +78,7 @@ public class BindException extends RuntimeException implements OriginProvider { StringBuilder message = new StringBuilder(); message.append("Failed to bind properties"); message.append(name == null ? "" : " under '" + name + "'"); - message.append(" to " + target.getType()); + message.append(" to ").append(target.getType()); return message.toString(); } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindHandler.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindHandler.java index b564b8eb373..3efd7391b1e 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindHandler.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindHandler.java @@ -29,7 +29,7 @@ import org.springframework.boot.context.properties.source.ConfigurationPropertyN public interface BindHandler { /** - * Default no-op bind hander. + * Default no-op bind handler. */ BindHandler DEFAULT = new BindHandler() { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java index 72754f7bc3f..6182923abb5 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindResult.java @@ -161,7 +161,7 @@ public final class BindResult { if (value == null) { return (BindResult) UNBOUND; } - return new BindResult(value); + return new BindResult<>(value); } } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java index 14ea6408868..884b89db8d8 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java @@ -129,7 +129,7 @@ public final class Bindable { * @return an updated {@link Bindable} */ public Bindable withAnnotations(Annotation... annotations) { - return new Bindable(this.type, this.boxedType, this.value, + return new Bindable<>(this.type, this.boxedType, this.value, (annotations == null ? NO_ANNOTATIONS : annotations)); } @@ -226,7 +226,7 @@ public final class Bindable { Class wrapperType = Array.get(array, 0).getClass(); return ResolvableType.forClass(wrapperType); } - if (resolved.isArray()) { + if (resolved != null && resolved.isArray()) { return ResolvableType.forArrayComponent(box(type.getComponentType())); } return type; diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java index e31dcb840b7..cf338cbafca 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java @@ -287,7 +287,7 @@ public class Binder { } private Object bindBean(ConfigurationPropertyName name, Bindable target, - BindHandler handler, Context context) throws Exception { + BindHandler handler, Context context) { boolean hasKnownBindableProperties = context.streamSources() .flatMap((s) -> s.filter(name::isAncestorOf).stream()).findAny() .isPresent(); diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java index adf03823988..ddd07fe373b 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java @@ -44,12 +44,12 @@ class JavaBeanBinder implements BeanBinder { return null; } BeanSupplier beanSupplier = bean.getSupplier(target); - boolean bound = bind(target, propertyBinder, bean, beanSupplier); + boolean bound = bind(propertyBinder, bean, beanSupplier); return (bound ? beanSupplier.get() : null); } - private boolean bind(Bindable target, BeanPropertyBinder propertyBinder, - Bean bean, BeanSupplier beanSupplier) { + private boolean bind(BeanPropertyBinder propertyBinder, Bean bean, + BeanSupplier beanSupplier) { boolean bound = false; for (Map.Entry entry : bean.getProperties().entrySet()) { bound |= bind(beanSupplier, propertyBinder, entry.getValue()); @@ -151,7 +151,7 @@ class JavaBeanBinder implements BeanBinder { @SuppressWarnings("unchecked") public BeanSupplier getSupplier(Bindable target) { - return new BeanSupplier(() -> { + return new BeanSupplier<>(() -> { T instance = null; if (target.getValue() != null) { instance = target.getValue().get(); @@ -168,7 +168,7 @@ class JavaBeanBinder implements BeanBinder { boolean useExistingValueForType) { Class type = bindable.getType().resolve(); Supplier value = bindable.getValue(); - if (value == null && !isInstantiatable(type)) { + if (value == null && !isInstantiable(type)) { return null; } if (useExistingValueForType && value != null) { @@ -183,7 +183,7 @@ class JavaBeanBinder implements BeanBinder { return (Bean) bean; } - private static boolean isInstantiatable(Class type) { + private static boolean isInstantiable(Class type) { if (type.isInterface()) { return false; } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java index 37420371e40..c014b48221a 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java @@ -84,7 +84,7 @@ class MapBinder extends AggregateBinder> { public void bindEntries(ConfigurationPropertySource source, Map map) { for (ConfigurationPropertyName name : source) { - Bindable valueBindable = getValueBindable(source, name); + Bindable valueBindable = getValueBindable(name); ConfigurationPropertyName entryName = getEntryName(source, name); Object key = getContext().getConversionService() .convert(getKeyName(entryName), this.keyType); @@ -93,8 +93,7 @@ class MapBinder extends AggregateBinder> { } } - private Bindable getValueBindable(ConfigurationPropertySource source, - ConfigurationPropertyName name) { + private Bindable getValueBindable(ConfigurationPropertyName name) { if (isMultiElementName(name) && isValueTreatedAsNestedMap()) { return Bindable.of(this.mapType); } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/PropertySourcesPlaceholdersResolver.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/PropertySourcesPlaceholdersResolver.java index a168d651eb3..c18f8210a48 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/PropertySourcesPlaceholdersResolver.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/PropertySourcesPlaceholdersResolver.java @@ -33,9 +33,9 @@ import org.springframework.util.SystemPropertyUtils; */ public class PropertySourcesPlaceholdersResolver implements PlaceholdersResolver { - private PropertySources sources; + private final PropertySources sources; - private PropertyPlaceholderHelper helper; + private final PropertyPlaceholderHelper helper; public PropertySourcesPlaceholdersResolver(Environment environment) { this(getSources(environment), null); diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandler.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandler.java index c1a64269d72..239dc2f6ba1 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandler.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandler.java @@ -46,7 +46,7 @@ public class ValidationBindHandler extends AbstractBindHandler { private boolean validate; - private Set boundProperties = new LinkedHashSet<>(); + private final Set boundProperties = new LinkedHashSet<>(); public ValidationBindHandler(Validator... validators) { super(); diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java index 1e2d133e993..f174b08f3bf 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java @@ -141,7 +141,7 @@ public final class ConfigurationPropertyName * Returns {@code true} if this element is an ancestor (immediate or nested parent) or * the specified name. * @param name the name to check - * @return {@code true} if this name is an ancessor + * @return {@code true} if this name is an ancestor */ public boolean isAncestorOf(ConfigurationPropertyName name) { ConfigurationPropertyName candidate = (name == null ? null : name.getParent()); @@ -231,8 +231,8 @@ public final class ConfigurationPropertyName public static ConfigurationPropertyName of(String name) throws IllegalArgumentException { Assert.notNull(name, "Name must not be null"); - Assert.isTrue(!name.toString().startsWith("."), "Name must not start with '.'"); - Assert.isTrue(!name.toString().endsWith("."), "Name must not end with '.'"); + Assert.isTrue(!name.startsWith("."), "Name must not start with '.'"); + Assert.isTrue(!name.endsWith("."), "Name must not end with '.'"); if (StringUtils.isEmpty(name)) { return EMPTY; } @@ -308,7 +308,7 @@ public final class ConfigurationPropertyName @Override public String toString() { - String string = getValue(Form.CONFIGURATION).toString(); + String string = getValue(Form.CONFIGURATION); return (this.indexed ? "[" + string + "]" : string); } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliases.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliases.java index 022c124cdb2..f668bae35f3 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliases.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliases.java @@ -26,7 +26,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; /** - * Maintains a mapping of {@link ConfigurationPropertyName} alaises. + * Maintains a mapping of {@link ConfigurationPropertyName} aliases. * * @author Phillip Webb * @author Madhura Bhave @@ -41,23 +41,23 @@ public final class ConfigurationPropertyNameAliases { } public ConfigurationPropertyNameAliases(String name, String... aliases) { - addAlaises(name, aliases); + addAliases(name, aliases); } public ConfigurationPropertyNameAliases(ConfigurationPropertyName name, ConfigurationPropertyName... aliases) { - addAlaises(name, aliases); + addAliases(name, aliases); } - public void addAlaises(String name, String... aliases) { + public void addAliases(String name, String... aliases) { Assert.notNull(name, "Name must not be null"); Assert.notNull(aliases, "Aliases must not be null"); - addAlaises(ConfigurationPropertyName.of(name), + addAliases(ConfigurationPropertyName.of(name), Arrays.stream(aliases).map(ConfigurationPropertyName::of) .toArray(ConfigurationPropertyName[]::new)); } - public void addAlaises(ConfigurationPropertyName name, + public void addAliases(ConfigurationPropertyName name, ConfigurationPropertyName... aliases) { Assert.notNull(name, "Name must not be null"); Assert.notNull(aliases, "Aliases must not be null"); diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySource.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySource.java index 4f75405787b..d2109a62a78 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySource.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySource.java @@ -77,7 +77,7 @@ public interface ConfigurationPropertySource extends Iterable configurationPropertySourceCache = new Cache<>(); + private final Cache configurationPropertySourceCache = new Cache<>(); - private Cache propertySourceCache = new Cache<>(); + private final Cache propertySourceCache = new Cache<>(); private final ConfigurationPropertyNameBuilder nameBuilder = new ConfigurationPropertyNameBuilder(); @@ -59,12 +59,7 @@ class DefaultPropertyMapper implements PropertyMapper { @Override public List map(PropertySource propertySource, String propertySourceName) { - List mapping = this.propertySourceCache.get(propertySourceName); - if (mapping == null) { - mapping = tryMap(propertySourceName); - this.propertySourceCache.put(propertySourceName, mapping); - } - return mapping; + return this.propertySourceCache.computeIfAbsent(propertySourceName, this::tryMap); } private List tryMap(String propertySourceName) { @@ -94,10 +89,7 @@ class DefaultPropertyMapper implements PropertyMapper { @Override protected boolean removeEldestEntry(Map.Entry> eldest) { - if (size() < this.capacity) { - return false; - } - return true; + return size() >= this.capacity; } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java index d659e540f21..4334b571ffb 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/MapConfigurationPropertySource.java @@ -60,7 +60,7 @@ public class MapConfigurationPropertySource implements ConfigurationPropertySour } /** - * Add all enties from the specified map. + * Add all entries from the specified map. * @param map the source map */ public void putAll(Map map) { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PropertySourceConfigurationPropertySource.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PropertySourceConfigurationPropertySource.java index 696ea9668f0..8bc5856e854 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PropertySourceConfigurationPropertySource.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/PropertySourceConfigurationPropertySource.java @@ -145,7 +145,7 @@ class PropertySourceConfigurationPropertySource implements ConfigurationProperty return names; } List mappings = getPropertyMappings(); - names = new ArrayList(mappings.size()); + names = new ArrayList<>(mappings.size()); for (PropertyMapping mapping : mappings) { names.add(mapping.getConfigurationPropertyName()); } @@ -167,7 +167,7 @@ class PropertySourceConfigurationPropertySource implements ConfigurationProperty } String[] names = ((EnumerablePropertySource) this.propertySource) .getPropertyNames(); - mappings = new ArrayList(names.length); + mappings = new ArrayList<>(names.length); for (String name : names) { mappings.addAll(this.mapper.map(this.propertySource, name)); } @@ -238,8 +238,6 @@ class PropertySourceConfigurationPropertySource implements ConfigurationProperty private static class Cache { - private ConfigurationPropertyName knownMissingName; - private List names; private List mappings; diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java index c95e56eccad..73b51ed7e4f 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SystemEnvironmentPropertyMapper.java @@ -45,7 +45,7 @@ import org.springframework.util.StringUtils; */ class SystemEnvironmentPropertyMapper implements PropertyMapper { - public static PropertyMapper INSTANCE = new SystemEnvironmentPropertyMapper(); + public static final PropertyMapper INSTANCE = new SystemEnvironmentPropertyMapper(); private final ConfigurationPropertyNameBuilder nameBuilder = new ConfigurationPropertyNameBuilder( this::createElement); @@ -104,10 +104,9 @@ class SystemEnvironmentPropertyMapper implements PropertyMapper { } private String convertName(ConfigurationPropertyName configurationPropertyName) { - String propertyName = configurationPropertyName.stream() + return configurationPropertyName.stream() .map(name -> name.getValue(Form.UNIFORM).toUpperCase()) .collect(Collectors.joining("_")); - return propertyName; } private boolean isListShortcutPossible(ConfigurationPropertyName name) { diff --git a/spring-boot/src/main/java/org/springframework/boot/origin/TextResourceOrigin.java b/spring-boot/src/main/java/org/springframework/boot/origin/TextResourceOrigin.java index 851f6bb5dd0..deaafadb1e7 100644 --- a/spring-boot/src/main/java/org/springframework/boot/origin/TextResourceOrigin.java +++ b/spring-boot/src/main/java/org/springframework/boot/origin/TextResourceOrigin.java @@ -86,7 +86,7 @@ public class TextResourceOrigin implements Origin { result.append(this.resource == null ? "unknown resource [?]" : this.resource.getDescription()); if (this.location != null) { - result.append(":" + this.location); + result.append(":").append(this.location); } return result.toString(); } diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliasesTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliasesTests.java index c68b303a901..551e6eec388 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliasesTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameAliasesTests.java @@ -62,7 +62,7 @@ public class ConfigurationPropertyNameAliasesTests { @Test public void addAliasesFromStringShouldAddMapping() throws Exception { ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); - aliases.addAlaises("foo", "bar", "baz"); + aliases.addAliases("foo", "bar", "baz"); assertThat(aliases.getAliases(ConfigurationPropertyName.of("foo"))) .containsExactly(ConfigurationPropertyName.of("bar"), ConfigurationPropertyName.of("baz")); @@ -71,7 +71,7 @@ public class ConfigurationPropertyNameAliasesTests { @Test public void addAlaisesFromNameShouldAddMapping() throws Exception { ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); - aliases.addAlaises(ConfigurationPropertyName.of("foo"), + aliases.addAliases(ConfigurationPropertyName.of("foo"), ConfigurationPropertyName.of("bar"), ConfigurationPropertyName.of("baz")); assertThat(aliases.getAliases(ConfigurationPropertyName.of("foo"))) .containsExactly(ConfigurationPropertyName.of("bar"), @@ -81,8 +81,8 @@ public class ConfigurationPropertyNameAliasesTests { @Test public void addWhenHasExistingShouldAddAdditionalMappings() throws Exception { ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); - aliases.addAlaises("foo", "bar"); - aliases.addAlaises("foo", "baz"); + aliases.addAliases("foo", "bar"); + aliases.addAliases("foo", "baz"); assertThat(aliases.getAliases(ConfigurationPropertyName.of("foo"))) .containsExactly(ConfigurationPropertyName.of("bar"), ConfigurationPropertyName.of("baz")); @@ -97,7 +97,7 @@ public class ConfigurationPropertyNameAliasesTests { @Test public void getAliasesWhenMappedShouldReturnMapping() throws Exception { ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); - aliases.addAlaises("foo", "bar"); + aliases.addAliases("foo", "bar"); assertThat(aliases.getAliases(ConfigurationPropertyName.of("foo"))) .containsExactly(ConfigurationPropertyName.of("bar")); } @@ -105,8 +105,8 @@ public class ConfigurationPropertyNameAliasesTests { @Test public void getNameForAliasWhenHasMappingShouldReturnName() throws Exception { ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); - aliases.addAlaises("foo", "bar"); - aliases.addAlaises("foo", "baz"); + aliases.addAliases("foo", "bar"); + aliases.addAliases("foo", "baz"); assertThat((Object) aliases.getNameForAlias(ConfigurationPropertyName.of("bar"))) .isEqualTo(ConfigurationPropertyName.of("foo")); assertThat((Object) aliases.getNameForAlias(ConfigurationPropertyName.of("baz"))) @@ -116,7 +116,7 @@ public class ConfigurationPropertyNameAliasesTests { @Test public void getNameForAliasWhenNotMappedShouldReturnNull() throws Exception { ConfigurationPropertyNameAliases aliases = new ConfigurationPropertyNameAliases(); - aliases.addAlaises("foo", "bar"); + aliases.addAliases("foo", "bar"); assertThat((Object) aliases.getNameForAlias(ConfigurationPropertyName.of("baz"))) .isNull(); }