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 Tue, 11 Dec 2018 10:31:32 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 7b20963  cosmetics
7b20963 is described below

commit 7b209638005ecb49dd99f75a10fa333284e9b835
Author: Thomas Andraschko <tandraschko@apache.org>
AuthorDate: Tue Dec 11 11:31:28 2018 +0100

    cosmetics
---
 .../resource/ClassLoaderResourceLoader.java        | 303 +--------------------
 .../myfaces/resource/ContractResourceLoader.java   |   5 +
 .../spi/FacesConfigResourceProviderFactory.java    |   1 +
 .../org/apache/myfaces/spi/StateCacheProvider.java |   1 +
 .../myfaces/spi/StateCacheProviderFactory.java     |   1 +
 .../myfaces/spi/ViewScopeProviderFactory.java      |   1 +
 .../spi/impl/DefaultAnnotationProviderFactory.java |  17 +-
 ...efaultFaceletConfigResourceProviderFactory.java |  17 +-
 .../DefaultFacesConfigResourceProviderFactory.java |  17 +-
 .../DefaultFacesConfigurationMergerFactory.java    |  17 +-
 .../DefaultFacesConfigurationProviderFactory.java  |  17 +-
 .../spi/impl/DefaultInjectionProviderFactory.java  |  31 +--
 ...ultResourceLibraryContractsProviderFactory.java |  17 +-
 .../spi/impl/DefaultStateCacheProviderFactory.java |  17 +-
 .../spi/impl/DefaultWebConfigProviderFactory.java  |  17 +-
 .../NoInjectionAnnotationInjectionProvider.java    |  22 +-
 .../impl/Tomcat7AnnotationInjectionProvider.java   |  25 +-
 17 files changed, 44 insertions(+), 482 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/resource/ClassLoaderResourceLoader.java
