Skip to content

Commit b4f92e9

Browse files
committed
Allow folder to end with ".jar"
git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1814987 13f79535-47bb-0310-9956-ffa450edef68 Former-commit-id: c162d20
1 parent 35a2570 commit b4f92e9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/jorphan/org/apache/jorphan/reflect/ClassFinder.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,14 @@ private static String[] addJarsInPath(String[] paths) {
203203
Set<String> fullList = new HashSet<>();
204204
for (final String path : paths) {
205205
fullList.add(path); // Keep the unexpanded path
206-
// TODO - allow directories to end with .jar by removing this check?
207-
if (!path.endsWith(DOT_JAR)) {
208-
File dir = new File(path);
209-
if (dir.exists() && dir.isDirectory()) {
210-
String[] jars = dir.list((f, name) -> name.endsWith(DOT_JAR));
211-
if(jars != null) {
212-
Collections.addAll(fullList, jars);
213-
}
206+
File dir = new File(path);
207+
if (dir.exists() && dir.isDirectory()) {
208+
String[] jars = dir.list((f, name) -> {
209+
File fileInDirectory = new File(f, name);
210+
return fileInDirectory.isFile() && name.endsWith(DOT_JAR);
211+
});
212+
if(jars != null) {
213+
Collections.addAll(fullList, jars);
214214
}
215215
}
216216
}

0 commit comments

Comments
 (0)