jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1814987 - /jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
Date Sat, 11 Nov 2017 21:19:47 GMT
Author: pmouawad
Date: Sat Nov 11 21:19:47 2017
New Revision: 1814987

URL: http://svn.apache.org/viewvc?rev=1814987&view=rev
Log:
Allow folder to end with ".jar"

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java

Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java?rev=1814987&r1=1814986&r2=1814987&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java Sat Nov 11 21:19:47
2017
@@ -203,14 +203,14 @@ public final class ClassFinder {
         Set<String> fullList = new HashSet<>();
         for (final String path : paths) {
             fullList.add(path); // Keep the unexpanded path
-            // TODO - allow directories to end with .jar by removing this check?
-            if (!path.endsWith(DOT_JAR)) {
-                File dir = new File(path);
-                if (dir.exists() && dir.isDirectory()) {
-                    String[] jars = dir.list((f, name) -> name.endsWith(DOT_JAR));
-                    if(jars != null) {
-                        Collections.addAll(fullList, jars);
-                    }
+            File dir = new File(path);
+            if (dir.exists() && dir.isDirectory()) {
+                String[] jars = dir.list((f, name) -> {
+                    File fileInDirectory = new File(f, name); 
+                    return fileInDirectory.isFile() && name.endsWith(DOT_JAR);
+                });
+                if(jars != null) {
+                    Collections.addAll(fullList, jars);
                 }
             }
         }



Mime
View raw message