diff --git a/org.springframework.context/src/test/java/org/springframework/mock/env/MockPropertySource.java b/org.springframework.context/src/test/java/org/springframework/mock/env/MockPropertySource.java index 45f8b61ad71..a6f5c6009f5 100644 --- a/org.springframework.context/src/test/java/org/springframework/mock/env/MockPropertySource.java +++ b/org.springframework.context/src/test/java/org/springframework/mock/env/MockPropertySource.java @@ -87,8 +87,8 @@ public class MockPropertySource extends PropertiesPropertySource { /** * Set the given property on the underlying {@link Properties} object. */ - public void setProperty(String key, Object value) { - this.source.put(key, value); + public void setProperty(String name, Object value) { + this.source.put(name, value); } /** @@ -96,8 +96,8 @@ public class MockPropertySource extends PropertiesPropertySource { * Useful for method chaining and fluent-style use. * @return this {@link MockPropertySource} instance */ - public MockPropertySource withProperty(String key, Object value) { - this.setProperty(key, value); + public MockPropertySource withProperty(String name, Object value) { + this.setProperty(name, value); return this; } } diff --git a/org.springframework.core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java b/org.springframework.core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java index c7befa8620e..ba7d8c70741 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java +++ b/org.springframework.core/src/main/java/org/springframework/core/env/CommandLinePropertySource.java @@ -220,24 +220,24 @@ public abstract class CommandLinePropertySource extends PropertySource { } /** - * Return whether this {@code PropertySource} contains the given key. - *

This implementation first checks to see if the key specified is the special + * Return whether this {@code PropertySource} contains a property with the given name. + *

This implementation first checks to see if the name specified is the special * {@linkplain #setNonOptionArgsPropertyName(String) "non-option arguments" property}, * and if so delegates to the abstract {@link #getNonOptionArgs()} method * checking to see whether it returns an empty collection. Otherwise delegates to and * returns the value of the abstract {@link #containsOption(String)} method. */ @Override - public final boolean containsProperty(String key) { - if (this.nonOptionArgsPropertyName.equals(key)) { + public final boolean containsProperty(String name) { + if (this.nonOptionArgsPropertyName.equals(name)) { return !this.getNonOptionArgs().isEmpty(); } - return this.containsOption(key); + return this.containsOption(name); } /** * {@inheritDoc} - *

This implementation first checks to see if the key specified is the special + *

This implementation first checks to see if the name specified is the special * {@linkplain #setNonOptionArgsPropertyName(String) "non-option arguments" property}, * and if so delegates to the abstract {@link #getNonOptionArgs()} method. If so * and the collection of non-option arguments is empty, this method returns {@code @@ -246,8 +246,8 @@ public abstract class CommandLinePropertySource extends PropertySource { * #getOptionValues(String)} method. */ @Override - public final String getProperty(String key) { - if (this.nonOptionArgsPropertyName.equals(key)) { + public final String getProperty(String name) { + if (this.nonOptionArgsPropertyName.equals(name)) { Collection nonOptionArguments = this.getNonOptionArgs(); if (nonOptionArguments.isEmpty()) { return null; @@ -256,7 +256,7 @@ public abstract class CommandLinePropertySource extends PropertySource { return StringUtils.collectionToCommaDelimitedString(nonOptionArguments); } } - Collection optionValues = this.getOptionValues(key); + Collection optionValues = this.getOptionValues(name); if (optionValues == null) { return null; } diff --git a/org.springframework.core/src/main/java/org/springframework/core/env/EnumerablePropertySource.java b/org.springframework.core/src/main/java/org/springframework/core/env/EnumerablePropertySource.java index 1d8861edeb6..ad1f95aabaa 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/env/EnumerablePropertySource.java +++ b/org.springframework.core/src/main/java/org/springframework/core/env/EnumerablePropertySource.java @@ -20,7 +20,7 @@ import org.springframework.util.Assert; /** * A {@link PropertySource} implementation capable of interrogating its - * underlying source object to enumerate all possible property key/value + * underlying source object to enumerate all possible property name/value * pairs. Exposes the {@link #getPropertyNames()} method to allow callers * to introspect available properties without having to access the underlying * source object. This also facilitates a more efficient implementation of @@ -56,10 +56,10 @@ public abstract class EnumerablePropertySource extends PropertySource { public abstract String[] getPropertyNames(); /** - * Return whether this {@code PropertySource} contains the given key. - *

This implementation checks for the presence of the given key within + * Return whether this {@code PropertySource} contains a property with the given name. + *

This implementation checks for the presence of the given name within * the {@link #getPropertyNames()} array. - * @param key the property key to find + * @param name the property to find */ public boolean containsProperty(String name) { Assert.notNull(name, "property name must not be null"); diff --git a/org.springframework.core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java b/org.springframework.core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java index 08403aeaeb7..154c34d623d 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java +++ b/org.springframework.core/src/main/java/org/springframework/core/env/JOptCommandLinePropertySource.java @@ -73,13 +73,13 @@ public class JOptCommandLinePropertySource extends CommandLinePropertySource getOptionValues(String key) { - List argValues = this.source.valuesOf(key); + public List getOptionValues(String name) { + List argValues = this.source.valuesOf(name); List stringArgValues = new ArrayList(); for(Object argValue : argValues) { if (!(argValue instanceof String)) { @@ -88,7 +88,7 @@ public class JOptCommandLinePropertySource extends CommandLinePropertySourceNote that because a {@code Properties} object is technically an {@code } - * {@link java.util.Hashtable Hashtable}, one may contain non-{@code String} keys or values. This - * implementation, however is restricted to accessing only {@code String}-based keys and values, in - * the same fashion as {@link Properties#getProperty} and {@link Properties#setProperty}. + *

Note that because a {@code Properties} object is technically an + * {@code } {@link java.util.Hashtable Hashtable}, one may contain + * non-{@code String} keys or values. This implementation, however is restricted to + * accessing only {@code String}-based keys and values, in the same fashion as + * {@link Properties#getProperty} and {@link Properties#setProperty}. * * @author Chris Beams * @since 3.1 diff --git a/org.springframework.core/src/main/java/org/springframework/core/env/PropertySource.java b/org.springframework.core/src/main/java/org/springframework/core/env/PropertySource.java index 3a028fe7587..d0587ef0fa8 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/env/PropertySource.java +++ b/org.springframework.core/src/main/java/org/springframework/core/env/PropertySource.java @@ -21,7 +21,7 @@ import org.apache.commons.logging.LogFactory; import org.springframework.util.Assert; /** - * Abstract base class representing a source of key/value property pairs. The underlying + * Abstract base class representing a source of name/value property pairs. The underlying * {@linkplain #getSource() source object} may be of any type {@code T} that encapsulates * properties. Examples include {@link java.util.Properties} objects, {@link java.util.Map} * objects, {@code ServletContext} and {@code ServletConfig} objects (for access to init @@ -98,22 +98,22 @@ public abstract class PropertySource { } /** - * Return whether this {@code PropertySource} contains the given key. + * Return whether this {@code PropertySource} contains the given name. *

This implementation simply checks for a null return value * from {@link #getProperty(String)}. Subclasses may wish to * implement a more efficient algorithm if possible. - * @param key the property key to find + * @param name the property name to find */ - public boolean containsProperty(String key) { - return this.getProperty(key) != null; + public boolean containsProperty(String name) { + return this.getProperty(name) != null; } /** - * Return the value associated with the given key, {@code null} if not found. - * @param key the property key to find + * Return the value associated with the given name, {@code null} if not found. + * @param name the property to find * @see PropertyResolver#getRequiredProperty(String) */ - public abstract Object getProperty(String key); + public abstract Object getProperty(String name); /** * Return a hashcode derived from the {@code name} property of this {@code PropertySource} @@ -154,13 +154,13 @@ public abstract class PropertySource { } /** - * Produce concise output (type and name) if the current log level does not include debug. - * If debug is enabled, produce verbose output including hashcode of the PropertySource instance - * and every key/value property pair. + * Produce concise output (type and name) if the current log level does not include + * debug. If debug is enabled, produce verbose output including hashcode of the + * PropertySource instance and every name/value property pair. * * This variable verbosity is useful as a property source such as system properties - * or environment variables may contain an arbitrary number of property pairs, potentially - * leading to difficult to read exception and log messages. + * or environment variables may contain an arbitrary number of property pairs, + * potentially leading to difficult to read exception and log messages. * * @see Log#isDebugEnabled() */ @@ -226,7 +226,7 @@ public abstract class PropertySource { * Always return {@code null}. */ @Override - public String getProperty(String key) { + public String getProperty(String name) { return null; } } @@ -251,12 +251,12 @@ public abstract class PropertySource { } @Override - public boolean containsProperty(String key) { + public boolean containsProperty(String name) { throw new UnsupportedOperationException(USAGE_ERROR); } @Override - public String getProperty(String key) { + public String getProperty(String name) { throw new UnsupportedOperationException(USAGE_ERROR); } diff --git a/org.springframework.core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java b/org.springframework.core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java index d75a4fc37aa..d2022317664 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java +++ b/org.springframework.core/src/main/java/org/springframework/core/env/SimpleCommandLinePropertySource.java @@ -96,13 +96,13 @@ public class SimpleCommandLinePropertySource extends CommandLinePropertySource getOptionValues(String key) { - return this.source.getOptionValues(key); + protected List getOptionValues(String name) { + return this.source.getOptionValues(name); } @Override diff --git a/org.springframework.core/src/test/java/org/springframework/mock/env/MockPropertySource.java b/org.springframework.core/src/test/java/org/springframework/mock/env/MockPropertySource.java index 45f8b61ad71..a6f5c6009f5 100644 --- a/org.springframework.core/src/test/java/org/springframework/mock/env/MockPropertySource.java +++ b/org.springframework.core/src/test/java/org/springframework/mock/env/MockPropertySource.java @@ -87,8 +87,8 @@ public class MockPropertySource extends PropertiesPropertySource { /** * Set the given property on the underlying {@link Properties} object. */ - public void setProperty(String key, Object value) { - this.source.put(key, value); + public void setProperty(String name, Object value) { + this.source.put(name, value); } /** @@ -96,8 +96,8 @@ public class MockPropertySource extends PropertiesPropertySource { * Useful for method chaining and fluent-style use. * @return this {@link MockPropertySource} instance */ - public MockPropertySource withProperty(String key, Object value) { - this.setProperty(key, value); + public MockPropertySource withProperty(String name, Object value) { + this.setProperty(name, value); return this; } } diff --git a/org.springframework.expression/src/test/java/org/springframework/mock/env/MockPropertySource.java b/org.springframework.expression/src/test/java/org/springframework/mock/env/MockPropertySource.java index f303eca546d..157ee58c3c6 100644 --- a/org.springframework.expression/src/test/java/org/springframework/mock/env/MockPropertySource.java +++ b/org.springframework.expression/src/test/java/org/springframework/mock/env/MockPropertySource.java @@ -86,8 +86,8 @@ public class MockPropertySource extends PropertiesPropertySource { /** * Set the given property on the underlying {@link Properties} object. */ - public void setProperty(String key, Object value) { - this.source.put(key, value); + public void setProperty(String name, Object value) { + this.source.put(name, value); } /** @@ -95,8 +95,8 @@ public class MockPropertySource extends PropertiesPropertySource { * Useful for method chaining and fluent-style use. * @return this {@link MockPropertySource} instance */ - public MockPropertySource withProperty(String key, Object value) { - this.setProperty(key, value); + public MockPropertySource withProperty(String name, Object value) { + this.setProperty(name, value); return this; } } diff --git a/org.springframework.test/src/main/java/org/springframework/mock/env/MockPropertySource.java b/org.springframework.test/src/main/java/org/springframework/mock/env/MockPropertySource.java index 46501ad5f13..f4d4a834fc9 100644 --- a/org.springframework.test/src/main/java/org/springframework/mock/env/MockPropertySource.java +++ b/org.springframework.test/src/main/java/org/springframework/mock/env/MockPropertySource.java @@ -87,8 +87,8 @@ public class MockPropertySource extends PropertiesPropertySource { /** * Set the given property on the underlying {@link Properties} object. */ - public void setProperty(String key, Object value) { - this.source.put(key, value); + public void setProperty(String name, Object value) { + this.source.put(name, value); } /** @@ -96,8 +96,8 @@ public class MockPropertySource extends PropertiesPropertySource { * Useful for method chaining and fluent-style use. * @return this {@link MockPropertySource} instance */ - public MockPropertySource withProperty(String key, Object value) { - this.setProperty(key, value); + public MockPropertySource withProperty(String name, Object value) { + this.setProperty(name, value); return this; } }