You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2011/02/15 02:18:46 UTC

svn commit: r1070718 - /geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JarFileTldScanner.java

Author: xuhaihong
Date: Tue Feb 15 01:18:46 2011
New Revision: 1070718

URL: http://svn.apache.org/viewvc?rev=1070718&view=rev
Log:
GERONIMO-5778 Exclude jars from annotation scanning and/or bundle classpath

Modified:
    geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JarFileTldScanner.java

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JarFileTldScanner.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JarFileTldScanner.java?rev=1070718&r1=1070717&r2=1070718&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JarFileTldScanner.java (original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JarFileTldScanner.java Tue Feb 15 01:18:46 2011
@@ -60,30 +60,27 @@ public class JarFileTldScanner {
         try {
             Enumeration<JarEntry> entries = jarFile.entries();
             while (entries.hasMoreElements()) {
-                JarEntry jarEntry = entries.nextElement();
-                if(jarEntry.getName().endsWith(".tld")) {
-                    String jarEntryName = jarEntry.getName();
+                String jarEntryName = entries.nextElement().getName();
+                if (jarEntryName.startsWith("WEB-INF") && jarEntryName.endsWith(".tld")) {
+
                     if (jarEntryName.startsWith("WEB-INF/classes") || jarEntryName.startsWith("WEB-INF/lib") || (jarEntryName.startsWith("WEB-INF/tags") && !jarEntryName.endsWith("implicit.tld"))) {
                         continue;
                     }
-                    File targetFile = webModule.getEarContext().getTargetFile(webModule.resolve(createURI(jarEntry.getName())));
+                    File targetFile = webModule.getEarContext().getTargetFile(webModule.resolve(createURI(jarEntryName)));
                     if (targetFile != null) {
                         modURLs.add(targetFile.toURI().toURL());
                     }
-                }
-                if (jarEntry.getName().startsWith("WEB-INF/lib/") && jarEntry.getName().endsWith(".jar")) {
-                    File targetFile = webModule.getEarContext().getTargetFile(webModule.resolve(createURI(jarEntry.getName())));
+                } else if (jarEntryName.startsWith("WEB-INF/lib/") && jarEntryName.endsWith(".jar")) {
+                    File targetFile = webModule.getEarContext().getTargetFile(webModule.resolve(createURI(jarEntryName)));
                     List<URL> jarUrls = scanJAR(new JarFile(targetFile), "META-INF/");
                     for (URL jarURL : jarUrls) {
                         modURLs.add(jarURL);
                     }
                 }
             }
-        }
-        catch (IOException ioe) {
+        } catch (IOException ioe) {
             throw new DeploymentException("Could not scan module for TLD files: " + webModule.getName() + " " + ioe.getMessage(), ioe);
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             throw new DeploymentException("Could not scan module for TLD files: " + webModule.getName() + " " + e.getMessage(), e);
         }