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: cleanup
Date Sat, 17 Aug 2019 09:04:34 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 3c81823  cleanup
3c81823 is described below

commit 3c8182380aa7efab1c5de6321d2875832f67b91d
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Sat Aug 17 11:04:27 2019 +0200

    cleanup
---
 .../org/apache/myfaces/spi/AnnotationProviderFactory.java    |  7 +++----
 .../myfaces/spi/FaceletConfigResourceProviderFactory.java    |  8 ++++----
 .../myfaces/spi/FacesConfigResourceProviderFactory.java      |  8 ++++----
 .../apache/myfaces/spi/FacesConfigurationMergerFactory.java  |  9 ++++-----
 .../myfaces/spi/FacesConfigurationProviderFactory.java       |  9 ++++-----
 .../org/apache/myfaces/spi/FacesFlowProviderFactory.java     | 12 ++++--------
 .../org/apache/myfaces/spi/InjectionProviderFactory.java     |  9 ++++-----
 .../myfaces/spi/ResourceLibraryContractsProviderFactory.java |  8 ++++----
 .../org/apache/myfaces/spi/StateCacheProviderFactory.java    | 10 +++++-----
 .../org/apache/myfaces/spi/ViewScopeProviderFactory.java     | 12 ++++++------
 .../org/apache/myfaces/spi/WebConfigProviderFactory.java     |  9 ++++-----
 impl/src/main/java/org/apache/myfaces/spi/impl/SpiUtils.java |  5 ++---
 12 files changed, 48 insertions(+), 58 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/spi/AnnotationProviderFactory.java b/impl/src/main/java/org/apache/myfaces/spi/AnnotationProviderFactory.java
