|
From: <lh...@us...> - 2008-11-13 15:00:23
|
Revision: 184
http://tinytim.svn.sourceforge.net/tinytim/?rev=184&view=rev
Author: lheuer
Date: 2008-11-13 15:00:21 +0000 (Thu, 13 Nov 2008)
Log Message:
-----------
Made underlying set immutable in the constructor
Modified Paths:
--------------
tinytim/trunk/src/main/java/org/tinytim/core/Scope.java
Modified: tinytim/trunk/src/main/java/org/tinytim/core/Scope.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/Scope.java 2008-11-13 14:15:37 UTC (rev 183)
+++ tinytim/trunk/src/main/java/org/tinytim/core/Scope.java 2008-11-13 15:00:21 UTC (rev 184)
@@ -46,8 +46,9 @@
}
private Scope(Collection<Topic> themes) {
- _set = CollectionFactory.createIdentitySet(themes.size());
- _set.addAll(themes);
+ Set<Topic> set = CollectionFactory.createIdentitySet(themes.size());
+ set.addAll(themes);
+ _set = Collections.unmodifiableSet(set);
}
/* (non-Javadoc)
@@ -86,7 +87,8 @@
* @see org.tinytim.core.IScope#asSet()
*/
public Set<Topic> asSet() {
- return Collections.unmodifiableSet(_set);
+ // _set is immutable
+ return _set;
}
/* (non-Javadoc)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|