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: fixed multiple calls
Date Sun, 11 Aug 2019 07:48:42 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 ecda56b  fixed multiple calls
ecda56b is described below

commit ecda56babed738f08c4201733a853b3e07cc5eec
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Sun Aug 11 09:48:39 2019 +0200

    fixed multiple calls
---
 .../apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
index 7730daf..0e78446 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
@@ -24,6 +24,7 @@ import java.net.URL;
 import java.net.URLConnection;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Optional;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.regex.Pattern;
@@ -61,7 +62,7 @@ public final class DefaultFaceletFactory extends FaceletFactory
     
     protected final Logger log = Logger.getLogger(DefaultFaceletFactory.class.getName());
 
-    private URL _baseUrl;
+    private Optional<URL> _baseUrl;
     private Compiler _compiler;
     private Map<String, DefaultFacelet> _compositeComponentMetadataFacelets;
     private long _refreshPeriod;
@@ -164,9 +165,9 @@ public final class DefaultFaceletFactory extends FaceletFactory
     {
         if (_baseUrl == null)
         {
-            _baseUrl = _resolver.resolveUrl("/");
+            _baseUrl = Optional.ofNullable(_resolver.resolveUrl("/"));
         }
-        return _baseUrl;
+        return _baseUrl.isPresent() ? _baseUrl.get() : null;
     }
 
     /*


Mime
View raw message