tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1742181 - /tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
Date Tue, 03 May 2016 18:59:05 GMT
Author: markt
Date: Tue May  3 18:59:05 2016
New Revision: 1742181

URL: http://svn.apache.org/viewvc?rev=1742181&view=rev
Log:
Avoid a URL.toString() call.
Replace startsWith() calls with equals().

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java?rev=1742181&r1=1742180&r2=1742181&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/scan/StandardJarScanner.java Tue May  3 18:59:05
2016
@@ -305,10 +305,9 @@ public class StandardJarScanner implemen
             log.trace(sm.getString("jarScan.jarUrlStart", url));
         }
 
-        String urlStr = url.toString();
-        if (urlStr.startsWith("jar:") || urlStr.endsWith(Constants.JAR_EXT)) {
+        if ("jar".equals(url.getProtocol()) || url.getPath().endsWith(Constants.JAR_EXT))
{
             callback.scan(url, webappPath, isWebapp);
-        } else if (urlStr.startsWith("file:")) {
+        } else if ("file".equals(url.getProtocol())) {
             File f;
             try {
                 f = new File(url.toURI());



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


Mime
View raw message