You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by wt...@apache.org on 2019/06/07 18:13:22 UTC

[myfaces] branch 2.1.x updated: move catch block to catch StringOutOfBounds Exception in some applications

This is an automated email from the ASF dual-hosted git repository.

wtlucy pushed a commit to branch 2.1.x
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/2.1.x by this push:
     new 51793d3  move catch block to catch StringOutOfBounds Exception in some applications
     new 92746e5  Merge pull request #56 from wtlucy/MYFACES-4292-fix-StringOutOfBoundsException-2.1.x
51793d3 is described below

commit 51793d34e080d31717c9db2dcc2f5871513f72e9
Author: Volodymyr Siedlecki <si...@volodymyrs-mbp.raleigh.ibm.com>
AuthorDate: Wed Jun 5 16:03:44 2019 -0400

    move catch block to catch StringOutOfBounds Exception in some applications
---
 .../myfaces/view/facelets/util/Classpath.java      | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/util/Classpath.java b/impl/src/main/java/org/apache/myfaces/view/facelets/util/Classpath.java
index 9b59644..dba7f57 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/util/Classpath.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/util/Classpath.java
@@ -88,20 +88,7 @@ public final class Classpath
             {
                 if (conn instanceof JarURLConnection)
                 {
-                    try
-                    {
                         jar = ((JarURLConnection) conn).getJarFile();
-                    }
-                    
-                    catch (Throwable e)
-                    {
-                        // This can happen if the classloader provided us a URL that it thinks exists
-                        // but really doesn't.  In particular, if a JAR contains META-INF/MANIFEST.MF
-                        // but not META-INF/, some classloaders may incorrectly report that META-INF/
-                        // exists and we'll end up here.  Just ignore this case.
-                        
-                        continue;
-                    }
                 }
                 else
                 {
@@ -120,6 +107,15 @@ public final class Classpath
                     }
                 }    
             }
+            catch (Throwable e)
+            {
+                // This can happen if the classloader provided us a URL that it thinks exists
+                // but really doesn't.  In particular, if a JAR contains META-INF/MANIFEST.MF
+                // but not META-INF/, some classloaders may incorrectly report that META-INF/
+                // exists and we'll end up here.  Just ignore this case.
+                
+                continue;
+            }
             finally 
             {
                 if (jar != null)