mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
fixed issue whre modules were not being shown
This commit is contained in:
parent
10764b7ea3
commit
3a3402cc72
@ -222,27 +222,18 @@ public final class IngestModuleLoader {
|
||||
//netbeans uses custom class loader, otherwise can't load classes from other modules
|
||||
|
||||
final Class<?> moduleClass = Class.forName(location, false, classLoader);
|
||||
|
||||
final Type[] intfs = moduleClass.getGenericInterfaces();
|
||||
final Type intf = moduleClass.getGenericSuperclass();
|
||||
|
||||
if (intfs.length != 0 && pType != null) {
|
||||
//check if one of the module interfaces matches the pipeline type
|
||||
boolean interfaceFound = false;
|
||||
if (pType != null) {
|
||||
Class<?> moduleMeta = ((IngestModuleMapping) pType).getIngestModuleInterface();
|
||||
String moduleIntNameCan = moduleMeta.getCanonicalName();
|
||||
String[] moduleIntNameTok = moduleIntNameCan.split(" ");
|
||||
String moduleIntName = moduleIntNameTok[moduleIntNameTok.length - 1];
|
||||
for (Type intf : intfs) {
|
||||
String intNameCan = intf.toString();
|
||||
String[] intNameCanTok = intNameCan.split(" ");
|
||||
String intName = intNameCanTok[intNameCanTok.length - 1];
|
||||
if (intName.equals(moduleIntName)) {
|
||||
interfaceFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (interfaceFound == false) {
|
||||
|
||||
String intNameCan = intf.toString();
|
||||
String[] intNameCanTok = intNameCan.split(" ");
|
||||
String intName = intNameCanTok[intNameCanTok.length - 1];
|
||||
if (!intName.equals(moduleIntName)) {
|
||||
moduleErrors = true;
|
||||
logger.log(Level.WARNING, "Module class: " + location
|
||||
+ " does not implement correct interface: " + moduleMeta.getName()
|
||||
|
Loading…
x
Reference in New Issue
Block a user