index 5c08a86..516d286 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/AnnotationProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/AnnotationProviderFactory.java
@@ -36,8 +36,6 @@ import org.apache.myfaces.spi.impl.SpiUtils;
  */
 public abstract class AnnotationProviderFactory
 {
-    protected static final String FACTORY_DEFAULT = DefaultAnnotationProviderFactory.class.getName();
-
     private static final String FACTORY_KEY = AnnotationProviderFactory.class.getName();
 
     public static AnnotationProviderFactory getAnnotationProviderFactory(ExternalContext
ctx)
@@ -56,11 +54,12 @@ public abstract class AnnotationProviderFactory
                 final ExternalContext ectx = ctx;
                 lpf = (AnnotationProviderFactory) AccessController.doPrivileged(
                         (PrivilegedExceptionAction) () -> SpiUtils.build(ectx, 
-                                AnnotationProviderFactory.class, FACTORY_DEFAULT));
+                                AnnotationProviderFactory.class, DefaultAnnotationProviderFactory.class));
             }
             else
             {
-                lpf = (AnnotationProviderFactory) SpiUtils.build(ctx, AnnotationProviderFactory.class,
FACTORY_DEFAULT);
+                lpf = (AnnotationProviderFactory) SpiUtils.build(ctx, AnnotationProviderFactory.class,
+                        DefaultAnnotationProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/FaceletConfigResourceProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/FaceletConfigResourceProviderFactory.java
index 852ad2e..13af301 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/FaceletConfigResourceProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/FaceletConfigResourceProviderFactory.java
@@ -36,8 +36,6 @@ import org.apache.myfaces.spi.impl.SpiUtils;
  */
 public abstract class FaceletConfigResourceProviderFactory
 {
-    protected static final String FACTORY_DEFAULT = DefaultFaceletConfigResourceProviderFactory.class.getName();
-
     private static final String FACTORY_KEY = FaceletConfigResourceProviderFactory.class.getName();
 
     public static FaceletConfigResourceProviderFactory getFacesConfigResourceProviderFactory(ExternalContext
ctx)
@@ -57,12 +55,14 @@ public abstract class FaceletConfigResourceProviderFactory
                 final ExternalContext ectx = ctx;
                 lpf = (FaceletConfigResourceProviderFactory) AccessController.doPrivileged(
                         (PrivilegedExceptionAction) () -> SpiUtils.build(ectx, 
-                                FaceletConfigResourceProviderFactory.class, FACTORY_DEFAULT));
+                                FaceletConfigResourceProviderFactory.class,
+                                DefaultFaceletConfigResourceProviderFactory.class));
             }
             else
             {
                 lpf = (FaceletConfigResourceProviderFactory)
-                        SpiUtils.build(ctx, FaceletConfigResourceProviderFactory.class, FACTORY_DEFAULT);
+                        SpiUtils.build(ctx, FaceletConfigResourceProviderFactory.class,
+                                DefaultFaceletConfigResourceProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/FacesConfigResourceProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/FacesConfigResourceProviderFactory.java
index 1353cf1..9198507 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/FacesConfigResourceProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/FacesConfigResourceProviderFactory.java
@@ -36,8 +36,6 @@ import org.apache.myfaces.spi.impl.SpiUtils;
  */
 public abstract class FacesConfigResourceProviderFactory
 {
-    protected static final String FACTORY_DEFAULT = DefaultFacesConfigResourceProviderFactory.class.getName();
-
     private static final String FACTORY_KEY = FacesConfigResourceProviderFactory.class.getName();
 
     public static FacesConfigResourceProviderFactory getFacesConfigResourceProviderFactory(ExternalContext
ctx)
@@ -57,12 +55,14 @@ public abstract class FacesConfigResourceProviderFactory
                 final ExternalContext ectx = ctx;
                 lpf = (FacesConfigResourceProviderFactory) AccessController.doPrivileged(
                         (PrivilegedExceptionAction) () -> SpiUtils.build(ectx,
-                                FacesConfigResourceProviderFactory.class, FACTORY_DEFAULT));
+                                FacesConfigResourceProviderFactory.class,
+                                DefaultFacesConfigResourceProviderFactory.class));
             }
             else
             {
                 lpf = (FacesConfigResourceProviderFactory)
-                        SpiUtils.build(ctx, FacesConfigResourceProviderFactory.class, FACTORY_DEFAULT);
+                        SpiUtils.build(ctx, FacesConfigResourceProviderFactory.class,
+                                DefaultFacesConfigResourceProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/FacesConfigurationMergerFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/FacesConfigurationMergerFactory.java
index c242272..01dd429 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/FacesConfigurationMergerFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/FacesConfigurationMergerFactory.java
@@ -35,9 +35,6 @@ import java.security.PrivilegedActionException;
  */
 public abstract class FacesConfigurationMergerFactory
 {
-
-    protected static final String FACTORY_DEFAULT = DefaultFacesConfigurationMergerFactory.class.getName();
-
     private static final String FACTORY_KEY = FacesConfigurationMergerFactory.class.getName();
 
     public static FacesConfigurationMergerFactory getFacesConfigurationMergerFactory(ExternalContext
ctx)
@@ -60,12 +57,14 @@ public abstract class FacesConfigurationMergerFactory
                 final ExternalContext ectx = ctx;
                 factory = (FacesConfigurationMergerFactory) AccessController.doPrivileged(
                         (java.security.PrivilegedExceptionAction) () -> SpiUtils.build(ectx,
-                                FacesConfigurationMergerFactory.class, FACTORY_DEFAULT));
+                                FacesConfigurationMergerFactory.class,
+                                DefaultFacesConfigurationMergerFactory.class));
             }
             else
             {
                 factory = (FacesConfigurationMergerFactory) SpiUtils
-                        .build(ctx, FacesConfigurationMergerFactory.class, FACTORY_DEFAULT);
+                        .build(ctx, FacesConfigurationMergerFactory.class,
+                                DefaultFacesConfigurationMergerFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/FacesConfigurationProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/FacesConfigurationProviderFactory.java
index 3055815..e170e9f 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/FacesConfigurationProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/FacesConfigurationProviderFactory.java
@@ -37,9 +37,6 @@ import org.apache.myfaces.spi.impl.SpiUtils;
  */
 public abstract class FacesConfigurationProviderFactory
 {
-
-    protected static final String FACTORY_DEFAULT = DefaultFacesConfigurationProviderFactory.class.getName();
-
     private static final String FACTORY_KEY = FacesConfigurationProviderFactory.class.getName();
 
     public static FacesConfigurationProviderFactory getFacesConfigurationProviderFactory(ExternalContext
ctx)
@@ -61,12 +58,14 @@ public abstract class FacesConfigurationProviderFactory
                 final ExternalContext ectx = ctx;
                 factory = (FacesConfigurationProviderFactory) AccessController.doPrivileged(
                         (PrivilegedExceptionAction) () -> SpiUtils.build(ectx, 
-                                FacesConfigurationProviderFactory.class, FACTORY_DEFAULT));
+                                FacesConfigurationProviderFactory.class,
+                                DefaultFacesConfigurationProviderFactory.class));
             }
             else
             {
                 factory = (FacesConfigurationProviderFactory)
-                        SpiUtils.build(ctx, FacesConfigurationProviderFactory.class, FACTORY_DEFAULT);
+                        SpiUtils.build(ctx, FacesConfigurationProviderFactory.class,
+                                DefaultFacesConfigurationProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/FacesFlowProviderFactory.java b/impl/src/main/java/org/apache/myfaces/spi/FacesFlowProviderFactory.java
index cb71279..c75ceab 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/FacesFlowProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/FacesFlowProviderFactory.java
@@ -25,6 +25,7 @@ import javax.faces.context.ExternalContext;
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import org.apache.myfaces.spi.impl.DefaultFacesFlowProviderFactory;
 
 /**
  * SPI to provide a FacesFlowProviderFactory implementation and thus
@@ -35,10 +36,6 @@ import java.security.PrivilegedExceptionAction;
  */
 public abstract class FacesFlowProviderFactory
 {
-
-    protected static final String FACTORY_DEFAULT = 
-        "org.apache.myfaces.spi.impl.DefaultFacesFlowProviderFactory";
-
     private static final String FACTORY_KEY = FacesFlowProviderFactory.class.getName();
 
     public static FacesFlowProviderFactory getFacesFlowProviderFactory(ExternalContext ctx)
@@ -61,12 +58,12 @@ public abstract class FacesFlowProviderFactory
                 final ExternalContext ectx = ctx;
                 factory = (FacesFlowProviderFactory) AccessController.doPrivileged(
                         (PrivilegedExceptionAction) () -> SpiUtils.build(ectx,
-                                FacesFlowProviderFactory.class,FACTORY_DEFAULT));
+                                FacesFlowProviderFactory.class, DefaultFacesFlowProviderFactory.class));
             }
             else
             {
                 factory = (FacesFlowProviderFactory) SpiUtils
-                        .build(ctx, FacesFlowProviderFactory.class, FACTORY_DEFAULT);
+                        .build(ctx, FacesFlowProviderFactory.class, DefaultFacesFlowProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
@@ -83,8 +80,7 @@ public abstract class FacesFlowProviderFactory
         return factory;
     }
 
-    public static void setFacesFlowProviderFactory(ExternalContext ctx,
-                                                          FacesFlowProviderFactory factory)
+    public static void setFacesFlowProviderFactory(ExternalContext ctx, FacesFlowProviderFactory
factory)
     {
         ctx.getApplicationMap().put(FACTORY_KEY, factory);
     }
diff --git a/impl/src/main/java/org/apache/myfaces/spi/InjectionProviderFactory.java b/impl/src/main/java/org/apache/myfaces/spi/InjectionProviderFactory.java
index c4adc7a..44a95ab 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/InjectionProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/InjectionProviderFactory.java
@@ -26,14 +26,12 @@ import java.util.Map;
 import javax.faces.FacesException;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
+import org.apache.myfaces.spi.impl.DefaultInjectionProviderFactory;
 
 import org.apache.myfaces.spi.impl.SpiUtils;
 
 public abstract class InjectionProviderFactory
 {
-    protected static final String FACTORY_DEFAULT = 
-        "org.apache.myfaces.spi.impl.DefaultInjectionProviderFactory";
-
     private static final String FACTORY_KEY = InjectionProviderFactory.class.getName();
 
     public static InjectionProviderFactory getInjectionProviderFactory()
@@ -60,12 +58,13 @@ public abstract class InjectionProviderFactory
                 final ExternalContext ectx = ctx; 
                 lpf = (InjectionProviderFactory) AccessController.doPrivileged(
                         (PrivilegedExceptionAction) () -> SpiUtils.build(ectx, 
-                                InjectionProviderFactory.class, FACTORY_DEFAULT));
+                                InjectionProviderFactory.class, DefaultInjectionProviderFactory.class));
             }
             else
             {
                 lpf = (InjectionProviderFactory) SpiUtils.build(ctx, 
-                    InjectionProviderFactory.class, FACTORY_DEFAULT);
+                    InjectionProviderFactory.class,
+                    DefaultInjectionProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/ResourceLibraryContractsProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/ResourceLibraryContractsProviderFactory.java
index 72b15f6..c300a3c 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/ResourceLibraryContractsProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/ResourceLibraryContractsProviderFactory.java
@@ -36,8 +36,6 @@ import org.apache.myfaces.spi.impl.SpiUtils;
  */
 public abstract class ResourceLibraryContractsProviderFactory
 {
-    protected static final String FACTORY_DEFAULT = DefaultResourceLibraryContractsProviderFactory.class.getName();
-
     private static final String FACTORY_KEY = ResourceLibraryContractsProviderFactory.class.getName();
 
     public static ResourceLibraryContractsProviderFactory getFacesConfigResourceProviderFactory(ExternalContext
ctx)
@@ -57,12 +55,14 @@ public abstract class ResourceLibraryContractsProviderFactory
                 final ExternalContext ectx = ctx;
                 lpf = (ResourceLibraryContractsProviderFactory)
                         AccessController.doPrivileged((PrivilegedExceptionAction) () ->
SpiUtils.build(ectx, 
-                                ResourceLibraryContractsProviderFactory.class, FACTORY_DEFAULT));
+                                ResourceLibraryContractsProviderFactory.class,
+                                DefaultResourceLibraryContractsProviderFactory.class));
             }
             else
             {
                 lpf = (ResourceLibraryContractsProviderFactory)
-                        SpiUtils.build(ctx, ResourceLibraryContractsProviderFactory.class,
FACTORY_DEFAULT);
+                        SpiUtils.build(ctx, ResourceLibraryContractsProviderFactory.class,
+                                DefaultResourceLibraryContractsProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/StateCacheProviderFactory.java b/impl/src/main/java/org/apache/myfaces/spi/StateCacheProviderFactory.java
index 7f30240..80907d5 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/StateCacheProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/StateCacheProviderFactory.java
@@ -24,6 +24,7 @@ import java.security.PrivilegedExceptionAction;
 import javax.faces.FacesException;
 import javax.faces.FacesWrapper;
 import javax.faces.context.ExternalContext;
+import org.apache.myfaces.spi.impl.DefaultStateCacheProviderFactory;
 import org.apache.myfaces.spi.impl.SpiUtils;
 
 /**
@@ -31,9 +32,6 @@ import org.apache.myfaces.spi.impl.SpiUtils;
  */
 public abstract class StateCacheProviderFactory implements FacesWrapper<StateCacheProviderFactory>
 {
-    protected static final String FACTORY_DEFAULT = 
-        "org.apache.myfaces.spi.impl.DefaultStateCacheProviderFactory";
-    
     private static final String FACTORY_KEY = StateCacheProviderFactory.class.getName();
     
     public static StateCacheProviderFactory getStateCacheProviderFactory(ExternalContext
ctx)
@@ -53,12 +51,14 @@ public abstract class StateCacheProviderFactory implements FacesWrapper<StateCac
                 final ExternalContext ectx = ctx;
                 lpf = (StateCacheProviderFactory) AccessController.doPrivileged(
                         (PrivilegedExceptionAction) () -> SpiUtils.build(ectx,
-                                StateCacheProviderFactory.class, FACTORY_DEFAULT));
+                                StateCacheProviderFactory.class,
+                                DefaultStateCacheProviderFactory.class));
             }
             else
             {
                 lpf = (StateCacheProviderFactory)
-                        SpiUtils.build(ctx, StateCacheProviderFactory.class, FACTORY_DEFAULT);
+                        SpiUtils.build(ctx, StateCacheProviderFactory.class,
+                                DefaultStateCacheProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/ViewScopeProviderFactory.java b/impl/src/main/java/org/apache/myfaces/spi/ViewScopeProviderFactory.java
index ff6c482..549130f 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/ViewScopeProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/ViewScopeProviderFactory.java
@@ -24,6 +24,7 @@ import java.security.PrivilegedExceptionAction;
 import javax.faces.FacesException;
 import javax.faces.FacesWrapper;
 import javax.faces.context.ExternalContext;
+import org.apache.myfaces.spi.impl.DefaultViewScopeProviderFactory;
 import org.apache.myfaces.spi.impl.SpiUtils;
 
 /**
@@ -31,10 +32,7 @@ import org.apache.myfaces.spi.impl.SpiUtils;
  * @author Leonardo Uribe
  */
 public abstract class ViewScopeProviderFactory implements FacesWrapper<ViewScopeProviderFactory>
-{
-    protected static final String FACTORY_DEFAULT = 
-        "org.apache.myfaces.spi.impl.DefaultViewScopeProviderFactory";
-    
+{    
     private static final String FACTORY_KEY = ViewScopeProviderFactory.class.getName();
     
     public static ViewScopeProviderFactory getViewScopeHandlerFactory(ExternalContext ctx)
@@ -54,12 +52,14 @@ public abstract class ViewScopeProviderFactory implements FacesWrapper<ViewScope
                 final ExternalContext ectx = ctx;
                 lpf = (ViewScopeProviderFactory) AccessController.doPrivileged(
                         (PrivilegedExceptionAction) () -> SpiUtils.build(ectx,
-                                ViewScopeProviderFactory.class, FACTORY_DEFAULT));
+                                ViewScopeProviderFactory.class,
+                                DefaultViewScopeProviderFactory.class));
             }
             else
             {
                 lpf = (ViewScopeProviderFactory)
-                        SpiUtils.build(ctx, ViewScopeProviderFactory.class, FACTORY_DEFAULT);
+                        SpiUtils.build(ctx, ViewScopeProviderFactory.class,
+                                DefaultViewScopeProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/WebConfigProviderFactory.java b/impl/src/main/java/org/apache/myfaces/spi/WebConfigProviderFactory.java
index 1b1a8fb..9317b99 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/WebConfigProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/WebConfigProviderFactory.java
@@ -38,9 +38,6 @@ import org.apache.myfaces.spi.impl.SpiUtils;
  */
 public abstract class WebConfigProviderFactory
 {
-
-    protected static final String FACTORY_DEFAULT = DefaultWebConfigProviderFactory.class.getName();
-
     private static final String FACTORY_KEY = WebConfigProviderFactory.class.getName();
 
     public static WebConfigProviderFactory getWebConfigProviderFactory(ExternalContext ctx)
@@ -61,12 +58,14 @@ public abstract class WebConfigProviderFactory
                 final ExternalContext ectx = ctx;
                 factory = (WebConfigProviderFactory) AccessController.doPrivileged(
                         (PrivilegedExceptionAction) () -> SpiUtils.build(ectx,
-                                WebConfigProviderFactory.class, FACTORY_DEFAULT));
+                                WebConfigProviderFactory.class,
+                                DefaultWebConfigProviderFactory.class));
             }
             else
             {
                 factory = (WebConfigProviderFactory)
-                        SpiUtils.build(ctx, WebConfigProviderFactory.class, FACTORY_DEFAULT);
+                        SpiUtils.build(ctx, WebConfigProviderFactory.class,
+                                DefaultWebConfigProviderFactory.class);
             }
         }
         catch (PrivilegedActionException pae)
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/SpiUtils.java b/impl/src/main/java/org/apache/myfaces/spi/impl/SpiUtils.java
index 0d17c66..970c2b0 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/SpiUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/SpiUtils.java
@@ -35,8 +35,7 @@ import org.apache.myfaces.spi.ServiceProviderFinderFactory;
  */
 public final class SpiUtils
 {
-    
-    public static Object build(ExternalContext ectx, Class spiClass, String defaultImpl)
+    public static Object build(ExternalContext ectx, Class spiClass, Class defaultImpl)
     {
         List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(ectx).
                 getServiceProviderList(spiClass.getName());
@@ -45,7 +44,7 @@ public final class SpiUtils
         {
             if (classList.size() > 1)
             {
-                getLogger().log(Level.WARNING, "More than one SPI interface for "+spiClass.getName()+
+                getLogger().log(Level.WARNING, "More than one SPI interface for " + spiClass.getName()
+
                         " found :" + classList.toString() + ". Setting up the first one found.");
             }
             return ClassUtils.newInstance(classList.get(0));


Mime
View raw message