b/impl/src/main/java/org/apache/myfaces/resource/ClassLoaderResourceLoader.java
index ff4a2d7..ab3f4fb 100644
--- a/impl/src/main/java/org/apache/myfaces/resource/ClassLoaderResourceLoader.java
+++ b/impl/src/main/java/org/apache/myfaces/resource/ClassLoaderResourceLoader.java
@@ -41,159 +41,6 @@ public class ClassLoaderResourceLoader extends ResourceLoader
     public String getLibraryVersion(String path)
     {
         return null;
-        /*
-        String libraryVersion = null;
-        if (getPrefix() != null)
-            path = getPrefix() + '/' + path;
-
-        URL url = getClassLoader().getResource(path);
-
-        if (url == null)
-        {
-            // This library does not exists for this
-            // ResourceLoader
-            return null;
-        }
-
-        // The problem here is how to scan the directory. When a ClassLoader
-        // is used two cases could occur
-        // 1. The files are unpacked so we can use Url.toURI and crawl
-        // the directory using the api for files.
-        // 2. The files are packed in a jar. This case is more tricky,
-        // because we only have a URL. Checking the jar api we can use
-        // JarURLConnection (Sounds strange, but the api of
-        // URL.openConnection says that for a jar connection a
-        // JarURLConnection is returned). From this point we can access
-        // to the jar api and solve the algoritm.
-        if (url.getProtocol().equals("file"))
-        {
-            try
-            {
-                File directory = new File(url.toURI());
-                if (directory.isDirectory())
-                {
-                    File[] versions = directory.listFiles(_libraryFileFilter);
-                    for (int i = 0; i < versions.length; i++)
-                    {
-                        String version = versions[i].getName();
-                        if (VERSION_CHECKER.matcher(version).matches())
-                        {
-                            if (libraryVersion == null)
-                            {
-                                libraryVersion = version;
-                            }
-                            else if (getVersionComparator().compare(libraryVersion, version)
< 0)
-                            {
-                                libraryVersion = version;
-                            }
-                        }
-                    }
-                }
-            }
-            catch (URISyntaxException e)
-            {
-                // Just return null, because library version cannot be
-                // resolved.
-                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName());

-                if (log.isLoggable(Level.WARNING))
-                {
-                    log.log(Level.WARNING, "url "+url.toString()+" cannot be translated to
uri: "+e.getMessage(), e);
-                }
-            }
-        }
-        else if (isJarResourceProtocol(url.getProtocol()))
-        {
-            try
-            {
-                url = getClassLoader().getResource(path + '/');
-
-                if (url != null)
-                {
-                    JarURLConnection conn = (JarURLConnection)url.openConnection();
-                    // See DIGESTER-29 for related problem
-                    conn.setUseCaches(false);
-
-                    try
-                    {
-                        if (conn.getJarEntry().isDirectory())
-                        {
-                            // Unfortunately, we have to scan all entry files
-                            // because there is no proper api to scan it as a
-                            // directory tree.
-                            JarFile file = conn.getJarFile();
-                            for (Enumeration<JarEntry> en = file.entries(); en.hasMoreElements();)
-                            {
-                                JarEntry entry = en.nextElement();
-                                String entryName = entry.getName();
-    
-                                if (entryName.startsWith(path + '/'))
-                                {
-                                    if (entryName.length() == path.length() + 1)
-                                    {
-                                        // the same string, just skip it
-                                        continue;
-                                    }
-    
-                                    if (entryName.charAt(entryName.length() - 1) != '/')
-                                    {
-                                        // Skip files
-                                        continue;
-                                    }
-    
-                                    entryName = entryName.substring(path.length() + 1, entryName.length()
- 1);
-    
-                                    if (entryName.indexOf('/') >= 0)
-                                    {
-                                        // Inner Directory
-                                        continue;
-                                    }
-    
-                                    String version = entryName;
-                                    if (VERSION_CHECKER.matcher(version).matches())
-                                    {
-                                        if (libraryVersion == null)
-                                        {
-                                            libraryVersion = version;
-                                        }
-                                        else if (getVersionComparator().compare(libraryVersion,
version) < 0)
-                                        {
-                                            libraryVersion = version;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    finally
-                    {
-                        //See TRINIDAD-73
-                        //just close the input stream again if
-                        //by inspecting the entries the stream
-                        //was let open.
-                        try
-                        {
-                            conn.getInputStream().close();
-                        }
-                        catch (Exception exception)
-                        {
-                            // Ignored
-                        }
-                    }
-                }
-            }
-            catch (IOException e)
-            {
-                // Just return null, because library version cannot be
-                // resolved.
-                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName());

-                if (log.isLoggable(Level.WARNING))
-                {
-                    log.log(Level.WARNING, "IOException when scanning for resource in jar
file:", e);
-                }
-            }
-        }
-        return libraryVersion;
-        */
     }
 
     @Override
