You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2019/05/14 20:35:22 UTC

[myfaces] branch master updated (674c1f6 -> b30181a)

This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git.


    from 674c1f6  cosmetics
     new 08fdebe  cosmetics
     new b30181a  cosmetics

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/myfaces/cdi/FacesScopeBeanHolder.java   |  2 +-
 .../java/org/apache/myfaces/cdi/FacesScopeContextImpl.java  | 10 +---------
 .../org/apache/myfaces/cdi/util/ContextualInstanceInfo.java | 13 -------------
 .../myfaces/cdi/view/ViewTransientScopeBeanHolder.java      |  8 ++++----
 .../myfaces/cdi/view/ViewTransientScopeContextImpl.java     | 11 ++---------
 .../org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java    |  9 +++------
 .../org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java  |  8 +-------
 7 files changed, 12 insertions(+), 49 deletions(-)


[myfaces] 01/02: cosmetics

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git

commit 08fdebef90c62851e0f938d9c887f70ceb2855f4
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Tue May 14 22:33:59 2019 +0200

    cosmetics
---
 .../java/org/apache/myfaces/cdi/FacesScopeBeanHolder.java   |  2 +-
 .../java/org/apache/myfaces/cdi/FacesScopeContextImpl.java  | 10 +---------
 .../org/apache/myfaces/cdi/util/ContextualInstanceInfo.java | 13 -------------
 .../myfaces/cdi/view/ViewTransientScopeBeanHolder.java      |  8 ++++----
 .../myfaces/cdi/view/ViewTransientScopeContextImpl.java     | 11 ++---------
 .../org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java    |  9 +++------
 .../org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java  | 10 ++--------
 7 files changed, 13 insertions(+), 50 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeBeanHolder.java b/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeBeanHolder.java
index ad0d793..f26ec09 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeBeanHolder.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeBeanHolder.java
@@ -50,7 +50,7 @@ public class FacesScopeBeanHolder
      * @param beanManager we need the CDI {@link BeanManager} for serialisation.
      * @param facesContext the current FacesContext instance
      */
