deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [1/2] git commit: DELTASPIKE-487 removed unused logic
Date Thu, 27 Feb 2014 22:37:32 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 2983608b2 -> 4ff33b15b


DELTASPIKE-487 removed unused logic

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/8d23e100
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/8d23e100
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/8d23e100

Branch: refs/heads/master
Commit: 8d23e100b3603eb31d2d3b77d7bbb9c775b270b9
Parents: 2983608
Author: tommy <tommy@tommy-notebook>
Authored: Thu Feb 27 23:29:57 2014 +0100
Committer: tommy <tommy@tommy-notebook>
Committed: Thu Feb 27 23:29:57 2014 +0100

----------------------------------------------------------------------
 .../impl/scope/viewaccess/ViewAccessContext.java     | 15 ++-------------
 .../viewaccess/ViewAccessScopedBeanHistory.java      | 12 ------------
 .../listener/request/DeltaSpikeLifecycleWrapper.java |  2 +-
 3 files changed, 3 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/8d23e100/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
index ba6d90c..701e4d0 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessContext.java
@@ -19,8 +19,6 @@
 package org.apache.deltaspike.core.impl.scope.viewaccess;
 
 import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Map;
 import javax.enterprise.context.ContextNotActiveException;
 import javax.enterprise.context.spi.Contextual;
@@ -115,28 +113,19 @@ public class ViewAccessContext extends AbstractContext
             destroyExpiredBeans();
             
             // clear list from last request
-            List<String> lastAccessedBeans = viewAccessScopedBeanHistory.getLastAccessedBeans();
-            lastAccessedBeans.clear();
-            
-            // move used beans from this request to last request
-            viewAccessScopedBeanHistory.setLastAccessedBeans(viewAccessScopedBeanHistory.getAccessedBeans());
-            viewAccessScopedBeanHistory.setAccessedBeans(lastAccessedBeans);
+            viewAccessScopedBeanHistory.getAccessedBeans().clear();
         }
     }
     
     private void destroyExpiredBeans()
     {
-        List<String> usedBeans = new ArrayList<String>();
-        usedBeans.addAll(viewAccessScopedBeanHistory.getAccessedBeans());
-        usedBeans.addAll(viewAccessScopedBeanHistory.getLastAccessedBeans());
-
         ContextualStorage storage =
                 viewAccessScopedBeanHolder.getContextualStorage(beanManager, getCurrentWindowId(),
false);
         if (storage != null)
         {
             for (Map.Entry<Object, ContextualInstanceInfo<?>> storageEntry :
storage.getStorage().entrySet())
             {
-                if (!usedBeans.contains((String) storageEntry.getKey()))
+                if (!viewAccessScopedBeanHistory.getAccessedBeans().contains((String) storageEntry.getKey()))
                 {
                     Contextual bean = storage.getBean(storageEntry.getKey());
                     AbstractContext.destroyBean(bean, storageEntry.getValue());

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/8d23e100/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
index b422f07..06ddbe9 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/viewaccess/ViewAccessScopedBeanHistory.java
@@ -30,13 +30,11 @@ public class ViewAccessScopedBeanHistory implements Serializable
     private static final long serialVersionUID = 3617603930728148927L;
     
     private List<String> accessedBeans;
-    private List<String> lastAccessedBeans;
     private String lastView;
 
     public ViewAccessScopedBeanHistory()
     {
         accessedBeans = new ArrayList<String>();
-        lastAccessedBeans = new ArrayList<String>();
     }
     
     public List<String> getAccessedBeans()
@@ -49,16 +47,6 @@ public class ViewAccessScopedBeanHistory implements Serializable
         this.accessedBeans = accessedBeans;
     }
 
-    public List<String> getLastAccessedBeans()
-    {
-        return lastAccessedBeans;
-    }
-
-    public void setLastAccessedBeans(List<String> lastAccessedBeans)
-    {
-        this.lastAccessedBeans = lastAccessedBeans;
-    }
-
     public String getLastView()
     {
         return lastView;

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/8d23e100/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java
index 7e610f1..ef8ef57 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/request/DeltaSpikeLifecycleWrapper.java
@@ -110,7 +110,7 @@ class DeltaSpikeLifecycleWrapper extends Lifecycle
     {
         this.wrapped.render(facesContext);
         
-        if (!facesContext.isPostback() && facesContext.getViewRoot() != null)
+        if (facesContext.getViewRoot() != null)
         {
             ViewAccessContext viewAccessContext = contextExtension.getViewAccessScopedContext();
             if (viewAccessContext != null)


Mime
View raw message