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: refactored
Date Sun, 04 Aug 2019 11:03:19 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 638418c  refactored
638418c is described below

commit 638418c418fd2bb7fad234b968a3730dba843bca
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Sun Aug 4 13:03:10 2019 +0200

    refactored
---
 .../apache/myfaces/config/FacesConfigurator.java   | 31 +---------------------
 .../config/annotation/AnnotationConfigurator.java  | 12 ++++-----
 2 files changed, 6 insertions(+), 37 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java b/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
index e450369..6b9aae8 100755
--- a/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
+++ b/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
@@ -72,7 +72,6 @@ import javax.faces.webapp.FacesServlet;
 import org.apache.myfaces.application.ApplicationFactoryImpl;
 import org.apache.myfaces.application.BackwardsCompatibleNavigationHandlerWrapper;
 import org.apache.myfaces.component.visit.VisitContextFactoryImpl;
-import org.apache.myfaces.config.annotation.AnnotationConfigurator;
 import org.apache.myfaces.config.element.Behavior;
 import org.apache.myfaces.config.element.ClientBehaviorRenderer;
 import org.apache.myfaces.config.element.ComponentTagDeclaration;
@@ -193,7 +192,6 @@ public class FacesConfigurator
     private FacesContext _facesContext;
     private FacesConfigUnmarshaller<? extends FacesConfig> _unmarshaller;
     private FacesConfigData _dispenser;
-    private AnnotationConfigurator _annotationConfigurator;
 
     private RuntimeConfig _runtimeConfig;
     
@@ -264,20 +262,6 @@ public class FacesConfigurator
         return _dispenser;
     }
 
-    public void setAnnotationConfigurator(AnnotationConfigurator configurator)
-    {
-        _annotationConfigurator = configurator;
-    }
-
-    protected AnnotationConfigurator getAnnotationConfigurator()
-    {
-        if (_annotationConfigurator == null)
-        {
-            _annotationConfigurator = new AnnotationConfigurator();
-        }
-        return _annotationConfigurator;
-    }
-
     private long getResourceLastModified(String resource)
     {
         try
@@ -416,11 +400,7 @@ public class FacesConfigurator
 
                     return;
                 }
-                catch (IllegalAccessException e)
-                {
-                    log.severe("Error during configuration clean-up" + e.getMessage());
-                }
-                catch (InvocationTargetException e)
+                catch (IllegalAccessException | InvocationTargetException e)
                 {
                     log.severe("Error during configuration clean-up" + e.getMessage());
                 }
@@ -452,17 +432,14 @@ public class FacesConfigurator
         //
         ApplicationFactory applicationFactory
                 = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
-        //appFactoryPurgeMethod = applicationFactory.getClass().getMethod("purgeApplication",
NO_PARAMETER_TYPES);
         appFactoryPurgeMethod = getPurgeMethod(applicationFactory, "purgeApplication", NO_PARAMETER_TYPES);
 
         RenderKitFactory renderKitFactory
                 = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
-        //renderKitPurgeMethod = renderKitFactory.getClass().getMethod("purgeRenderKit",
NO_PARAMETER_TYPES);
         renderKitPurgeMethod = getPurgeMethod(renderKitFactory, "purgeRenderKit", NO_PARAMETER_TYPES);
 
         LifecycleFactory lifecycleFactory
                 = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
-        //lifecyclePurgeMethod = lifecycleFactory.getClass().getMethod("purgeLifecycle",
NO_PARAMETER_TYPES);
         lifecyclePurgeMethod = getPurgeMethod(lifecycleFactory, "purgeLifecycle", NO_PARAMETER_TYPES);
 
         FacesContext facesContext = getFacesContext();
@@ -527,12 +504,6 @@ public class FacesConfigurator
         configureApplication();
         configureRenderKits();
 
-        //Now we can configure annotations
-        //getAnnotationConfigurator().configure(
-        //        ((ApplicationFactory) FactoryFinder.getFactory(
-        //                FactoryFinder.APPLICATION_FACTORY)).getApplication(),
-        //        getDispenser(), metadataComplete);
-
         configureRuntimeConfig();
         configureLifecycle();
         handleSerialFactory();
diff --git a/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java
b/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java
index 1914387..7d9bc50 100644
--- a/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java
+++ b/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java
@@ -105,9 +105,9 @@ public class AnnotationConfigurator
                 {
                     if (log.isLoggable(Level.FINEST))
                     {
-                        log.finest("addComponent(" + comp.value() + ','
-                                + clazz.getName() + ')');
+                        log.finest("addComponent(" + comp.value() + ',' + clazz.getName()
+ ')');
                     }
+
                     String value = comp.value();
                     if (StringUtils.isEmpty(value))
                     {
@@ -144,6 +144,7 @@ public class AnnotationConfigurator
                     {
                         log.finest("addConverter(" + conv.value() + ',' + clazz.getName()
+ ')');
                     }
+
                     //If there is a previous entry on Application Configuration Resources,
                     //the entry there takes precedence
                     boolean hasForClass = !Object.class.equals(conv.forClass());
@@ -181,9 +182,9 @@ public class AnnotationConfigurator
                 {
                     if (log.isLoggable(Level.FINEST))
                     {
-                        log.finest("addValidator(" + val.value() + ',' + clazz.getName()
-                                + ')');
+                        log.finest("addValidator(" + val.value() + ',' + clazz.getName()
+ ')');
                     }
+
                     String value = val.value();
                     if (value == null || value.isEmpty())
                     {
@@ -316,11 +317,9 @@ public class AnnotationConfigurator
             if (facesBehavior != null)
             {
                 // Can only apply @FacesBehavior to Behavior implementors.
-
                 if (!javax.faces.component.behavior.Behavior.class.isAssignableFrom(clazz))
                 {
                     // Just log this.  We'll catch it later in the runtime.
-
                     if (log.isLoggable(Level.WARNING))
                     {
                         log.warning(clazz.getName()
@@ -387,7 +386,6 @@ public class AnnotationConfigurator
         {
             FaceletsResourceResolver faceletsResourceResolver = 
                 (FaceletsResourceResolver) clazz.getAnnotation(FaceletsResourceResolver.class);
-            
             if (faceletsResourceResolver != null)
             {
                 facesConfig.addResourceResolver(clazz.getName());


Mime
View raw message