openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1084178 - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/component/ main/java/org/apache/webbeans/component/creation/ main/java/org/apache/webbeans/config/ main/java/org/apache/webbeans/context/ main/java/org/apach...
Date Tue, 22 Mar 2011 13:50:35 GMT
Author: struberg
Date: Tue Mar 22 13:50:35 2011
New Revision: 1084178

URL: http://svn.apache.org/viewvc?rev=1084178&view=rev
Log:
OWB-461 code cleanup

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AnnotatedTypeBeanCreatorImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/OWBInjector.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedElementFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/service/TypedInjection.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
Tue Mar 22 13:50:35 2011
@@ -109,7 +109,7 @@ public abstract class AbstractInjectionT
      */
     protected T createInstance(CreationalContext<T> creationalContext)
     {
-        T instance = null;
+        T instance;
 
         //Default creation phases
         instance = createDefaultInstance(creationalContext);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
Tue Mar 22 13:50:35 2011
@@ -104,7 +104,7 @@ public abstract class AbstractProducerBe
     {
         // return getManager().getInstance(this.ownerComponent);
 
-        Object parentInstance = null;
+        Object parentInstance;
 
         Bean<?> specialize = WebBeansUtil.getMostSpecializedBean(getManager(),
                 (AbstractOwbBean<T>) this.ownerComponent);
@@ -125,7 +125,7 @@ public abstract class AbstractProducerBe
     @SuppressWarnings("unchecked")
     protected Object getParentInstanceFromContext(CreationalContext<?> creationalContext)
     {
-        Object parentInstance = null;
+        Object parentInstance;
 
         Bean<?> specialize = WebBeansUtil.getMostSpecializedBean(getManager(),
                 (AbstractOwbBean<T>) this.ownerComponent);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AnnotatedTypeBeanCreatorImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AnnotatedTypeBeanCreatorImpl.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AnnotatedTypeBeanCreatorImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AnnotatedTypeBeanCreatorImpl.java
Tue Mar 22 13:50:35 2011
@@ -43,7 +43,7 @@ public class AnnotatedTypeBeanCreatorImp
     @Override
     public void defineConstructor()
     {
-        Constructor<T> constructor = null;
+        Constructor<T> constructor;
         try
         {
             AnnotatedConstructor<T> annotated = WebBeansAnnotatedTypeUtil.getBeanConstructor(getAnnotatedType());

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
Tue Mar 22 13:50:35 2011
@@ -256,7 +256,7 @@ public class BeansDeployer
     private void fireBeforeBeanDiscoveryEvent()
     {
         BeanManager manager = webBeansContext.getBeanManagerImpl();
-        manager.fireEvent(new BeforeBeanDiscoveryImpl(webBeansContext),new Annotation[0]);
+        manager.fireEvent(new BeforeBeanDiscoveryImpl(webBeansContext));
     }
     
     /**
@@ -265,7 +265,7 @@ public class BeansDeployer
     private void fireAfterBeanDiscoveryEvent()
     {
         BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
-        manager.fireEvent(new AfterBeanDiscoveryImpl(webBeansContext),new Annotation[0]);
+        manager.fireEvent(new AfterBeanDiscoveryImpl(webBeansContext));
 
         webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by AfterBeanDiscovery event observers. Look
at logs for further details");
@@ -277,7 +277,7 @@ public class BeansDeployer
     private void fireAfterDeploymentValidationEvent()
     {
         BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
-        manager.fireEvent(new AfterDeploymentValidationImpl(manager),new Annotation[0]);
+        manager.fireEvent(new AfterDeploymentValidationImpl(manager));
 
         webBeansContext.getWebBeansUtil().inspectErrorStack(
             "There are errors that are added by AfterDeploymentValidation event observers.
Look at logs for further details");
@@ -620,7 +620,7 @@ public class BeansDeployer
                 //superClassList is used to handle the case: Car, CarToyota, Bus, SchoolBus,
CarFord
                 //for which case, the owb should throw exception that both CarToyota and
CarFord are 
                 //specialize Car. 
-                Class<?> superClass = null;
+                Class<?> superClass;
                 ArrayList<Class<?>> superClassList = new ArrayList<Class<?>>();
                 ArrayList<Class<?>> specialClassList = new ArrayList<Class<?>>();
                 for(Class<?> specialClass : beanClasses)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
Tue Mar 22 13:50:35 2011
@@ -107,7 +107,7 @@ public final class DefinitionUtil
         //Looking for bean types
         if(AnnotationUtil.hasAnnotation(annots, Typed.class))
         {
-            Typed beanTypes = (Typed) AnnotationUtil.getAnnotation(annots, Typed.class);
+            Typed beanTypes = AnnotationUtil.getAnnotation(annots, Typed.class);
             defineUserDefinedBeanTypes(bean, null, beanTypes);            
         }
         else
@@ -183,7 +183,7 @@ public final class DefinitionUtil
         //Looking for bean types
         if(AnnotationUtil.hasAnnotation(annots, Typed.class))
         {
-            Typed beanTypes = (Typed) AnnotationUtil.getAnnotation(annots, Typed.class);
+            Typed beanTypes = AnnotationUtil.getAnnotation(annots, Typed.class);
             defineUserDefinedBeanTypes(producerBean, type, beanTypes);
         }
         
@@ -221,7 +221,6 @@ public final class DefinitionUtil
     {
         final AnnotationManager annotationManager = component.getWebBeansContext().getAnnotationManager();
 
-        boolean find = false;
         for (Annotation annotation : annotations)
         {
             Class<? extends Annotation> type = annotation.annotationType();
@@ -244,7 +243,6 @@ public final class DefinitionUtil
                     }
                 }
 
-                find = true;
                 component.addQualifier(annotation);
             }
         }
@@ -473,7 +471,7 @@ public final class DefinitionUtil
                     if (AnnotationUtil.hasMetaAnnotation(stero.getDeclaredAnnotations(),
NormalScope.class) ||
                             AnnotationUtil.hasMetaAnnotation(stero.getDeclaredAnnotations(),
Scope.class))
                     {                        
-                        Annotation next = null;
+                        Annotation next;
                         
                         if(containsNormal)
                         {
@@ -1196,7 +1194,7 @@ public final class DefinitionUtil
      */
     public static void defineDecoratorStack(AbstractInjectionTargetBean<?> bean)
     {
-        WebBeansDecoratorConfig.configureDecarotors((AbstractInjectionTargetBean<Object>)bean);
+        WebBeansDecoratorConfig.configureDecarotors(bean);
     }
 
     public static <T> Set<ObserverMethod<?>> defineObserverMethods(InjectionTargetBean<T>
component, Class<T> clazz)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
Tue Mar 22 13:50:35 2011
@@ -196,7 +196,7 @@ public abstract class AbstractContext im
     @SuppressWarnings("unchecked")
     protected <T> T getInstance(Contextual<T> contextual, CreationalContext<T>
creationalContext)
     {
-        T instance = null;
+        T instance;
         
         //Look for bag
         BeanInstanceBag<T> bag = (BeanInstanceBag<T>)componentInstanceMap.get(contextual);
       
@@ -266,7 +266,7 @@ public abstract class AbstractContext im
         Set<Entry<Contextual<?>, BeanInstanceBag<?>>> entrySet =
componentInstanceMap.entrySet();
         Iterator<Entry<Contextual<?>, BeanInstanceBag<?>>> it = entrySet.iterator();
 
-        Contextual<?> contextual = null;
+        Contextual<?> contextual;
         while (it.hasNext())
         {
             contextual = it.next().getKey();

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
Tue Mar 22 13:50:35 2011
@@ -65,10 +65,10 @@ public class ConversationContext extends
         Contextual<?> contextual = null;
         while(it.hasNext()) 
         {
-            String id = (String)it.next();
+            String id = it.next();
             if (id != null)
             {
-                contextual = (Contextual<?>) org.apache.webbeans.config.WebBeansContext.currentInstance().getBeanManagerImpl().getPassivationCapableBean(id);
+                contextual = org.apache.webbeans.config.WebBeansContext.currentInstance().getBeanManagerImpl().getPassivationCapableBean(id);
             }
             if (contextual != null) 
             {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
Tue Mar 22 13:50:35 2011
@@ -231,7 +231,7 @@ public class ConversationManager
                     {
                         if(logger.wblWillLogInfo())
                         {
-                            logger.info(logger.getTokenString(OWBLogConst.INFO_0011),new
Object[]{conv.getId()});
+                            logger.info(logger.getTokenString(OWBLogConst.INFO_0011),conv.getId());
                         }
                         ctx.destroy();
                     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AnnotationDB.java
Tue Mar 22 13:50:35 2011
@@ -343,7 +343,7 @@ public class AnnotationDB implements Ser
     public void scanClass(InputStream bits) throws IOException
     {
         DataInputStream dstream = new DataInputStream(new BufferedInputStream(bits));
-        ClassFile cf = null;
+        ClassFile cf;
         try
         {
             cf = new ClassFile(dstream);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java
Tue Mar 22 13:50:35 2011
@@ -108,7 +108,7 @@ public class StereoTypeModel implements 
                 {
                     if(logger.wblWillLogWarn())
                     {
-                        logger.warn(OWBLogConst.WARN_0017, new Object[]{clazz.getName(),qualifier.annotationType().getName()});
+                        logger.warn(OWBLogConst.WARN_0017, clazz.getName(),qualifier.annotationType().getName());
                     }
                 }
             }            

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/AbstractInjectable.java
Tue Mar 22 13:50:35 2011
@@ -90,12 +90,12 @@ public abstract class AbstractInjectable
      */
     public <T> Object inject(InjectionPoint injectionPoint)
     {
-        Object injected = null;
+        Object injected;
 
         //Injected contextual beam
         InjectionResolver instance = injectionOwnerBean.getWebBeansContext().getBeanManagerImpl().getInjectionResolver();
 
-        Bean<?> injectedBean = (Bean<?>) instance.getInjectionPointBean(injectionPoint);
+        Bean<?> injectedBean = instance.getInjectionPointBean(injectionPoint);
         if(isInstanceProviderInjection(injectionPoint))
         {
             InstanceBean.local.set(injectionPoint);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/OWBInjector.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/OWBInjector.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/OWBInjector.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/OWBInjector.java
Tue Mar 22 13:50:35 2011
@@ -122,7 +122,7 @@ public final class OWBInjector implement
                 return this;
             }
             
-            AnnotatedType<Object> annotated = (AnnotatedType<Object>) beanManager.createAnnotatedType(injectableComponentClass);
+            AnnotatedType<Object> annotated = beanManager.createAnnotatedType(injectableComponentClass);
             Set<InjectionPoint> injectionPoints = WebBeansAnnotatedTypeUtil.getJavaEeComponentInstanceInjectionPoints(webBeansContext,
annotated);
             if(injectionPoints != null && injectionPoints.size() > 0)
             {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/impl/InjectionPointImpl.java
Tue Mar 22 13:50:35 2011
@@ -265,7 +265,7 @@ class InjectionPointImpl implements Inje
             }
 
             AnnotatedType<Object> annotatedType = (AnnotatedType<Object>)annotatedElementFactory.newAnnotatedType(beanClass);
-            AnnotatedConstructor<Object> am =  (AnnotatedConstructor<Object>)annotatedElementFactory
+            AnnotatedConstructor<Object> am =  annotatedElementFactory
                                             .newAnnotatedConstructor((Constructor<Object>)this.injectionMember,annotatedType);
             List<AnnotatedParameter<Object>> annParameters = am.getParameters();
             

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/webbeans/WebBeansInterceptor.java
Tue Mar 22 13:50:35 2011
@@ -407,7 +407,7 @@ public class WebBeansInterceptor<T> exte
         Method method = getMethod(type);
         try
         {
-            method.invoke(instance,new Object[]{ctx});
+            method.invoke(instance, ctx);
         }
         catch (Exception e)
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/AbstractLifeCycle.java
Tue Mar 22 13:50:35 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.webbeans.lifecycle;
 
-import java.lang.annotation.Annotation;
 import java.util.Properties;
 
 import javax.enterprise.context.ApplicationScoped;
@@ -144,7 +143,7 @@ public abstract class AbstractLifeCycle 
             this.contextsService.startContext(ApplicationScoped.class, endObject);
             
             //Fire shut down
-            this.beanManager.fireEvent(new BeforeShutdownImpl(), new Annotation[0]);
+            this.beanManager.fireEvent(new BeforeShutdownImpl() );
             
             //Destroys context
             this.contextsService.destroy(endObject);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AbstractAnnotated.java
Tue Mar 22 13:50:35 2011
@@ -151,7 +151,7 @@ abstract class AbstractAnnotated impleme
             Annotation[] anns = annotations.toArray(new Annotation[annotations.size()]);
             if(AnnotationUtil.hasAnnotation(anns, Typed.class))
             {
-                Typed beanTypes = (Typed) AnnotationUtil.getAnnotation(anns, Typed.class);
+                Typed beanTypes = AnnotationUtil.getAnnotation(anns, Typed.class);
                 Class<?>[] types = beanTypes.value();
 
                 //New api types

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedElementFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedElementFactory.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedElementFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/AnnotatedElementFactory.java
Tue Mar 22 13:50:35 2011
@@ -149,7 +149,7 @@ public final class AnnotatedElementFacto
         Asserts.assertNotNull(constructor, "constructor is null");
         Asserts.assertNotNull(declaringClass, "declaringClass is null");
         
-        AnnotatedConstructorImpl<X> annConstructor = null;
+        AnnotatedConstructorImpl<X> annConstructor;
         if(annotatedConstructorCache.containsKey(constructor))
         {
             annConstructor = (AnnotatedConstructorImpl<X>)annotatedConstructorCache.get(constructor);
@@ -181,7 +181,7 @@ public final class AnnotatedElementFacto
         Asserts.assertNotNull(field, "field is null");
         Asserts.assertNotNull(declaringClass, "declaringClass is null");
         
-        AnnotatedFieldImpl<X> annotField = null;
+        AnnotatedFieldImpl<X> annotField;
         if(annotatedFieldCache.containsKey(field))
         {
             annotField = (AnnotatedFieldImpl<X>)annotatedFieldCache.get(field);
@@ -213,7 +213,7 @@ public final class AnnotatedElementFacto
         Asserts.assertNotNull(method, "method is null");
         Asserts.assertNotNull(declaringType, "declaringType is null");
         
-        AnnotatedMethodImpl<X> annotMethod = null;
+        AnnotatedMethodImpl<X> annotMethod;
         if(annotatedMethodCache.containsKey(method))
         {
             annotMethod = (AnnotatedMethodImpl<X>)annotatedMethodCache.get(method);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java
Tue Mar 22 13:50:35 2011
@@ -68,7 +68,7 @@ public abstract class AbstractProducer<T
     @SuppressWarnings("unchecked")
     public T produce(CreationalContext<T> creationalContext)
     {
-        T instance = null;
+        T instance;
         if(!(creationalContext instanceof CreationalContextImpl))
         {
             creationalContext = bean.getWebBeansContext().getCreationalContextFactory().wrappedCreationalContext(creationalContext,
this.bean);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
Tue Mar 22 13:50:35 2011
@@ -133,7 +133,7 @@ public final class AnnotationUtil
         Asserts.nullCheckForClass(clazz);
 
         List<Type> list = new ArrayList<Type>();
-        Type[] result = null;
+        Type[] result;
 
         Annotation[][] parameterAnns = method.getParameterAnnotations();
         Type[] genericTypes = method.getGenericParameterTypes();
@@ -167,7 +167,7 @@ public final class AnnotationUtil
         Asserts.nullCheckForClass(clazz);
 
         List<Type> list = new ArrayList<Type>();
-        Type[] result = null;
+        Type[] result;
 
         Annotation[][] parameterAnns = constructor.getParameterAnnotations();
         Type[] genericTypes = constructor.getGenericParameterTypes();
@@ -524,8 +524,8 @@ public final class AnnotationUtil
      */
     private static boolean checkEquality(Object value1, Object value2)
     {
-        if ((value1 == null && value2 != null)
-                || (value1 != null && value2 == null))
+        if ((value1 == null && value2 != null) ||
+            (value1 != null && value2 == null))
         {
             return false;
         }
@@ -748,7 +748,7 @@ public final class AnnotationUtil
 
         Method[] methods = SecurityUtil.doPrivilegedGetDeclaredMethods(clazz);
         List<Method> list = new ArrayList<Method>();
-        Method[] rMethod = null;
+        Method[] rMethod  ;
 
         for (Method m : methods)
         {
@@ -847,7 +847,7 @@ public final class AnnotationUtil
     public static Annotation[] getMetaAnnotations(Annotation[] anns, Class<? extends Annotation>
metaAnnotation)
     {
         List<Annotation> annots = new ArrayList<Annotation>();
-        Annotation[] result = null;
+        Annotation[] result;
         Asserts.assertNotNull(anns, "Anns argument can not be null");
         Asserts.assertNotNull(metaAnnotation, "MetaAnnotation argument can not be null");
 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
Tue Mar 22 13:50:35 2011
@@ -94,7 +94,7 @@ public final class ClassUtil
             Throwable cause = e;
             if(e instanceof PrivilegedActionException)
             {
-                cause = ((PrivilegedActionException)e).getCause();
+                cause = e.getCause();
             }
             
             String error = "Error is occured while creating an instance of class : " + clazz.getName();


Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Tue Mar 22 13:50:35 2011
@@ -1911,7 +1911,7 @@ public final class WebBeansUtil
 
     private <T> Constructor<T> getNoArgConstructor(Class<T> clazz)
     {
-        return webBeansContext.getSecurityService().doPrivilegedGetDeclaredConstructor(clazz,
new Class<?>[] {});
+        return webBeansContext.getSecurityService().doPrivilegedGetDeclaredConstructor(clazz);
     }
 
     public static void checkNullable(Class<?> type, AbstractOwbBean<?> component)
@@ -2069,7 +2069,7 @@ public final class WebBeansUtil
 
             if (component != null)
             {
-                webBeansContext.getWebBeansInterceptorConfig().configureInterceptorClass((ManagedBean<Object>)
component,
+                webBeansContext.getWebBeansInterceptorConfig().configureInterceptorClass(component,
                         webBeansContext.getAnnotationManager().getInterceptorBindingMetaAnnotations(
                                 clazz.getDeclaredAnnotations()));
             }
@@ -2109,7 +2109,7 @@ public final class WebBeansUtil
 
             if (delegate != null)
             {
-                WebBeansDecoratorConfig.configureDecoratorClass((ManagedBean<Object>)
delegate);
+                WebBeansDecoratorConfig.configureDecoratorClass(delegate);
             }
             else
             {
@@ -2841,7 +2841,7 @@ public final class WebBeansUtil
 
             //Fires ProcessManagedBean
             ProcessBeanImpl<T> processBeanEvent = new GProcessManagedBean(managedBean,
annotatedType);
-            beanManager.fireEvent(processBeanEvent, new Annotation[0]);
+            beanManager.fireEvent(processBeanEvent);
             inspectErrorStack("There are errors that are added by ProcessManagedBean event
observers for " +
                     "managed beans. Look at logs for further details");
 
@@ -2886,7 +2886,7 @@ public final class WebBeansUtil
 
             //Fires ProcessManagedBean
             ProcessBeanImpl<T> processBeanEvent = new GProcessManagedBean(managedBean,
annotatedType);
-            beanManager.fireEvent(processBeanEvent, new Annotation[0]);
+            beanManager.fireEvent(processBeanEvent);
             inspectErrorStack("There are errors that are added by ProcessManagedBean event
observers for " +
                     "managed beans. Look at logs for further details");
             if(!isAnnotatedTypeDecoratorOrInterceptor(annotatedType))

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
Tue Mar 22 13:50:35 2011
@@ -74,7 +74,7 @@ public class ExtensionTest extends Abstr
         Assert.assertTrue(getBeanManager().isPassivatingScope(ExternalTestScoped.class));
         
         //Fire shut down
-        getBeanManager().fireEvent(new BeforeShutdownImpl(), new Annotation[0]);
+        getBeanManager().fireEvent(new BeforeShutdownImpl());
 
         webBeansContext.getContextFactory().destroyApplicationContext(null);
 

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/service/TypedInjection.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/service/TypedInjection.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/service/TypedInjection.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/service/TypedInjection.java
Tue Mar 22 13:50:35 2011
@@ -33,7 +33,7 @@ public class TypedInjection implements S
 
     public ITyped2<String, Object> getV()
     {
-        return (ITyped2<String, Object>) v;
+        return v;
     }
 
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java?rev=1084178&r1=1084177&r2=1084178&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PreDestroyComponentTest.java
Tue Mar 22 13:50:35 2011
@@ -74,7 +74,7 @@ public class PreDestroyComponentTest ext
         Assert.assertTrue(object instanceof CheckWithCheckPayment);
         Assert.assertTrue(object2 instanceof PreDestroyComponent);
 
-        PreDestroyComponent pcc = (PreDestroyComponent) object2;
+        PreDestroyComponent pcc = object2;
         CheckWithCheckPayment payment = (CheckWithCheckPayment) pcc.getP();
         payment.setValue(true);
 



Mime
View raw message