You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2011/09/09 18:00:50 UTC
svn commit: r1167262 -
/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java
Author: dblevins
Date: Fri Sep 9 16:00:50 2011
New Revision: 1167262
URL: http://svn.apache.org/viewvc?rev=1167262&view=rev
Log:
formatting
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java
Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java?rev=1167262&r1=1167261&r2=1167262&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/BeanContext.java Fri Sep 9 16:00:50 2011
@@ -1332,13 +1332,11 @@ public class BeanContext extends Deploym
}
}
- protected <X> X getBean(Class<X> clazz, Bean<?> bean)
- {
+ protected <X> X getBean(Class<X> clazz, Bean<?> bean) {
return clazz.cast(bean);
}
- public <T> void inject(T instance, CreationalContext<T> ctx)
- {
+ public <T> void inject(T instance, CreationalContext<T> ctx) {
WebBeansContext webBeansContext = getModuleContext().getAppContext().getWebBeansContext();
@@ -1350,24 +1348,20 @@ public class BeanContext extends Deploym
beanDefinition = beanConstructor;
}
- if(!(ctx instanceof CreationalContextImpl))
- {
+ if (!(ctx instanceof CreationalContextImpl)) {
ctx = webBeansContext.getCreationalContextFactory().wrappedCreationalContext(ctx, beanDefinition);
}
Object oldInstanceUnderInjection = AbstractInjectable.instanceUnderInjection.get();
boolean isInjectionToAnotherBean = false;
- try
- {
+ try {
Contextual<?> contextual = null;
- if(ctx instanceof CreationalContextImpl)
- {
- contextual = ((CreationalContextImpl)ctx).getBean();
+ if (ctx instanceof CreationalContextImpl) {
+ contextual = ((CreationalContextImpl) ctx).getBean();
isInjectionToAnotherBean = contextual == getBean(InjectionTargetBean.class, beanDefinition) ? false : true;
}
- if(!isInjectionToAnotherBean)
- {
+ if (!isInjectionToAnotherBean) {
AbstractInjectable.instanceUnderInjection.set(instance);
}
@@ -1378,15 +1372,10 @@ public class BeanContext extends Deploym
bean.injectSuperMethods(instance, ctx);
bean.injectFields(instance, ctx);
bean.injectMethods(instance, ctx);
- }
- finally
- {
- if(oldInstanceUnderInjection != null)
- {
+ } finally {
+ if (oldInstanceUnderInjection != null) {
AbstractInjectable.instanceUnderInjection.set(oldInstanceUnderInjection);
- }
- else
- {
+ } else {
AbstractInjectable.instanceUnderInjection.set(null);
AbstractInjectable.instanceUnderInjection.remove();
}