tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1428079 - /tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java
Date Wed, 02 Jan 2013 21:48:10 GMT
Author: markt
Date: Wed Jan  2 21:48:09 2013
New Revision: 1428079

URL: http://svn.apache.org/viewvc?rev=1428079&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54256
Give the developer a hint as to which JAR file has the broken manifest

Modified:
    tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java

Modified: tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java?rev=1428079&r1=1428078&r2=1428079&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/ExtensionValidator.java Wed Jan  2 21:48:09
2013
@@ -159,23 +159,26 @@ public final class ExtensionValidator {
             }
         }
 
+        // Primarily used for error reporting
+        String jarName = null;
         try {
             WebResource[] jars = resources.listResources("/WEB-INF/lib");
             for (WebResource jar : jars) {
-                if (jar.getName().toLowerCase(Locale.ENGLISH).endsWith(".jar") &&
+                jarName = jar.getName();
+                if (jarName.toLowerCase(Locale.ENGLISH).endsWith(".jar") &&
                         jar.isFile()) {
 
                     inputStream = jar.getInputStream();
                     Manifest jmanifest = getManifest(inputStream);
                     if (jmanifest != null) {
-                        ManifestResource mre = new ManifestResource(
-                                                    jar.getName(),
-                                                    jmanifest,
-                                                    ManifestResource.APPLICATION);
+                        ManifestResource mre = new ManifestResource(jarName,
+                                jmanifest, ManifestResource.APPLICATION);
                         appManifestResources.add(mre);
                     }
                 }
             }
+        } catch (IOException ioe) {
+            throw new IOException("Jar: " + jarName, ioe);
         } finally {
             if (inputStream != null) {
                 try {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message