openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1368981 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/component/ webbeans-impl/src/main/java/org/apache/webbeans/context/ webbeans-impl/src/main/java/org/apache/webbeans/conversation/ webbeans-impl/src/main/java...
Date Fri, 03 Aug 2012 14:31:18 GMT
Author: struberg
Date: Fri Aug  3 14:31:17 2012
New Revision: 1368981

URL: http://svn.apache.org/viewvc?rev=1368981&view=rev
Log:
OWB-691 review 'hidden' variables reported by sonar

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/SessionContextManager.java
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java?rev=1368981&r1=1368980&r2=1368981&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
Fri Aug  3 14:31:17 2012
@@ -681,8 +681,8 @@ public abstract class AbstractOwbBean<T>
     {
         if(isPassivationCapable())
         {
-            Set<InjectionPoint> injectionPoints = getInjectionPoints();
-            for(InjectionPoint injectionPoint : injectionPoints)
+            Set<InjectionPoint> beanInjectionPoints = getInjectionPoints();
+            for(InjectionPoint injectionPoint : beanInjectionPoints)
             {
                 if(!injectionPoint.isTransient())
                 {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java?rev=1368981&r1=1368980&r2=1368981&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
Fri Aug  3 14:31:17 2012
@@ -35,6 +35,7 @@ import org.apache.webbeans.config.WebBea
 /**
  * JSR-299 based standard context
  * related operations.
+ * @deprecated user should use the ContextsService directly.
  */
 public final class ContextFactory
 {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=1368981&r1=1368980&r2=1368981&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
Fri Aug  3 14:31:17 2012
@@ -163,7 +163,6 @@ public class ConversationImpl implements
     public void begin(String id)
     {   
         //Look at other conversation, that may collate with this is
-        final WebBeansContext webBeansContext = this.webBeansContext;
         final ConversationManager conversationManager = webBeansContext.getConversationManager();
         if(conversationManager.isConversationExistWithGivenId(id))
         {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java?rev=1368981&r1=1368980&r2=1368981&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
Fri Aug  3 14:31:17 2012
@@ -336,16 +336,12 @@ public class ObserverMethodImpl<T> imple
         AnnotatedElementFactory annotatedElementFactory = webBeansContext.getAnnotatedElementFactory();
         AnnotationManager annotationManager = webBeansContext.getAnnotationManager();
 
-        //Define annotated parameter
-        AnnotatedType<T> annotatedType = (AnnotatedType<T>) annotatedElementFactory.newAnnotatedType(bean.getReturnType());
-        AnnotatedMethod<T> annotatedMethod = annotatedElementFactory.newAnnotatedMethod(observerMethod,
annotatedType);
-        
         Type[] types = observerMethod.getGenericParameterTypes();
         Annotation[][] annots = observerMethod.getParameterAnnotations();
         List<ObserverParams> list = new ArrayList<ObserverParams>();
 
         BeanManagerImpl manager = webBeansContext.getBeanManagerImpl();
-        ObserverParams param = null;
+        ObserverParams param;
         if (types.length > 0)
         {
             int i = 0;
@@ -381,9 +377,13 @@ public class ObserverMethodImpl<T> imple
                     
                     //Get parameter annotations
                     Annotation[] bindingTypes = annotationManager.getQualifierAnnotations(annot);
-                    
+
+                    //Define annotated parameter
+                    AnnotatedType<T> annotatedType = (AnnotatedType<T>) annotatedElementFactory.newAnnotatedType(bean.getReturnType());
+                    AnnotatedMethod<T> newAnnotatedMethod = annotatedElementFactory.newAnnotatedMethod(observerMethod,
annotatedType);
+
                     //Annotated parameter
-                    AnnotatedParameter<T> annotatedParameter = annotatedMethod.getParameters().get(i);
+                    AnnotatedParameter<T> annotatedParameter = newAnnotatedMethod.getParameters().get(i);
                     
                     //Creating injection point
                     InjectionPoint point = InjectionPointFactory.getPartialInjectionPoint(bean,
type, observerMethod, annotatedParameter, bindingTypes);

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/SessionContextManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/SessionContextManager.java?rev=1368981&r1=1368980&r2=1368981&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/SessionContextManager.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/SessionContextManager.java
Fri Aug  3 14:31:17 2012
@@ -91,16 +91,16 @@ public class SessionContextManager
     public void destroyAllSessions()
     {
         //Destroy all contexts
-        Collection<SessionContext> sessionContexts = this.sessionContexts.values();
-        if(sessionContexts != null && sessionContexts.size() > 0)
+        Collection<SessionContext> allSessionContexts = this.sessionContexts.values();
+        if(allSessionContexts != null && allSessionContexts.size() > 0)
         {
-            for(SessionContext sessionContext : sessionContexts)
+            for(SessionContext sessionContext : allSessionContexts)
             {
                 sessionContext.destroy();
             }
 
         //Clear map
-        sessionContexts.clear();
+        allSessionContexts.clear();
         }
     }
 }

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java?rev=1368981&r1=1368980&r2=1368981&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
Fri Aug  3 14:31:17 2012
@@ -408,7 +408,6 @@ public class WebContextsService extends 
             return;
         }
 
-        ConversationManager conversationManager = webBeansContext.getConversationManager();
         Conversation conversation = conversationManager.getConversationBeanReference();
 
         if (conversation == null)



Mime
View raw message