Author: bayard
Date: Mon May 12 22:35:44 2008
New Revision: 655741
URL: http://svn.apache.org/viewvc?rev=655741&view=rev
Log:
Renaming 'values' to 'valuesView' to make it more obvious where it is used and
why it can be transient. Rewriting values() to be readable.
Modified:
commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/MultiValueMap.java
Modified:
commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/MultiValueMap.java
URL:
http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/MultiValueMap.java?rev=655741&r1=655740&r2=655741&view=diff
==============================================================================
---
commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/MultiValueMap.java
(original)
+++
commons/proper/collections/trunk/src/java/org/apache/commons/collections/map/MultiValueMap.java
Mon May 12 22:35:44 2008
@@ -66,7 +66,7 @@
/** 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 @@
* @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;
}
/**