GP-0: Fixing warning in GhidraScript.java

This commit is contained in:
Ryan Kurtz 2024-10-11 08:55:20 -04:00
parent a3d606ad87
commit d4a3e7d4bf
2 changed files with 7 additions and 7 deletions

View File

@ -938,12 +938,12 @@ public abstract class GhidraScript extends FlatProgramAPI {
* Returns a demangled version of the mangled string. * Returns a demangled version of the mangled string.
* *
* @param mangled the mangled string to demangled * @param mangled the mangled string to demangled
* @return a demangled version of the mangled string * @return a demangled version of the mangled string, or null if it could not be demangled
*/ */
public String getDemangled(String mangled) { public String getDemangled(String mangled) {
DemangledObject demangledObj = DemanglerUtil.demangle(mangled); List<DemangledObject> demangledObjs = DemanglerUtil.demangle(currentProgram, mangled, null);
if (demangledObj != null) { if (!demangledObjs.isEmpty()) {
return demangledObj.getSignature(false); return demangledObjs.getFirst().getSignature(false);
} }
return null; return null;
} }

View File

@ -83,7 +83,7 @@ public class DemanglerUtil {
* Deprecated. Use {@link #demangle(Program, String, Address)}. See class header for more * Deprecated. Use {@link #demangle(Program, String, Address)}. See class header for more
* details. * details.
* *
* Locates all available demanglers and checks to see if the supplied program is * <p>Locates all available demanglers and checks to see if the supplied program is
* supported, then it attempts to demangle. * supported, then it attempts to demangle.
* *
* <p>This method will use only the default options for demangling. If you need to * <p>This method will use only the default options for demangling. If you need to
@ -131,9 +131,9 @@ public class DemanglerUtil {
* {@link Demangler#createMangledContext(String, DemanglerOptions, Program, Address)} and * {@link Demangler#createMangledContext(String, DemanglerOptions, Program, Address)} and
* {@link Demangler#createDefaultOptions()}. * {@link Demangler#createDefaultOptions()}.
* *
* @param program the program containing the mangled name * @param program the program containing the mangled name; can be null
* @param mangled the mangled name * @param mangled the mangled name
* @param address the address of the mangled name * @param address the address of the mangled name; can be null
* @return the list of {@link DemangledObject} * @return the list of {@link DemangledObject}
*/ */
public static List<DemangledObject> demangle(Program program, String mangled, Address address) { public static List<DemangledObject> demangle(Program program, String mangled, Address address) {