GT-3350: Consistently ordered classpath and ExtensionPoint priorities

This commit is contained in:
Ryan Kurtz 2019-11-22 11:35:56 -05:00
parent 7ab75e411e
commit 8f00152601
52 changed files with 341 additions and 169 deletions

View file

@ -1,6 +1,5 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,12 +15,6 @@
*/
package ghidra.framework.data;
import ghidra.framework.model.*;
import ghidra.framework.store.FileSystem;
import ghidra.framework.store.LockException;
import ghidra.util.Lock;
import ghidra.util.classfinder.ClassSearcher;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@ -29,6 +22,12 @@ import java.util.concurrent.ConcurrentHashMap;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import ghidra.framework.model.*;
import ghidra.framework.store.FileSystem;
import ghidra.framework.store.LockException;
import ghidra.util.Lock;
import ghidra.util.classfinder.ClassSearcher;
/**
* An abstract class that provides default behavior for
* DomainObject(s), specifically it handles listeners and
@ -488,7 +487,7 @@ public abstract class DomainObjectAdapter implements DomainObject {
contentHandlerClassMap = new HashMap<Class<?>, ContentHandler>();
contentHandlerTypeMap = new HashMap<String, ContentHandler>();
Set<ContentHandler> handlers = ClassSearcher.getInstances(ContentHandler.class);
List<ContentHandler> handlers = ClassSearcher.getInstances(ContentHandler.class);
for (ContentHandler ch : handlers) {
String type = ch.getContentType();
Class<?> DOClass = ch.getDomainObjectClass();

View file

@ -96,7 +96,7 @@ public class ProjectDataTableModel extends ThreadedTableModel<DomainFileInfo, Pr
@SuppressWarnings("rawtypes")
private List<ProjectDataColumn<?>> findAppSpecificColumns() {
Set<ProjectDataColumn> instances = ClassSearcher.getInstances(ProjectDataColumn.class);
List<ProjectDataColumn> instances = ClassSearcher.getInstances(ProjectDataColumn.class);
List<ProjectDataColumn<?>> columns = new ArrayList<>();
for (ProjectDataColumn projectDataColumn : instances) {

View file

@ -48,7 +48,7 @@ public class PluginClassManager {
(localExclusionClass == null || !localExclusionClass.isAssignableFrom(c)) &&
!ProgramaticUseOnly.class.isAssignableFrom(c);
Set<Class<? extends Plugin>> classes =
List<Class<? extends Plugin>> classes =
ClassSearcher.getClasses(Plugin.class, myClassFilter);
for (Class<? extends Plugin> pluginClass : classes) {

View file

@ -49,7 +49,8 @@ public abstract class PluginPackage implements ExtensionPoint, Comparable<Plugin
private static Map<String, PluginPackage> createPackageMap() {
Map<String, PluginPackage> map = new HashMap<>();
Set<Class<? extends PluginPackage>> classes = ClassSearcher.getClasses(PluginPackage.class);
List<Class<? extends PluginPackage>> classes =
ClassSearcher.getClasses(PluginPackage.class);
for (Class<? extends PluginPackage> class1 : classes) {
PluginPackage pluginPackage;
try {

View file

@ -119,7 +119,7 @@ public class PluginUtils {
// Now get all Plugin.class files that have been loaded, and see if any of them
// were loaded from one of the jars we just found.
Set<Class<? extends Plugin>> plugins = ClassSearcher.getClasses(Plugin.class);
List<Class<? extends Plugin>> plugins = ClassSearcher.getClasses(Plugin.class);
for (Class<? extends Plugin> plugin : plugins) {
URL location = plugin.getResource('/' + plugin.getName().replace('.', '/') + ".class");
if (location == null) {

View file

@ -390,7 +390,7 @@ class ToolServicesImpl implements ToolServices {
}
contentHandlers = new HashSet<>();
Set<ContentHandler> instances = ClassSearcher.getInstances(ContentHandler.class);
List<ContentHandler> instances = ClassSearcher.getInstances(ContentHandler.class);
for (ContentHandler contentHandler : instances) {
// a bit of validation
String contentType = contentHandler.getContentType();

View file

@ -128,7 +128,7 @@ public class Handler extends URLStreamHandler {
private static void loadGhidraProtocolHandlers() {
protocolHandlers = new ArrayList<>();
Set<Class<? extends GhidraProtocolHandler>> classes =
List<Class<? extends GhidraProtocolHandler>> classes =
ClassSearcher.getClasses(GhidraProtocolHandler.class);
for (Class<?> c : classes) {
try {