myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject [myfaces] branch master updated: cosmetics
Date Fri, 02 Aug 2019 11:33:14 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


The following commit(s) were added to refs/heads/master by this push:
     new 52c691e  cosmetics
52c691e is described below

commit 52c691ecb11b2cef3889bd13fb7b55027ba95d6e
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Fri Aug 2 13:33:07 2019 +0200

    cosmetics
---
 .../flow/builder/NavigationCaseBuilderImpl.java     | 12 +++---------
 .../tag/ComponentTagDeclarationLibrary.java         | 21 +++------------------
 2 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/flow/builder/NavigationCaseBuilderImpl.java
b/impl/src/main/java/org/apache/myfaces/flow/builder/NavigationCaseBuilderImpl.java
index 35e5163..866169d 100644
--- a/impl/src/main/java/org/apache/myfaces/flow/builder/NavigationCaseBuilderImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/flow/builder/NavigationCaseBuilderImpl.java
@@ -114,24 +114,19 @@ public class NavigationCaseBuilderImpl extends NavigationCaseBuilder
     
     public class RedirectBuilderImpl extends RedirectBuilder
     {
-
         @Override
         public RedirectBuilder parameter(String name, String value)
         {
-            //_navigationCaseImpl.
             Map<String, List<String>> map = _navigationCaseImpl.getParameters();
             if (map == null)
             {
                 map = new HashMap<String, List<String>>();
                 _navigationCaseImpl.setParameters(map);
             }
-            List<String> values = map.get(name);
-            if (values == null)
-            {
-                values = new ArrayList<String>();
-                map.put(name, values);
-            }
+            
+            List<String> values = map.computeIfAbsent(name, k -> new ArrayList<>());
             values.add(value);
+
             return this;
         }
 
@@ -141,6 +136,5 @@ public class NavigationCaseBuilderImpl extends NavigationCaseBuilder
             _navigationCaseImpl.setIncludeViewParams(true);
             return this;
         }
-        
     }
 }
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ComponentTagDeclarationLibrary.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ComponentTagDeclarationLibrary.java
index db077fe..5c155cf 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ComponentTagDeclarationLibrary.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ComponentTagDeclarationLibrary.java
@@ -90,12 +90,7 @@ public class ComponentTagDeclarationLibrary implements TagLibrary
     {
         if (containsNamespace(ns))
         {
-            Map<String, TagHandlerFactory> map = _factories.get(ns);
-            if (map == null)
-            {
-                map = new HashMap<String, TagHandlerFactory>();
-                _factories.put(ns, map);
-            }
+            Map<String, TagHandlerFactory> map = _factories.computeIfAbsent(ns, k ->
new HashMap<>());
             TagHandlerFactory f = map.get(localName);
             if (f != null)
             {
@@ -142,12 +137,7 @@ public class ComponentTagDeclarationLibrary implements TagLibrary
      */
     public final void addComponent(String namespace, String name, String componentType, String
rendererType)
     {
-        Map<String, TagHandlerFactory> map = _factories.get(namespace);
-        if (map == null)
-        {
-            map = new HashMap<String, TagHandlerFactory>();
-            _factories.put(namespace, map);
-        }
+        Map<String, TagHandlerFactory> map = _factories.computeIfAbsent(namespace,
k -> new HashMap<>());
         map.put(name, new ComponentHandlerFactory(componentType, rendererType));
     }
 
@@ -168,12 +158,7 @@ public class ComponentTagDeclarationLibrary implements TagLibrary
     public final void addComponent(String namespace, String name, String componentType, String
rendererType, 
                                       Class<? extends TagHandler> handlerType)
     {
-        Map<String, TagHandlerFactory> map = _factories.get(namespace);
-        if (map == null)
-        {
-            map = new HashMap<String, TagHandlerFactory>();
-            _factories.put(namespace, map);
-        }
+        Map<String, TagHandlerFactory> map = _factories.computeIfAbsent(namespace,
k -> new HashMap<>());
         map.put(name, new UserComponentHandlerFactory(componentType, rendererType, handlerType));
     }
 


Mime
View raw message