summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntje Fuhrmann2013-08-16 02:30:12 (EDT)
committer Stephan Born2013-09-06 07:59:11 (EDT)
commit1d1f7d6d5b7ef3aec38a67b1d7c460fc5002120c (patch)
treecf6c80e55431ae665ac94a57764e4f677e26be5b
parent2b850a7aef59c5abaa861f5739bcf88cd4711c3b (diff)
downloadorg.eclipse.stardust.engine-1d1f7d6d5b7ef3aec38a67b1d7c460fc5002120c.zip
org.eclipse.stardust.engine-1d1f7d6d5b7ef3aec38a67b1d7c460fc5002120c.tar.gz
org.eclipse.stardust.engine-1d1f7d6d5b7ef3aec38a67b1d7c460fc5002120c.tar.bz2
Jira-ID: CRNT-29983
OutOfMemory due to multiple model manager beans git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/engine@66730 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Antje Fuhrmann <antje.fuhrmann@sungard.com>
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/removethis/ItemLocator.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/removethis/ItemLocator.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/removethis/ItemLocator.java
index 30e69cc..753a8f2 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/removethis/ItemLocator.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/removethis/ItemLocator.java
@@ -43,23 +43,24 @@ public class ItemLocator
public Object get()
{
- Object result = item.get();
-
- if ((null == result) || watcher.isDirty())
+ if ((null == item.get()) || watcher.isDirty())
{
synchronized (initializationLock)
{
- if (initializationLock.compareAndSet(null, INITIALIZATION_LOCK))
+ if ((null == item.get()) || watcher.isDirty())
{
- final Object state = watcher.getGlobalState();
-
- item.set(loader.load());
- watcher.updateState(state);
-
- if ( !initializationLock.compareAndSet(INITIALIZATION_LOCK, null))
+ if (initializationLock.compareAndSet(null, INITIALIZATION_LOCK))
{
- trace.warn("Race condition while initializing item from loader '"
- + loader + "'.");
+ final Object state = watcher.getGlobalState();
+
+ item.set(loader.load());
+ watcher.updateState(state);
+
+ if (!initializationLock.compareAndSet(INITIALIZATION_LOCK, null))
+ {
+ trace.warn("Race condition while initializing item from loader '"
+ + loader + "'.");
+ }
}
}
}