-    public static ContextualStorage getContextualStorage(BeanManager beanManager, FacesContext facesContext)
+    public ContextualStorage getContextualStorage(BeanManager beanManager, FacesContext facesContext)
     {
         ContextualStorage contextualStorage = (ContextualStorage) facesContext.getAttributes().get(FACES_SCOPE_MAP);
         if (contextualStorage == null)
diff --git a/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeContextImpl.java b/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeContextImpl.java
index 5fcf5f1..39c4a3d 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeContextImpl.java
@@ -26,7 +26,6 @@ import javax.enterprise.context.spi.Contextual;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.Typed;
 import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.PassivationCapable;
 import javax.faces.context.FacesContext;
 import org.apache.myfaces.cdi.util.ContextualInstanceInfo;
 import org.apache.myfaces.cdi.util.ContextualStorage;
@@ -37,7 +36,6 @@ import org.apache.myfaces.cdi.util.ContextualStorage;
 @Typed()
 public class FacesScopeContextImpl implements Context
 {
-
     private BeanManager beanManager;
     
     public FacesScopeContextImpl(BeanManager beanManager)
@@ -65,7 +63,7 @@ public class FacesScopeContextImpl implements Context
     {
         if (facesContext == null)
         {
-            throw new ContextNotActiveException("FacesScopedContextImpl: no current active facesContext");
+            throw new ContextNotActiveException(this.getClass().getName() + ": no current active facesContext");
         }
 
         if (createIfNotExist)
@@ -134,12 +132,6 @@ public class FacesScopeContextImpl implements Context
         
         checkActive(facesContext);
 
-        if (!(bean instanceof PassivationCapable))
-        {
-            throw new IllegalStateException(bean.toString() +
-                    " doesn't implement " + PassivationCapable.class.getName());
-        }
-
         ContextualStorage storage = getContextualStorage(true, facesContext);
 
         Map<Object, ContextualInstanceInfo<?>> contextMap = storage.getStorage();
diff --git a/impl/src/main/java/org/apache/myfaces/cdi/util/ContextualInstanceInfo.java b/impl/src/main/java/org/apache/myfaces/cdi/util/ContextualInstanceInfo.java
index f3abe08..2f9dd74 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/util/ContextualInstanceInfo.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/util/ContextualInstanceInfo.java
@@ -42,36 +42,23 @@ public class ContextualInstanceInfo<T> implements Serializable
      */
     private CreationalContext<T> creationalContext;
 
-    /**
-     * @return the CreationalContext of the bean
-     */
     public CreationalContext<T> getCreationalContext()
     {
         return creationalContext;
     }
 
-    /**
-     * @param creationalContext the CreationalContext of the bean
-     */
     public void setCreationalContext(CreationalContext<T> creationalContext)
     {
         this.creationalContext = creationalContext;
     }
 
-    /**
-     * @return the contextual instance itself
-     */
     public T getContextualInstance()
     {
         return contextualInstance;
     }
 
-    /**
-     * @param contextualInstance the contextual instance itself
-     */
     public void setContextualInstance(T contextualInstance)
     {
         this.contextualInstance = contextualInstance;
     }
-
 }
diff --git a/impl/src/main/java/org/apache/myfaces/cdi/view/ViewTransientScopeBeanHolder.java b/impl/src/main/java/org/apache/myfaces/cdi/view/ViewTransientScopeBeanHolder.java
index 1eb24ce..11e70cc 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/view/ViewTransientScopeBeanHolder.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/view/ViewTransientScopeBeanHolder.java
@@ -42,7 +42,7 @@ public class ViewTransientScopeBeanHolder
     {
     }
     
-    public static ContextualStorage getContextualStorage(BeanManager beanManager, FacesContext facesContext)
+    public ContextualStorage getContextualStorage(BeanManager beanManager, FacesContext facesContext)
     {
         ContextualStorage contextualStorage = (ContextualStorage) 
                 facesContext.getViewRoot().getTransientStateHelper().getTransient(VIEW_TRANSIENT_SCOPE_MAP);
@@ -113,10 +113,10 @@ public class ViewTransientScopeBeanHolder
 
     public void destroyBeans(FacesContext facesContext)
     {
-        ContextualStorage oldWindowContextStorages = forceNewStorage(facesContext);
-        if (oldWindowContextStorages != null)
+        ContextualStorage oldontextStorages = forceNewStorage(facesContext);
+        if (oldontextStorages != null)
         {
-            ViewTransientScopeContextImpl.destroyAllActive(oldWindowContextStorages);
+            ViewTransientScopeContextImpl.destroyAllActive(oldontextStorages);
         }
     }
 
diff --git a/impl/src/main/java/org/apache/myfaces/cdi/view/ViewTransientScopeContextImpl.java b/impl/src/main/java/org/apache/myfaces/cdi/view/ViewTransientScopeContextImpl.java
index 91bd7e6..227e5b6 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/view/ViewTransientScopeContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/view/ViewTransientScopeContextImpl.java
@@ -26,13 +26,12 @@ import javax.enterprise.context.spi.Contextual;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.Typed;
 import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.PassivationCapable;
 import javax.faces.context.FacesContext;
 import org.apache.myfaces.cdi.util.ContextualInstanceInfo;
 import org.apache.myfaces.cdi.util.ContextualStorage;
 
 /**
- * Minimal implementation of FacesScope.
+ * Minimal implementation of ViewTransientScope.
  */
 @Typed()
 public class ViewTransientScopeContextImpl implements Context
@@ -65,7 +64,7 @@ public class ViewTransientScopeContextImpl implements Context
     {
         if (facesContext == null)
         {
-            throw new ContextNotActiveException("FacesScopedContextImpl: no current active facesContext");
+            throw new ContextNotActiveException(this.getClass().getName() + ": no current active facesContext");
         }
 
         if (createIfNotExist)
@@ -139,12 +138,6 @@ public class ViewTransientScopeContextImpl implements Context
         
         checkActive(facesContext);
 
-        if (!(bean instanceof PassivationCapable))
-        {
-            throw new IllegalStateException(bean.toString() +
-                    " doesn't implement " + PassivationCapable.class.getName());
-        }
-
         ContextualStorage storage = getContextualStorage(true, facesContext);
 
         Map<Object, ContextualInstanceInfo<?>> contextMap = storage.getStorage();
diff --git a/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java b/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java
index 946c308..c545b7d 100644
--- a/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java
+++ b/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java
@@ -230,8 +230,7 @@ public class FlowScopeBeanHolder implements Serializable
                     servletContext = null;
                 }
             }
-            if (facesContext == null &&
-                servletContext != null)
+            if (facesContext == null && servletContext != null)
             {
                 try
                 {
@@ -300,10 +299,8 @@ public class FlowScopeBeanHolder implements Serializable
         {
             return Collections.emptyList();
         }
-        else
-        {
-            return activeFlowKeys;
-        }
+
+        return activeFlowKeys;
     }
     
     public void createCurrentFlowScope(FacesContext facesContext)
diff --git a/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java b/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java
index f6749d1..071c5b1 100644
--- a/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java
@@ -106,12 +106,10 @@ public class FlowScopedContextImpl implements Context
      * @return the underlying storage
      */
     protected ContextualStorage getContextualStorage(boolean createIfNotExist, String clientWindowFlowId)
-    {
-        //FacesContext facesContext = FacesContext.getCurrentInstance();
-        //String clientWindowFlowId = getCurrentClientWindowFlowId(facesContext);
+    {;
         if (clientWindowFlowId == null)
         {
-            throw new ContextNotActiveException("FlowScopedContextImpl: no current active flow");
+            throw new ContextNotActiveException(this.getClass().getName() + ": no current active flow");
         }
 
         if (createIfNotExist)
@@ -163,7 +161,6 @@ public class FlowScopedContextImpl implements Context
 
         checkActive(facesContext);
 
-        
         FlowReference reference = flowBeanReferences.get(((Bean)bean).getBeanClass());
         if (reference != null)
         {
@@ -203,7 +200,6 @@ public class FlowScopedContextImpl implements Context
             ContextualInstanceInfo<?> contextualInstanceInfo = contextMap.get(storage.getBeanKey(bean));
             if (contextualInstanceInfo == null)
             {
-                //return null;
                 continue;
             }
 
@@ -337,14 +333,12 @@ public class FlowScopedContextImpl implements Context
             ContextualStorage storage = getContextualStorage(false, flowMapKey);
             if (storage == null)
             {
-                //return false;
                 continue;
             }
             ContextualInstanceInfo<?> contextualInstanceInfo = storage.getStorage().get(storage.getBeanKey(bean));
 
             if (contextualInstanceInfo == null)
             {
-                //return false;
                 continue;
             }
 


[myfaces] 02/02: cosmetics

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git

commit b30181acb2147c4149408e2264bc8d47aebecf35
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Tue May 14 22:35:22 2019 +0200

    cosmetics
---
 .../main/java/org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java b/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java
index 071c5b1..4a768cf 100644
--- a/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/flow/cdi/FlowScopedContextImpl.java
@@ -106,7 +106,7 @@ public class FlowScopedContextImpl implements Context
      * @return the underlying storage
      */
     protected ContextualStorage getContextualStorage(boolean createIfNotExist, String clientWindowFlowId)
-    {;
+    {
         if (clientWindowFlowId == null)
         {
             throw new ContextNotActiveException(this.getClass().getName() + ": no current active flow");