myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] 01/02: cosmetics
Date Fri, 02 Aug 2019 11:28:02 GMT
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 6f5cf6b93e7050d80becb4e74013a8af5d55fbaf
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Fri Aug 2 13:15:02 2019 +0200

    cosmetics
---
 .../apache/myfaces/application/ResourceHandlerImpl.java   |  2 +-
 .../java/org/apache/myfaces/cdi/FacesScopeBeanHolder.java |  2 +-
 .../myfaces/cdi/view/ViewTransientScopeBeanHolder.java    |  4 ++--
 .../tag/jsf/ComponentRelocatableResourceHandler.java      |  5 +++--
 .../myfaces/view/facelets/tag/jsf/ComponentSupport.java   | 15 +++++++--------
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java b/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
index 5f6c48e..b32f2c3 100644
--- a/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
@@ -1827,7 +1827,7 @@ public class ResourceHandlerImpl extends ResourceHandler
         if (map == null)
         {
             map = new HashMap<>();
-            facesContext.getViewRoot().getTransientStateHelper().putTransient(RENDERED_RESOURCES_SET,map);
+            facesContext.getViewRoot().getTransientStateHelper().putTransient(RENDERED_RESOURCES_SET,
map);
         }
         return map;
     }
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 4e5e244..64aebe1 100644
--- a/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeBeanHolder.java
+++ b/impl/src/main/java/org/apache/myfaces/cdi/FacesScopeBeanHolder.java
@@ -82,7 +82,7 @@ public class FacesScopeBeanHolder
             map = (Map<Object, Object>) info.getContextualInstance();
             if (map == null)
             {
-                map = new HashMap<Object,Object>();
+                map = new HashMap<>();
                 info.setContextualInstance(map);
             }
         }
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 11e70cc..1b87a0a 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
@@ -72,13 +72,13 @@ public class ViewTransientScopeBeanHolder
             ContextualInstanceInfo info = contextualStorage.getStorage().get(VIEW_TRANSIENT_SCOPE_MAP_INFO);
             if (info == null)
             {
-                info = new ContextualInstanceInfo<Object>();
+                info = new ContextualInstanceInfo<>();
                 contextualStorage.getStorage().put(VIEW_TRANSIENT_SCOPE_MAP_INFO, info);
             }
             map = (Map<Object, Object>) info.getContextualInstance();
             if (map == null)
             {
-                map = new HashMap<Object,Object>();
+                map = new HashMap<>();
                 info.setContextualInstance(map);
             }
         }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentRelocatableResourceHandler.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentRelocatableResourceHandler.java
index 1490e5b..409efe3 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentRelocatableResourceHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentRelocatableResourceHandler.java
@@ -35,10 +35,10 @@ public class ComponentRelocatableResourceHandler implements RelocatableResourceH
     public static final ComponentRelocatableResourceHandler INSTANCE = new ComponentRelocatableResourceHandler();
     
     @Override
-    public UIComponent findChildByTagId(FaceletContext ctx, UIComponent parent,
-            String id)
+    public UIComponent findChildByTagId(FaceletContext ctx, UIComponent parent, String id)
     {
         UIComponent c = null;
+        
         UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent);
         if (root.getFacetCount() > 0)
         {
@@ -49,6 +49,7 @@ public class ComponentRelocatableResourceHandler implements RelocatableResourceH
                 c = ComponentSupport.findChildByTagId(facet, id);
             }
         }
+        
         return c;
     }
     
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
index 34a51e5..cc8f85b 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java
@@ -496,11 +496,13 @@ public final class ComponentSupport
         // doing the same trick as with metadata: use a double __ and add a prefix (f).
         // Note this id will never be printed into the response, because this is just a container.
         FaceletCompositionContext mctx = FaceletCompositionContext.getCurrentInstance(ctx);
+
         UniqueIdVendor uniqueIdVendor = mctx.getUniqueIdVendorFromStack();
         if (uniqueIdVendor == null)
         {
             uniqueIdVendor = ComponentSupport.getViewRoot(ctx, parent);
         }
+
         if (uniqueIdVendor != null)
         {
             // UIViewRoot implements UniqueIdVendor, so there is no need to cast to UIViewRoot
@@ -517,8 +519,10 @@ public final class ComponentSupport
                       .append("__f_")
                       .append(cleanFacetName).toString()));
         }
+
         panel.getAttributes().put(FACET_CREATED_UIPANEL_MARKER, Boolean.TRUE);
         panel.getAttributes().put(ComponentSupport.COMPONENT_ADDED_BY_HANDLER_MARKER, Boolean.TRUE);
+
         return panel;
     }
     
@@ -600,8 +604,7 @@ public final class ComponentSupport
         int separator = expr.indexOf(separatorChar);
         if (separator == -1)
         {
-            return ComponentSupport.findComponentChildOrFacetFrom(
-                    parent, expr, null);
+            return ComponentSupport.findComponentChildOrFacetFrom(parent, expr, null);
         }
         else
         {
@@ -728,12 +731,8 @@ public final class ComponentSupport
         if (fcc.isUsingPSSOnThisView() && !fcc.isRefreshTransientBuildOnPSSPreserveState())
         {
             UIViewRoot root = getViewRoot(ctx, parent);
-            FaceletState map = (FaceletState) root.getAttributes().get(FACELET_STATE_INSTANCE);
-            if (map == null)
-            {
-                map = new FaceletState();
-                root.getAttributes().put(FACELET_STATE_INSTANCE, map);
-            }
+            FaceletState map = (FaceletState) root.getAttributes().computeIfAbsent(FACELET_STATE_INSTANCE,
+                    k -> new FaceletState());
             map.putState(uniqueId, value);
         }
     }


Mime
View raw message