Author: manaRH
Date: 2012-07-03 06:30:48 -0400 (Tue, 03 Jul 2012)
New Revision: 14974
Modified:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/Component.java
Log:
JBSEAM-4861, JBSEAM-4993 better to use component instead of getClass() in synchronization
Modified:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/Component.java
===================================================================
---
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/Component.java 2012-07-03
08:57:58 UTC (rev 14973)
+++
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/Component.java 2012-07-03
10:30:48 UTC (rev 14974)
@@ -2076,6 +2076,7 @@
else if (factoryMethod != null && getOutScope(factoryMethod.getScope(),
factoryMethod.getComponent()).isContextActive())
{
Object factory =
Component.getInstance(factoryMethod.getComponent().getName(), true);
+ Component component = factoryMethod.getComponent();
ScopeType scopeResult = getOutScope(factoryMethod.getScope(),
factoryMethod.getComponent());
ScopeType scopeFactory = factoryMethod.getComponent().getScope();
// we need this lock in the following cases: (1) the target scope is
@@ -2105,12 +2106,12 @@
return createInstanceFromFactory(name, scope, factoryMethod,
factory);
}
}
- // synchronize all instances of this factory as they might
- // outject to the same scope (i.e. factory in EVENT scope,
+ // synchronize all instances of this component as they might
+ // outject to the same scope (i.e. component factory in EVENT scope,
// outjecting to APPLICATION scope).
else
{
- synchronized (factory.getClass())
+ synchronized (component)
{
return createInstanceFromFactory(name, scope, factoryMethod,
factory);
}