|
From: <lh...@us...> - 2008-11-14 13:59:25
|
Revision: 191
http://tinytim.svn.sourceforge.net/tinytim/?rev=191&view=rev
Author: lheuer
Date: 2008-11-14 13:59:23 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
Switch back to interned construct ids
Modified Paths:
--------------
tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java
Modified: tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java
===================================================================
--- tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java 2008-11-14 13:39:21 UTC (rev 190)
+++ tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java 2008-11-14 13:59:23 UTC (rev 191)
@@ -50,7 +50,7 @@
private final Map<String, IConstruct> _id2Construct;
IdentityManager(MemoryTopicMap tm) {
- _id2Construct = CollectionFactory.createMap(IConstant.IDENTITY_ID2CONSTRUCT_SIZE);
+ _id2Construct = CollectionFactory.createIdentityMap(IConstant.IDENTITY_ID2CONSTRUCT_SIZE);
_sid2Topic = CollectionFactory.createIdentityMap(IConstant.IDENTITY_SID2TOPIC_SIZE);
_slo2Topic = CollectionFactory.createIdentityMap(IConstant.IDENTITY_SLO2TOPIC_SIZE);
_iid2Construct = CollectionFactory.createIdentityMap(IConstant.IDENTITY_IID2CONSTRUCT_SIZE);
@@ -106,13 +106,11 @@
*/
private void _register(IConstruct construct) {
ConstructImpl c = (ConstructImpl) construct;
- String id = c._id;
- if (id == null) {
- id = "" + IdGenerator.nextId();
+ if (c._id == null) {
+ c._id = ("" + IdGenerator.nextId()).intern();
}
- if (!_id2Construct.containsKey(id)) {
- _id2Construct.put(id, c);
- c._id = id;
+ if (!_id2Construct.containsKey(c._id)) {
+ _id2Construct.put(c._id, c);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|