Merge remote-tracking branch

'origin/GP-3490_ryanmkurtz_eclipse-classpath--SQUASHED' (Closes #6734)
This commit is contained in:
Ryan Kurtz 2024-07-26 13:13:54 -04:00
commit fd1fb151e5
16 changed files with 285 additions and 141 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -30,7 +30,6 @@ import java.util.stream.Collectors;
import javax.swing.event.ChangeListener;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -491,24 +490,11 @@ public class ClassSearcher {
// jar files will *not* be on the standard classpath, but instead will be on CP_EXT.
//
List<String> rawPaths = new ArrayList<>();
getPropertyPaths(GhidraClassLoader.CP, rawPaths);
getPropertyPaths(GhidraClassLoader.CP_EXT, rawPaths);
rawPaths.addAll(GhidraClassLoader.getClasspath(GhidraClassLoader.CP));
rawPaths.addAll(GhidraClassLoader.getClasspath(GhidraClassLoader.CP_EXT));
return canonicalizePaths(rawPaths);
}
private static void getPropertyPaths(String property, List<String> results) {
String paths = System.getProperty(property);
log.trace("Paths in {}: {}", property, paths);
if (StringUtils.isBlank(paths)) {
return;
}
StringTokenizer st = new StringTokenizer(paths, File.pathSeparator);
while (st.hasMoreTokens()) {
results.add(st.nextToken());
}
}
private static List<String> canonicalizePaths(Collection<String> paths) {
//@formatter:off