Fix typos

Closes gh-3666
pull/3666/merge
izeye 9 years ago committed by Stephane Nicoll
parent 6c7a5c5077
commit 7dc9bddf9a

@ -79,7 +79,7 @@ class DefaultPropertyNamePatternsMatcher implements PropertyNamePatternsMatcher
} }
else { else {
char charAfter = propertyNameChars[this.names[nameIndex].length()]; char charAfter = propertyNameChars[this.names[nameIndex].length()];
if (isDelimeter(charAfter)) { if (isDelimiter(charAfter)) {
match[nameIndex] = true; match[nameIndex] = true;
noneMatched = false; noneMatched = false;
} }
@ -105,7 +105,7 @@ class DefaultPropertyNamePatternsMatcher implements PropertyNamePatternsMatcher
return c1 == c2; return c1 == c2;
} }
private boolean isDelimeter(char c) { private boolean isDelimiter(char c) {
for (char delimiter : this.delimiters) { for (char delimiter : this.delimiters) {
if (c == delimiter) { if (c == delimiter) {
return true; return true;

@ -53,9 +53,9 @@ import org.springframework.validation.Validator;
public class PropertiesConfigurationFactory<T> implements FactoryBean<T>, public class PropertiesConfigurationFactory<T> implements FactoryBean<T>,
MessageSourceAware, InitializingBean { MessageSourceAware, InitializingBean {
private static final char[] EXACT_DELIMETERS = { '_', '.', '[' }; private static final char[] EXACT_DELIMITERS = { '_', '.', '[' };
private static final char[] TARGET_NAME_DELIMETERS = { '_', '.' }; private static final char[] TARGET_NAME_DELIMITERS = { '_', '.' };
private final Log logger = LogFactory.getLog(getClass()); private final Log logger = LogFactory.getLog(getClass());
@ -308,13 +308,13 @@ public class PropertiesConfigurationFactory<T> implements FactoryBean<T>,
if (this.ignoreUnknownFields && !isMapTarget()) { if (this.ignoreUnknownFields && !isMapTarget()) {
// Since unknown fields are ignored we can filter them out early to save // Since unknown fields are ignored we can filter them out early to save
// unnecessary calls to the PropertySource. // unnecessary calls to the PropertySource.
return new DefaultPropertyNamePatternsMatcher(EXACT_DELIMETERS, true, names); return new DefaultPropertyNamePatternsMatcher(EXACT_DELIMITERS, true, names);
} }
if (this.targetName != null) { if (this.targetName != null) {
// We can filter properties to those starting with the target name, but // We can filter properties to those starting with the target name, but
// we can't do a complete filter since we need to trigger the // we can't do a complete filter since we need to trigger the
// unknown fields check // unknown fields check
return new DefaultPropertyNamePatternsMatcher(TARGET_NAME_DELIMETERS, return new DefaultPropertyNamePatternsMatcher(TARGET_NAME_DELIMITERS,
this.targetName); this.targetName);
} }
// Not ideal, we basically can't filter anything // Not ideal, we basically can't filter anything

@ -62,7 +62,7 @@ public class PropertySourcesPropertyValues implements PropertyValues {
* @param propertySources a PropertySources instance * @param propertySources a PropertySources instance
* @param includePatterns property name patterns to include from system properties and * @param includePatterns property name patterns to include from system properties and
* environment variables * environment variables
* @param propertyNames the property names to used in lieu of an * @param propertyNames the property names to use in lieu of an
* {@link EnumerablePropertySource}. * {@link EnumerablePropertySource}.
*/ */
public PropertySourcesPropertyValues(PropertySources propertySources, public PropertySourcesPropertyValues(PropertySources propertySources,
@ -74,7 +74,7 @@ public class PropertySourcesPropertyValues implements PropertyValues {
/** /**
* Create a new PropertyValues from the given PropertySources * Create a new PropertyValues from the given PropertySources
* @param propertySources a PropertySources instance * @param propertySources a PropertySources instance
* @param propertyNames the property names to used in lieu of an * @param propertyNames the property names to use in lieu of an
* {@link EnumerablePropertySource}. * {@link EnumerablePropertySource}.
* @param includes the property name patterns to include * @param includes the property name patterns to include
*/ */

@ -69,9 +69,9 @@ public class DefaultPropertyNamePatternsMatcherTests {
@Test @Test
public void withSquareBrackets() throws Exception { public void withSquareBrackets() throws Exception {
char[] delimeters = "._[".toCharArray(); char[] delimiters = "._[".toCharArray();
PropertyNamePatternsMatcher matcher = new DefaultPropertyNamePatternsMatcher( PropertyNamePatternsMatcher matcher = new DefaultPropertyNamePatternsMatcher(
delimeters, "aaa", "bbbb", "ccccc"); delimiters, "aaa", "bbbb", "ccccc");
assertTrue(matcher.matches("bbbb")); assertTrue(matcher.matches("bbbb"));
assertTrue(matcher.matches("bbbb[4]")); assertTrue(matcher.matches("bbbb[4]"));
assertFalse(matcher.matches("bbb[4]")); assertFalse(matcher.matches("bbb[4]"));

Loading…
Cancel
Save