Skip to content

Commit

Permalink
Fix #1892 (TestChooser does not show classes list when run with java …
Browse files Browse the repository at this point in the history
…8) (#1893)

* TestChooser:fix class list not showing when run with java 8.

* Update copyright date.
  • Loading branch information
Ali-RS committed Jan 9, 2023
1 parent 00a8597 commit fe851dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions jme3-examples/src/main/java/jme3test/TestChooser.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2021 jMonkeyEngine
* Copyright (c) 2009-2023 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -217,7 +217,13 @@ private void addAllFilesInDirectory(final Path directory,
// we are only interested in .class files
if (Files.isDirectory(file)) {
if (recursive) {
addAllFilesInDirectory(file, allClasses, packageName + file.getFileName() + ".", true);
String dirName = String.valueOf(file.getFileName());
if (dirName.endsWith("/")) {
// Seems java 8 adds "/" at the end of directory name when
// reading from jar filesystem. We need to remove it. - Ali-RS 2023-1-5
dirName = dirName.substring(0, dirName.length() - 1);
}
addAllFilesInDirectory(file, allClasses, packageName + dirName + ".", true);
}
} else {
Class<?> result = load(packageName + file.getFileName());
Expand Down

0 comments on commit fe851dc

Please sign in to comment.