From 99466cbe14031732208e0c267fec11ed821d4764 Mon Sep 17 00:00:00 2001 From: dragonmacher <48328597+dragonmacher@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:59:05 -0400 Subject: [PATCH] removal of deprecated methods --- .../locationreferences/ReferenceUtils.java | 33 ------------------- .../StructureMemberLocationDescriptor.java | 10 +++--- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/ReferenceUtils.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/ReferenceUtils.java index 7324c2daf7..69072c0e32 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/ReferenceUtils.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/ReferenceUtils.java @@ -162,39 +162,6 @@ public final class ReferenceUtils { return true; } - /** - * Returns all references (locations) that use the given datatype. - *

- * Note: This method call may take a long time, as it must search all of the data - * within the program and may also perform long running tasks, like decompiling every function - * in the program. - * - * @param accumulator the results storage. - * @param dataType The datatype for which to find references. - * @param fieldName optional field name for which to search; the {@code dataType} must be a - * {@link Composite} to search for a field. - * @param program The program from within which to find references. - * @param discoverTypes if true, the {@link DataTypeReferenceFinder} service will be used to - * search for data types that are not applied in memory. Using the service will be slower, but - * will recover type usage that could not be found by examining the Listing. - * @param monitor A task monitor to be updated as data is searched; if this is null, then a - * dummy monitor will be used. - * @throws CancelledException if the monitor is cancelled. - * @deprecated use {@link #findDataTypeFieldReferences(Accumulator, FieldMatcher, Program, - * boolean, TaskMonitor)}. - */ - @Deprecated(since = "10.2") - public static void findDataTypeReferences(Accumulator accumulator, - DataType dataType, String fieldName, Program program, boolean discoverTypes, - TaskMonitor monitor) throws CancelledException { - - // Note: none of the params can be null, but this one gets used much later, so check now - Objects.requireNonNull(dataType, () -> "Data Type cannot be null"); - - FieldMatcher fieldMatcher = new FieldMatcher(dataType, fieldName); - doFindDataTypeReferences(accumulator, fieldMatcher, program, discoverTypes, monitor); - } - /** * Returns all references (locations) that use the given datatype. *

diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/StructureMemberLocationDescriptor.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/StructureMemberLocationDescriptor.java index 054fa0a0a1..115e13db35 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/StructureMemberLocationDescriptor.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/StructureMemberLocationDescriptor.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. @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; import docking.widgets.fieldpanel.support.Highlight; +import ghidra.app.services.FieldMatcher; import ghidra.app.util.viewer.field.*; import ghidra.program.model.address.Address; import ghidra.program.model.data.Composite; @@ -93,8 +94,9 @@ public class StructureMemberLocationDescriptor extends LocationDescriptor { throws CancelledException { Composite composite = getLowestNonLeafComposite(); - ReferenceUtils.findDataTypeReferences(accumulator, composite, fieldName, program, - useDynamicSearching, monitor); + FieldMatcher fieldMatcher = new FieldMatcher(composite, fieldName); + ReferenceUtils.findDataTypeFieldReferences(accumulator, fieldMatcher, program, true, + monitor); } private Composite getLowestNonLeafComposite() {