Author: swd847
Date: 2010-07-19 08:07:34 -0400 (Mon, 19 Jul 2010)
New Revision: 6722
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/serialization/ContextualStoreImpl.java
Log:
WELD-562
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/serialization/ContextualStoreImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/serialization/ContextualStoreImpl.java 2010-07-18
16:06:36 UTC (rev 6721)
+++
core/trunk/impl/src/main/java/org/jboss/weld/serialization/ContextualStoreImpl.java 2010-07-19
12:07:34 UTC (rev 6722)
@@ -106,9 +106,16 @@
}
else
{
- String id = new
StringBuilder().append(GENERATED_ID_PREFIX).append(idGenerator.incrementAndGet()).toString();
- contextuals.put(contextual, id);
- return id;
+ synchronized (contextual)
+ {
+ if (contextuals.containsKey(contextual))
+ {
+ return contextuals.get(contextual);
+ }
+ String id = new
StringBuilder().append(GENERATED_ID_PREFIX).append(idGenerator.incrementAndGet()).toString();
+ contextuals.put(contextual, id);
+ return id;
+ }
}
}
Show replies by date