@@ -260,161 +107,13 @@ public class ClassLoaderResourceLoader extends ResourceLoader
     public String getResourceVersion(String path)
     {
         return null;
-        /*
-        String resourceVersion = null;
-
-        if (getPrefix() != null)
-            path = getPrefix() + '/' + path;
-
-        URL url = getClassLoader().getResource(path);
-
-        if (url == null)
-        {
-            // This library does not exists for this
-            // ResourceLoader
-            return null;
-        }
-
-        if (url.getProtocol().equals("file"))
-        {
-            try
-            {
-                File directory = new File(url.toURI());
-                if (directory.isDirectory())
-                {
-                    File[] versions = directory.listFiles(_resourceFileFilter);
-                    for (int i = 0; i < versions.length; i++)
-                    {
-                        String version = versions[i].getName();
-                        if (resourceVersion == null)
-                        {
-                            resourceVersion = version;
-                        }
-                        else if (getVersionComparator().compare(resourceVersion, version)
< 0)
-                        {
-                            resourceVersion = version;
-                        }
-                    }
-                    //Since it is a directory and no version found set resourceVersion as
invalid
-                    if (resourceVersion == null)
-                    {
-                        resourceVersion = VERSION_INVALID;
-                    }
-                }
-            }
-            catch (URISyntaxException e)
-            {
-                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName());

-                if (log.isLoggable(Level.WARNING))
-                {
-                    log.log(Level.WARNING, "url "+url.toString()+" cannot be translated to
uri: "+e.getMessage(), e);
-                }
-            }
-        }
-        else if (isJarResourceProtocol(url.getProtocol()))
-        {
-            try
-            {
-                url = getClassLoader().getResource(path + '/');
-
-                if (url != null)
-                {
-                    JarURLConnection conn = (JarURLConnection)url.openConnection();
-                    // See DIGESTER-29 for related problem
-                    conn.setUseCaches(false);
-
-                    try
-                    {
-                        if (conn.getJarEntry().isDirectory())
-                        {
-                            // Unfortunately, we have to scan all entry files
-                            JarFile file = conn.getJarFile();
-                            for (Enumeration<JarEntry> en = file.entries(); en.hasMoreElements();)
-                            {
-                                JarEntry entry = en.nextElement();
-                                String entryName = entry.getName();
-    
-                                if (entryName.startsWith(path + '/'))
-                                {
-                                    if (entryName.length() == path.length() + 1)
-                                    {
-                                        // the same string, just skip it
-                                        continue;
-                                    }
-        
-                                    entryName = entryName.substring(path.length());
-                                    if (RESOURCE_VERSION_CHECKER.matcher(entryName).matches())
-                                    {
-                                        String version = entryName.substring(1, entryName.lastIndexOf('.'));
-                                        if (resourceVersion == null)
-                                        {
-                                            resourceVersion = version;
-                                        }
-                                        else if (getVersionComparator().compare(resourceVersion,
version) < 0)
-                                        {
-                                            resourceVersion = version;
-                                        }
-                                    }
-                                }
-                            }
-                            if (resourceVersion == null)
-                            {
-                                resourceVersion = VERSION_INVALID;
-                            }
-                        }
-                    }
-                    finally
-                    {
-                        //See TRINIDAD-73
-                        //just close the input stream again if
-                        //by inspecting the entries the stream
-                        //was let open.
-                        try
-                        {
-                            conn.getInputStream().close();
-                        }
-                        catch (Exception exception)
-                        {
-                            // Ignored
-                        }
-                    }
-
-                }
-            }
-            catch (IOException e)
-            {
-                // Just return null, because library version cannot be
-                // resolved.
-                Logger log = Logger.getLogger(ClassLoaderResourceLoader.class.getName());

-                if (log.isLoggable(Level.WARNING))
-                {
-                    log.log(Level.WARNING, "IOException when scanning for resource in jar
file:", e);
-                }
-            }
-        }
-        return resourceVersion;
-        */
     }
 
     @Override
     public ResourceMeta createResourceMeta(String prefix, String libraryName, String libraryVersion,
                                            String resourceName, String resourceVersion)
     {
-        //if (_developmentStage && libraryName != null && 
-        //        ResourceUtils.JAVAX_FACES_LIBRARY_NAME.equals(libraryName) &&
-        //        ResourceUtils.JSF_JS_RESOURCE_NAME.equals(resourceName))
-        //{
-            // InternalClassLoaderResourceLoader will serve it, so return null in this case.
-        //    return null;
-        //} else if (_developmentStage && libraryName != null &&
-        //        ResourceUtils.MYFACES_LIBRARY_NAME.equals(libraryName) &&
-        //        ResourceUtils.MYFACES_JS_RESOURCE_NAME.equals(resourceName)) {
-            // InternalClassLoaderResourceLoader will serve it, so return null in this case.
-        //     return null;
-        //} else
-        //{
-            return new ResourceMetaImpl(prefix, libraryName, libraryVersion, resourceName,
resourceVersion);
-        //}
+        return new ResourceMetaImpl(prefix, libraryName, libraryVersion, resourceName, resourceVersion);
     }
 
     /**
diff --git a/impl/src/main/java/org/apache/myfaces/resource/ContractResourceLoader.java b/impl/src/main/java/org/apache/myfaces/resource/ContractResourceLoader.java
index d19de64..000d346 100644
--- a/impl/src/main/java/org/apache/myfaces/resource/ContractResourceLoader.java
+++ b/impl/src/main/java/org/apache/myfaces/resource/ContractResourceLoader.java
@@ -32,11 +32,13 @@ public abstract class ContractResourceLoader extends ResourceLoader
         super(prefix);
     }
     
+    @Override
     public String getResourceVersion(String path)
     {
         return null;
     }
 
+    @Override
     public String getLibraryVersion(String path)
     {
         return null;
@@ -50,15 +52,18 @@ public abstract class ContractResourceLoader extends ResourceLoader
      */
     public abstract String getLibraryVersion(String path, String contractName);
 
