Renaming 'values' to 'valuesView' to make it more obvious where it is used and why it can be transient. Rewriting values() to be readable.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@655741 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2008-05-13 05:35:44 +00:00
parent d72bf81d8b
commit b02d2167ed

View File

@ -66,7 +66,7 @@ public class MultiValueMap extends AbstractMapDecorator implements MultiMap {
/** The factory for creating value collections. */
private final Factory collectionFactory;
/** The cached values. */
private transient Collection values;
private transient Collection valuesView;
/**
* Creates a map which wraps the given map and
@ -253,8 +253,10 @@ public class MultiValueMap extends AbstractMapDecorator implements MultiMap {
* @return a collection view of the values contained in this map
*/
public Collection values() {
Collection vs = values;
return (vs != null ? vs : (values = new Values()));
if (valuesView == null) {
valuesView = new Values();
}
return valuesView;
}
/**