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: use index loop
Date Wed, 09 Sep 2020 08:07:03 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 16a8210  use index loop
16a8210 is described below

commit 16a8210bc52d35c5a4e97e1090db380b0605dcca
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Wed Sep 9 10:06:53 2020 +0200

    use index loop
---
 .../myfaces/view/facelets/FaceletViewDeclarationLanguage.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
index c73c433..1c07655 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
@@ -2372,8 +2372,8 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
     private void _initializeContractMappings(ExternalContext context)
     {
         RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(context);
-        List<String> prefixWildcardKeys = new ArrayList<String>();
-        Map<String, List<String>> contractMappings = new HashMap<String, List<String>>();
+        List<String> prefixWildcardKeys = new ArrayList<>();
+        Map<String, List<String>> contractMappings = new HashMap<>();
         
         for (Map.Entry<String, List<String>> entry : runtimeConfig.getContractMappings().entrySet())
         {
@@ -2382,7 +2382,7 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
             {
                 prefixWildcardKeys.add(urlPattern);
             }
-            contractMappings.put(entry.getKey(), new ArrayList<String>(entry.getValue()));
+            contractMappings.put(entry.getKey(), new ArrayList<>(entry.getValue()));
         }
         
         Collections.sort(prefixWildcardKeys, new FaceletsVDLUtils.KeyComparator());
@@ -2404,11 +2404,12 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
         if (contracts == null)
         {
             //Check prefix mapping
-            for (String prefix : this._prefixWildcardKeys)
+            for (int i = 0; i < this._prefixWildcardKeys.size(); i++)
             {
+                String prefix = this._prefixWildcardKeys.get(i);
                 if (FaceletsVDLUtils.matchPattern(viewId, prefix))
                 {
-                    contracts =  this._contractMappings.get(prefix);
+                    contracts = this._contractMappings.get(prefix);
                     break;
                 }
             }


Mime
View raw message