rzo1 commented on code in PR #57:
URL: https://github.com/apache/geronimo-xbean/pull/57#discussion_r3530853791
##########
xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java:
##########
@@ -162,36 +157,36 @@ protected Class<?> loadClass(String fixedName) throws
ClassNotFoundException {
- private List<String> file(URL location) {
- List<String> classNames = new ArrayList<String>();
+ private void file(URL location) throws IOException {
File dir = new File(URLDecoder.decode(location.getPath()));
if (dir.getName().equals("META-INF")) {
dir = dir.getParentFile(); // Scrape "META-INF" off
}
if (dir.isDirectory()) {
- scanDir(dir, classNames, "");
+ scanDir(dir);
}
- return classNames;
}
- private void scanDir(File dir, List<String> classNames, String
packageName) {
+ private void scanDir(File dir) throws IOException {
File[] files = dir.listFiles();
if (files == null) {
return;
}
for (File file : files) {
if (file.isDirectory()) {
- scanDir(file, classNames, packageName + file.getName() + ".");
+ scanDir(file);
} else if (file.getName().endsWith(".class")) {
- String name = file.getName();
- name = name.replaceFirst(".class$", "");
- if (name.contains(".")) continue;
Review Comment:
The removed if (name.contains(".")) continue; filters mean non-classfile
artifacts named *.class are now fed to ASM. E.g. a macOS AppleDouble sidecar
._Foo.class was previously skipped before any bytes were read; now ClassReader
throws a RuntimeException on the garbage bytes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]