+    @Override
     public ResourceMeta createResourceMeta(String prefix, String libraryName, 
             String libraryVersion, String resourceName, String resourceVersion)
     {
         return null;
     }
     
+    @Override
     public abstract ResourceMeta createResourceMeta(String prefix, String libraryName, 
             String libraryVersion, String resourceName, String resourceVersion, String contractName);
     
+    @Override
     public boolean libraryExists(String libraryName)
     {
         return false;
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 c78e163..70f4e4a 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/FacesConfigResourceProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/FacesConfigResourceProviderFactory.java
@@ -58,6 +58,7 @@ public abstract class FacesConfigResourceProviderFactory
                 lpf = (FacesConfigResourceProviderFactory)
                         AccessController.doPrivileged(new PrivilegedExceptionAction<Object>()
                         {
+                            @Override
                             public Object run() throws PrivilegedActionException
                             {
                                 return SpiUtils.build(ectx,
diff --git a/impl/src/main/java/org/apache/myfaces/spi/StateCacheProvider.java b/impl/src/main/java/org/apache/myfaces/spi/StateCacheProvider.java
index 6e62be2..876bc20 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/StateCacheProvider.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/StateCacheProvider.java
@@ -34,6 +34,7 @@ public abstract class StateCacheProvider implements FacesWrapper<StateCacheProvi
     
     public abstract StateCache getStateCache(FacesContext facesContext);
 
+    @Override
     public StateCacheProvider getWrapped()
     {
         return null;
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 4218a46..fe69d05 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/StateCacheProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/StateCacheProviderFactory.java
@@ -92,6 +92,7 @@ public abstract class StateCacheProviderFactory implements FacesWrapper<StateCac
     
     public abstract StateCacheProvider createStateCacheProvider(ExternalContext externalContext);
     
+    @Override
     public StateCacheProviderFactory getWrapped()
     {
         return null;
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 12a01e2..c336131 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/ViewScopeProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/ViewScopeProviderFactory.java
@@ -88,6 +88,7 @@ public abstract class ViewScopeProviderFactory implements FacesWrapper<ViewScope
     
     public abstract ViewScopeProvider getViewScopeHandler(ExternalContext ctx);
     
+    @Override
     public ViewScopeProviderFactory getWrapped()
     {
         return null;
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultAnnotationProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultAnnotationProviderFactory.java
index e2044be..6e75385 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultAnnotationProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultAnnotationProviderFactory.java
@@ -77,6 +77,7 @@ public class DefaultAnnotationProviderFactory extends AnnotationProviderFactory
             {
                 returnValue = AccessController.doPrivileged(new PrivilegedExceptionAction<AnnotationProvider>()
                         {
+                            @Override
                             public AnnotationProvider run() throws ClassNotFoundException,
                                     NoClassDefFoundError,
                                     InstantiationException,
@@ -93,23 +94,11 @@ public class DefaultAnnotationProviderFactory extends AnnotationProviderFactory
                 returnValue = resolveAnnotationProviderFromService(extContext);
             }
         }
-        catch (ClassNotFoundException e)
+        catch (ClassNotFoundException | NoClassDefFoundError e)
         {
             // ignore
         }
-        catch (NoClassDefFoundError e)
-        {
-            // ignore
-        }
-        catch (InstantiationException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (InvocationTargetException e)
+        catch (InstantiationException | IllegalAccessException | InvocationTargetException
e)
         {
             getLogger().log(Level.SEVERE, "", e);
         }
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFaceletConfigResourceProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFaceletConfigResourceProviderFactory.java
index 35250cb..2f23d8b 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFaceletConfigResourceProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFaceletConfigResourceProviderFactory.java
@@ -63,6 +63,7 @@ public class DefaultFaceletConfigResourceProviderFactory extends FaceletConfigRe
                 returnValue
                         = AccessController.doPrivileged(new PrivilegedExceptionAction<FaceletConfigResourceProvider>()
                         {
+                            @Override
                             public FaceletConfigResourceProvider run() throws ClassNotFoundException,
                                     NoClassDefFoundError,
                                     InstantiationException,
@@ -79,23 +80,11 @@ public class DefaultFaceletConfigResourceProviderFactory extends FaceletConfigRe
                 returnValue = resolveFaceletConfigResourceProviderFromService(extContext);
             }
         }
-        catch (ClassNotFoundException e)
+        catch (ClassNotFoundException | NoClassDefFoundError e)
         {
             // ignore
         }
-        catch (NoClassDefFoundError e)
-        {
-            // ignore
-        }
-        catch (InstantiationException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (InvocationTargetException e)
+        catch (InstantiationException | IllegalAccessException | InvocationTargetException
e)
         {
             getLogger().log(Level.SEVERE, "", e);
         }
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigResourceProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigResourceProviderFactory.java
index 4055ebb..058baeb 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigResourceProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigResourceProviderFactory.java
@@ -62,6 +62,7 @@ public class DefaultFacesConfigResourceProviderFactory extends FacesConfigResour
             {
                 returnValue = AccessController.doPrivileged(new PrivilegedExceptionAction<FacesConfigResourceProvider>()
                         {
+                            @Override
                             public FacesConfigResourceProvider run() throws ClassNotFoundException,
                                     NoClassDefFoundError,
                                     InstantiationException,
@@ -78,23 +79,11 @@ public class DefaultFacesConfigResourceProviderFactory extends FacesConfigResour
                 returnValue = resolveFacesConfigResourceProviderFromService(extContext);
             }
         }
-        catch (ClassNotFoundException e)
+        catch (ClassNotFoundException | NoClassDefFoundError e)
         {
             // ignore
         }
-        catch (NoClassDefFoundError e)
-        {
-            // ignore
-        }
-        catch (InstantiationException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (InvocationTargetException e)
+        catch (InstantiationException | IllegalAccessException | InvocationTargetException
e)
         {
             getLogger().log(Level.SEVERE, "", e);
         }
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigurationMergerFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigurationMergerFactory.java
index fe37b79..7127930 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigurationMergerFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigurationMergerFactory.java
@@ -78,23 +78,11 @@ public class DefaultFacesConfigurationMergerFactory extends FacesConfigurationMe
                 // cache the result on the ApplicationMap
                 externalContext.getApplicationMap().put(FACES_CONFIGURATION_MERGER_INSTANCE_KEY,
returnValue);
             }
-            catch (ClassNotFoundException e)
+            catch (ClassNotFoundException | NoClassDefFoundError e)
             {
                 // ignore
             }
-            catch (NoClassDefFoundError e)
-            {
-                // ignore
-            }
-            catch (InstantiationException e)
-            {
-                getLogger().log(Level.SEVERE, "", e);
-            }
-            catch (IllegalAccessException e)
-            {
-                getLogger().log(Level.SEVERE, "", e);
-            }
-            catch (InvocationTargetException e)
+            catch (InstantiationException | IllegalAccessException | InvocationTargetException
e)
             {
                 getLogger().log(Level.SEVERE, "", e);
             }
@@ -104,7 +92,6 @@ public class DefaultFacesConfigurationMergerFactory extends FacesConfigurationMe
             }
         }
 
-
         return returnValue;
     }
 
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigurationProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigurationProviderFactory.java
index ce8cb6f..69b5c59 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigurationProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultFacesConfigurationProviderFactory.java
@@ -87,23 +87,11 @@ public class DefaultFacesConfigurationProviderFactory extends FacesConfiguration
                 }
                 externalContext.getApplicationMap().put(FACES_CONFIGURATION_PROVIDER_INSTANCE_KEY,
returnValue);
             }
-            catch (ClassNotFoundException e)
+            catch (ClassNotFoundException | NoClassDefFoundError e)
             {
                 // ignore
             }
-            catch (NoClassDefFoundError e)
-            {
-                // ignore
-            }
-            catch (InstantiationException e)
-            {
-                getLogger().log(Level.SEVERE, "", e);
-            }
-            catch (IllegalAccessException e)
-            {
-                getLogger().log(Level.SEVERE, "", e);
-            }
-            catch (InvocationTargetException e)
+            catch (InstantiationException | IllegalAccessException | InvocationTargetException
e)
             {
                 getLogger().log(Level.SEVERE, "", e);
             }
@@ -113,7 +101,6 @@ public class DefaultFacesConfigurationProviderFactory extends FacesConfiguration
             }
         }
 
-
         return returnValue;
     }
 
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultInjectionProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultInjectionProviderFactory.java
index 80ad1b1..d5863ec 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultInjectionProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultInjectionProviderFactory.java
@@ -133,19 +133,7 @@ public class DefaultInjectionProviderFactory extends InjectionProviderFactory
                 }
             }
         }
-        catch (ClassNotFoundException e)
-        {
-            log.log(Level.SEVERE, "", e);
-        }
-        catch (InstantiationException e)
-        {
-            log.log(Level.SEVERE, "", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            log.log(Level.SEVERE, "", e);
-        }
-        catch (InvocationTargetException e)
+        catch (ClassNotFoundException | InstantiationException | IllegalAccessException |
InvocationTargetException e)
         {
             log.log(Level.SEVERE, "", e);
         }
@@ -164,6 +152,7 @@ public class DefaultInjectionProviderFactory extends InjectionProviderFactory
             {
                 returnValue = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<Boolean>()
                         {
+                            @Override
                             public Boolean run() throws ClassNotFoundException,
                                     NoClassDefFoundError,
                                     InstantiationException,
@@ -218,23 +207,11 @@ public class DefaultInjectionProviderFactory extends InjectionProviderFactory
                 }
             }
         }
-        catch (ClassNotFoundException e)
+        catch (ClassNotFoundException | NoClassDefFoundError e)
         {
             // ignore
         }
-        catch (NoClassDefFoundError e)
-        {
-            // ignore
-        }
-        catch (InstantiationException e)
-        {
-            log.log(Level.SEVERE, "", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            log.log(Level.SEVERE, "", e);
-        }
-        catch (InvocationTargetException e)
+        catch (InstantiationException | IllegalAccessException | InvocationTargetException
e)
         {
             log.log(Level.SEVERE, "", e);
         }
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultResourceLibraryContractsProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultResourceLibraryContractsProviderFactory.java
index c5d2aa3..2db17bd 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultResourceLibraryContractsProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultResourceLibraryContractsProviderFactory.java
@@ -64,6 +64,7 @@ public class DefaultResourceLibraryContractsProviderFactory extends ResourceLibr
                         = AccessController.doPrivileged(
                             new PrivilegedExceptionAction<ResourceLibraryContractsProvider>()
                         {
+                            @Override
                             public ResourceLibraryContractsProvider run() throws ClassNotFoundException,
                                     NoClassDefFoundError,
                                     InstantiationException,
@@ -80,23 +81,11 @@ public class DefaultResourceLibraryContractsProviderFactory extends ResourceLibr
                 returnValue = resolveResourceLibraryContractsProviderFromService(extContext);
             }
         }
-        catch (ClassNotFoundException e)
+        catch (ClassNotFoundException | NoClassDefFoundError e)
         {
             // ignore
         }
-        catch (NoClassDefFoundError e)
-        {
-            // ignore
-        }
-        catch (InstantiationException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (InvocationTargetException e)
+        catch (InstantiationException | IllegalAccessException | InvocationTargetException
e)
         {
             getLogger().log(Level.SEVERE, "", e);
         }
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultStateCacheProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultStateCacheProviderFactory.java
index 849da3f..b61d64b 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultStateCacheProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultStateCacheProviderFactory.java
@@ -75,6 +75,7 @@ public class DefaultStateCacheProviderFactory extends StateCacheProviderFactory
             {
                 returnValue = AccessController.doPrivileged(new PrivilegedExceptionAction<StateCacheProvider>()
                         {
+                            @Override
                             public StateCacheProvider run() throws ClassNotFoundException,
                                     NoClassDefFoundError,
                                     InstantiationException,
@@ -91,23 +92,11 @@ public class DefaultStateCacheProviderFactory extends StateCacheProviderFactory
                 returnValue = resolveStateCacheProviderFromService(extContext);
             }
         }
-        catch (ClassNotFoundException e)
+        catch (ClassNotFoundException | NoClassDefFoundError e)
         {
             // ignore
         }
-        catch (NoClassDefFoundError e)
-        {
-            // ignore
-        }
-        catch (InstantiationException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (InvocationTargetException e)
+        catch (InstantiationException | IllegalAccessException | InvocationTargetException
e)
         {
             getLogger().log(Level.SEVERE, "", e);
         }
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultWebConfigProviderFactory.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultWebConfigProviderFactory.java
index 96b21d9..5779deb 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultWebConfigProviderFactory.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/DefaultWebConfigProviderFactory.java
@@ -66,6 +66,7 @@ public class DefaultWebConfigProviderFactory extends WebConfigProviderFactory
             {
                 returnValue = AccessController.doPrivileged(new PrivilegedExceptionAction<WebConfigProvider>()
                         {
+                            @Override
                             public WebConfigProvider run() throws ClassNotFoundException,
                                     NoClassDefFoundError,
                                     InstantiationException,
@@ -82,23 +83,11 @@ public class DefaultWebConfigProviderFactory extends WebConfigProviderFactory
                 returnValue = resolveWebXmlProviderFromService(extContext);
             }
         }
-        catch (ClassNotFoundException e)
+        catch (ClassNotFoundException | NoClassDefFoundError e)
         {
             // ignore
         }
-        catch (NoClassDefFoundError e)
-        {
-            // ignore
-        }
-        catch (InstantiationException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (IllegalAccessException e)
-        {
-            getLogger().log(Level.SEVERE, "", e);
-        }
-        catch (InvocationTargetException e)
+        catch (InstantiationException | IllegalAccessException | InvocationTargetException
e)
         {
             getLogger().log(Level.SEVERE, "", e);
         }
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/NoInjectionAnnotationInjectionProvider.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/NoInjectionAnnotationInjectionProvider.java
index d79cb4a..2ec5f28 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/NoInjectionAnnotationInjectionProvider.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/NoInjectionAnnotationInjectionProvider.java
@@ -91,15 +91,7 @@ public class NoInjectionAnnotationInjectionProvider extends InjectionProvider
         {
             processAnnotations(instance);
         }
-        catch (IllegalAccessException ex)
-        {
-            throw new InjectionProviderException(ex);
-        }
-        catch (InvocationTargetException ex)
-        {
-            throw new InjectionProviderException(ex);
-        }
-        catch (NamingException ex)
+        catch (IllegalAccessException | InvocationTargetException | NamingException ex)
         {
             throw new InjectionProviderException(ex);
         }
@@ -167,11 +159,7 @@ public class NoInjectionAnnotationInjectionProvider extends InjectionProvider
         {
             invokeAnnotatedMethod(postConstruct, instance);
         }
-        catch (IllegalAccessException ex)
-        {
-            throw new InjectionProviderException(ex);
-        }
-        catch (InvocationTargetException ex)
+        catch (IllegalAccessException | InvocationTargetException ex)
         {
             throw new InjectionProviderException(ex);
         }
@@ -213,11 +201,7 @@ public class NoInjectionAnnotationInjectionProvider extends InjectionProvider
         {
             invokeAnnotatedMethod(preDestroy, instance);
         }
-        catch (IllegalAccessException ex)
-        {
-            throw new InjectionProviderException(ex);
-        }
-        catch (InvocationTargetException ex)
+        catch (IllegalAccessException | InvocationTargetException ex)
         {
             throw new InjectionProviderException(ex);
         }
diff --git a/impl/src/main/java/org/apache/myfaces/spi/impl/Tomcat7AnnotationInjectionProvider.java
b/impl/src/main/java/org/apache/myfaces/spi/impl/Tomcat7AnnotationInjectionProvider.java
index 0e1631d..d93bb9d 100644
--- a/impl/src/main/java/org/apache/myfaces/spi/impl/Tomcat7AnnotationInjectionProvider.java
+++ b/impl/src/main/java/org/apache/myfaces/spi/impl/Tomcat7AnnotationInjectionProvider.java
@@ -54,8 +54,7 @@ public class Tomcat7AnnotationInjectionProvider extends InjectionProvider
     @Override
     public void preDestroy(Object instance, Object creationMetaData) throws InjectionProviderException
     {
-        InstanceManager manager = instanceManagers
-                .get(ClassUtils.getContextClassLoader());
+        InstanceManager manager = instanceManagers.get(ClassUtils.getContextClassLoader());
 
         if (manager != null)
         {
@@ -63,11 +62,7 @@ public class Tomcat7AnnotationInjectionProvider extends InjectionProvider
             {
                 manager.destroyInstance(instance);
             }
-            catch (IllegalAccessException ex)
-            {
-                throw new InjectionProviderException(ex);
-            }
-            catch (InvocationTargetException ex)
+            catch (IllegalAccessException | InvocationTargetException ex)
             {
                 throw new InjectionProviderException(ex);
             }
@@ -77,8 +72,7 @@ public class Tomcat7AnnotationInjectionProvider extends InjectionProvider
     @Override
     public void postConstruct(Object instance, Object creationMetaData) throws InjectionProviderException
     {
-        InstanceManager manager = instanceManagers
-                .get(ClassUtils.getContextClassLoader());
+        InstanceManager manager = instanceManagers.get(ClassUtils.getContextClassLoader());
         if (manager == null)
         {
             //Initialize manager
@@ -93,18 +87,10 @@ public class Tomcat7AnnotationInjectionProvider extends InjectionProvider
             {
                 manager.newInstance(instance);
             }
-            catch (IllegalAccessException ex)
-            {
-                throw new InjectionProviderException(ex);
-            }
-            catch (InvocationTargetException ex)
+            catch (IllegalAccessException | InvocationTargetException | NamingException ex)
             {
                 throw new InjectionProviderException(ex);
             }
-            catch (NamingException e)
-            {
-                throw new InjectionProviderException(e);
-            }
         }
     }
 
@@ -183,8 +169,7 @@ public class Tomcat7AnnotationInjectionProvider extends InjectionProvider
                 applicationMap.get(InstanceManager.class.getName());
         if (instanceManager != null)
         {
-            instanceManagers.put(ClassUtils.getContextClassLoader(),
-                    instanceManager);
+            instanceManagers.put(ClassUtils.getContextClassLoader(), instanceManager);
         }
 
         return instanceManager;


Mime
View raw message