From 8509c3a9e40009434546b5a118b267b347878641 Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Tue, 13 Aug 2024 09:16:59 -0400 Subject: [PATCH] GP-4844: Fixed ClassSearcher exception when launching from single jar mode (Closes #6809) --- .../Base/src/main/java/ghidra/util/GhidraJarBuilder.java | 6 +++--- .../main/java/ghidra/util/classfinder/ClassSearcher.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/util/GhidraJarBuilder.java b/Ghidra/Features/Base/src/main/java/ghidra/util/GhidraJarBuilder.java index abca54291e..a19a3ff0ad 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/util/GhidraJarBuilder.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/util/GhidraJarBuilder.java @@ -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. @@ -621,7 +621,7 @@ public class GhidraJarBuilder implements GhidraLaunchable { if (clazz == null) { System.out.println("Couldn't load " + path); } - else if (ClassSearcher.isClassOfInterest(clazz)) { + else { extensionPointClasses.add(clazz.getName()); } } diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/util/classfinder/ClassSearcher.java b/Ghidra/Framework/Generic/src/main/java/ghidra/util/classfinder/ClassSearcher.java index 011acf42d7..90b58a63c2 100644 --- a/Ghidra/Framework/Generic/src/main/java/ghidra/util/classfinder/ClassSearcher.java +++ b/Ghidra/Framework/Generic/src/main/java/ghidra/util/classfinder/ClassSearcher.java @@ -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. @@ -176,7 +176,7 @@ public class ClassSearcher { } List> list = new ArrayList<>(); - for (ClassFileInfo info : extensionPointSuffixToInfoMap.get(suffix)) { + for (ClassFileInfo info : extensionPointSuffixToInfoMap.getOrDefault(suffix, Set.of())) { if (falsePositiveCache.contains(info)) { continue;