diff --git a/Ghidra/Features/Base/ghidra_scripts/FindAndReplaceCommentScript.java b/Ghidra/Features/Base/ghidra_scripts/FindAndReplaceCommentScript.java index fc62452e2d..5ab6e73cb0 100644 --- a/Ghidra/Features/Base/ghidra_scripts/FindAndReplaceCommentScript.java +++ b/Ghidra/Features/Base/ghidra_scripts/FindAndReplaceCommentScript.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. @@ -17,18 +17,17 @@ //@category Update -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import ghidra.app.script.GhidraScript; import ghidra.program.model.address.Address; import ghidra.program.model.address.AddressIterator; +import ghidra.program.model.listing.CommentType; import ghidra.program.model.listing.Listing; import ghidra.program.model.mem.Memory; public class FindAndReplaceCommentScript extends GhidraScript { - private static final String[] COMMENT_TYPES = { "EOL", "Pre", "Post", "Plate", "Repeatable" }; - @Override public void run() throws Exception { Listing listing = currentProgram.getListing(); @@ -43,14 +42,14 @@ public class FindAndReplaceCommentScript extends GhidraScript { while (commentAddresses.hasNext()) { Address address = commentAddresses.next(); - for (int i = 0; i < COMMENT_TYPES.length; i++) { - String commentValue = listing.getComment(i, address); + for (CommentType type : CommentType.values()) { + String commentValue = listing.getComment(type, address); if (commentValue != null && commentValue.contains(toFind)) { replaced = true; - listing.setComment(address, i, StringUtils.replace(commentValue, toFind, toReplace)); - printf("\nChanged %s Comment at address %s.\n", COMMENT_TYPES[i], - address.toString()); + listing.setComment(address, type, + Strings.CS.replace(commentValue, toFind, toReplace)); + printf("\nChanged %s Comment at address %s.\n", type, address.toString()); } } } diff --git a/Ghidra/Features/Base/ghidra_scripts/MakeFunctionsInlineVoidScript.java b/Ghidra/Features/Base/ghidra_scripts/MakeFunctionsInlineVoidScript.java index 0627b84356..dc014331f5 100644 --- a/Ghidra/Features/Base/ghidra_scripts/MakeFunctionsInlineVoidScript.java +++ b/Ghidra/Features/Base/ghidra_scripts/MakeFunctionsInlineVoidScript.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. @@ -18,7 +18,7 @@ //@category Functions import ghidra.app.script.GhidraScript; -import ghidra.program.model.data.DataType; +import ghidra.program.model.data.VoidDataType; import ghidra.program.model.listing.Function; import ghidra.program.model.listing.FunctionIterator; import ghidra.program.model.symbol.SourceType; @@ -52,6 +52,6 @@ public class MakeFunctionsInlineVoidScript extends GhidraScript { private void updateFunction(Function func) throws InvalidInputException { func.setInline(true); - func.setReturnType(DataType.VOID, SourceType.USER_DEFINED); + func.setReturnType(VoidDataType.dataType, SourceType.USER_DEFINED); } } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/label/AddUniqueLabelCmd.java b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/label/AddUniqueLabelCmd.java index 32e316d4e8..ba562a79cb 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/label/AddUniqueLabelCmd.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/label/AddUniqueLabelCmd.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. @@ -27,7 +27,7 @@ import ghidra.util.exception.InvalidInputException; * it unique. * @deprecated The need for this class is now unnecessary since duplicate labels are permitted */ -@Deprecated +@Deprecated(since = "9.1") public class AddUniqueLabelCmd implements Command { private Address address; private String name; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datawindow/DataWindowFilterDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datawindow/DataWindowFilterDialog.java index 22383b4b30..8693fb4f5e 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datawindow/DataWindowFilterDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datawindow/DataWindowFilterDialog.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. @@ -24,6 +24,7 @@ import java.util.Map.Entry; import javax.swing.*; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import docking.DialogComponentProvider; import docking.DockingUtils; @@ -184,7 +185,7 @@ class DataWindowFilterDialog extends DialogComponentProvider { for (String type : filteredList) { Boolean enabled = typeEnabledMap.get(type); StringBuilder html = new StringBuilder(type); - int firstIndex = StringUtils.indexOfIgnoreCase(type, filteredText, 0); + int firstIndex = Strings.CI.indexOf(type, filteredText, 0); int lastIndex = firstIndex + filteredText.length(); html.insert(lastIndex, ""); // do before first index (for no math on index) html.insert(firstIndex, ""); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/CreateArrayAction.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/CreateArrayAction.java index 31c1adf85e..aff95a042f 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/CreateArrayAction.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/CreateArrayAction.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. @@ -82,7 +82,7 @@ class CreateArrayAction extends ListingContextAction { Function fun = plugin.getFunction(context); if (loc instanceof FunctionSignatureFieldLocation) { DataType dt = fun.getReturnType(); - if (dt == DataType.VOID) { + if (dt == VoidDataType.dataType) { dt = DataType.DEFAULT; } if (dt.getLength() < 1) { diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/FunctionPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/FunctionPlugin.java index ac5485a4e0..7123eefd24 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/FunctionPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/FunctionPlugin.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. @@ -478,7 +478,7 @@ public class FunctionPlugin extends Plugin implements DataService { return false; } - if (dataType != DataType.DEFAULT && dataType != DataType.VOID) { + if (dataType != DataType.DEFAULT && dataType != VoidDataType.dataType) { dtmService.setRecentlyUsed(dataType); } @@ -652,7 +652,8 @@ public class FunctionPlugin extends Plugin implements DataService { // Add Favorite data actions List favorites = dtmService.getFavorites(); for (DataType dataType : favorites) { - if (dataType.isEquivalent(POINTER_DATA_TYPE) || dataType.isEquivalent(DataType.VOID)) { + if (dataType.isEquivalent(POINTER_DATA_TYPE) || + dataType.isEquivalent(VoidDataType.dataType)) { continue; } action = new DataAction(dataType, this); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/VoidDataAction.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/VoidDataAction.java index 3ebf6693b7..a580e01d6a 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/VoidDataAction.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/VoidDataAction.java @@ -1,13 +1,12 @@ /* ### * 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. * 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. @@ -16,16 +15,16 @@ */ package ghidra.app.plugin.core.function; -import ghidra.program.model.data.DataType; - import java.awt.event.KeyEvent; import javax.swing.KeyStroke; +import ghidra.program.model.data.VoidDataType; + public class VoidDataAction extends DataAction { public VoidDataAction(FunctionPlugin plugin) { - super(DataType.VOID, plugin); + super(VoidDataType.dataType, plugin); setPopupMenu(FunctionPlugin.SET_RETURN_TYPE_MENU_PATH, true); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/GenericCompositeDataTypeLocationDescriptor.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/GenericCompositeDataTypeLocationDescriptor.java index 0d583d58b9..503e55dae7 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/GenericCompositeDataTypeLocationDescriptor.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/GenericCompositeDataTypeLocationDescriptor.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. @@ -17,7 +17,7 @@ package ghidra.app.plugin.core.navigation.locationreferences; import java.awt.Color; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import docking.widgets.fieldpanel.support.Highlight; import ghidra.app.services.FieldMatcher; @@ -119,7 +119,7 @@ public class GenericCompositeDataTypeLocationDescriptor extends GenericDataTypeL else if (OperandFieldFactory.class.isAssignableFrom(fieldFactoryClass)) { // Not sure how to get the correct part of the text. This is a hack for now. - int offset = StringUtils.indexOfIgnoreCase(text, typeDisplayString, 0); + int offset = Strings.CI.indexOf(text, typeDisplayString, 0); if (offset != -1) { return new Highlight[] { new Highlight(offset, offset + typeDisplayString.length() - 1, highlightColor) }; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/script/GhidraScriptUtil.java b/Ghidra/Features/Base/src/main/java/ghidra/app/script/GhidraScriptUtil.java index 68980a66a1..2a9e3cead7 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/script/GhidraScriptUtil.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/script/GhidraScriptUtil.java @@ -405,7 +405,7 @@ public class GhidraScriptUtil { * @param name the name of the script * @return the name as a file path */ - @Deprecated + @Deprecated(since = "9.2.3") static String fixupName(String name) { GhidraScriptProvider provider = findProvider(name); // assume Java if no provider matched diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/services/BlockModelService.java b/Ghidra/Features/Base/src/main/java/ghidra/app/services/BlockModelService.java index 7d83ffe6fd..4b58cd47f9 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/services/BlockModelService.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/services/BlockModelService.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. @@ -133,7 +133,7 @@ public interface BlockModelService { * @return new Subroutine Block model instance or null if program is not open * @deprecated use getActiveSubroutineModel(Program) instead */ - @Deprecated + @Deprecated(since = "9.0") public CodeBlockModel getActiveSubroutineModel(); /** @@ -142,7 +142,7 @@ public interface BlockModelService { * @return new Subroutine Block model instance or null if program is not open * @deprecated use getActiveSubroutineModel(Program) instead */ - @Deprecated + @Deprecated(since = "9.0") public CodeBlockModel getActiveSubroutineModel(boolean includeExternals); /** diff --git a/Ghidra/Features/Base/src/main/java/ghidra/util/data/DataTypeParser.java b/Ghidra/Features/Base/src/main/java/ghidra/util/data/DataTypeParser.java index c882ba48e6..687492be23 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/util/data/DataTypeParser.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/util/data/DataTypeParser.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import ghidra.app.plugin.core.datamgr.util.DataTypeUtils; import ghidra.app.services.DataTypeQueryService; @@ -540,7 +541,7 @@ public class DataTypeParser { throw new NumberFormatException(); } size = size.trim(); - if (StringUtils.startsWithIgnoreCase(size, "0x")) { + if (Strings.CI.startsWith(size, "0x")) { return Integer.parseInt(size.substring(2), 16); } return Integer.parseInt(size); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/util/table/GhidraTable.java b/Ghidra/Features/Base/src/main/java/ghidra/util/table/GhidraTable.java index 45f2aef0de..0d1a855f50 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/util/table/GhidraTable.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/util/table/GhidraTable.java @@ -85,7 +85,7 @@ public class GhidraTable extends GTable { * @deprecated use {@link #installNavigation(ServiceProvider)} or * {@link #installNavigation(ServiceProvider,Navigatable)} */ - @Deprecated + @Deprecated(since = "10.4") public void installNavigation(GoToService goToService, Navigatable nav) { installNavigation(new GoToServiceProvider(goToService), nav); } diff --git a/Ghidra/Features/Base/src/main/java/help/screenshot/TutorialScreenShotGenerator.java b/Ghidra/Features/Base/src/main/java/help/screenshot/TutorialScreenShotGenerator.java index 742d331396..115b38c1f4 100644 --- a/Ghidra/Features/Base/src/main/java/help/screenshot/TutorialScreenShotGenerator.java +++ b/Ghidra/Features/Base/src/main/java/help/screenshot/TutorialScreenShotGenerator.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. @@ -34,7 +34,7 @@ public class TutorialScreenShotGenerator extends AbstractScreenShotGenerator { * NOTE: Please do not remove this until we have decided how to create a showImage() method * that is compatible with screenshots NOT in Help (ahem, Tutorial!!!). */ - @Deprecated + @Deprecated(since = "9.0") public void showImage() { ImageDialogProvider dialog = new ImageDialogProvider(null, null, image); tool.showDialog(dialog); diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/OverridePrototypeAction.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/OverridePrototypeAction.java index 158125d867..aa51188702 100644 --- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/OverridePrototypeAction.java +++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/OverridePrototypeAction.java @@ -196,7 +196,7 @@ public class OverridePrototypeAction extends AbstractDecompilerAction { buf.append(dt.getDisplayName()); } else { - buf.append(DataType.VOID.getDisplayName()); + buf.append(VoidDataType.dataType.getDisplayName()); } buf.append(' ').append(name).append('('); diff --git a/Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/plugin/core/string/variadic/FormatStringParser.java b/Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/plugin/core/string/variadic/FormatStringParser.java index 957d25b555..0ceeeb87a9 100644 --- a/Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/plugin/core/string/variadic/FormatStringParser.java +++ b/Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/plugin/core/string/variadic/FormatStringParser.java @@ -659,7 +659,7 @@ public class FormatStringParser { case 'X': return new UnsignedIntegerDataType(dataTypeManager); case 'p': - return dataTypeManager.getPointer(DataType.VOID); + return dataTypeManager.getPointer(VoidDataType.dataType); case 's': return dataTypeManager.getPointer(new CharDataType(dataTypeManager)); case 'n': diff --git a/Ghidra/Features/GnuDemangler/src/main/java/ghidra/app/util/demangler/gnu/GnuDemanglerParser.java b/Ghidra/Features/GnuDemangler/src/main/java/ghidra/app/util/demangler/gnu/GnuDemanglerParser.java index 4511cec04e..2a1e2f0bba 100644 --- a/Ghidra/Features/GnuDemangler/src/main/java/ghidra/app/util/demangler/gnu/GnuDemanglerParser.java +++ b/Ghidra/Features/GnuDemangler/src/main/java/ghidra/app/util/demangler/gnu/GnuDemanglerParser.java @@ -23,6 +23,7 @@ import java.util.stream.Collectors; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -602,7 +603,7 @@ public class GnuDemanglerParser { private String replaceStdLibraryTypes(String demangled) { String d = demangled; for (GnuDemanglerReplacement replacement : REPLACEMENTS) { - d = StringUtils.replace(d, replacement.find(), replacement.replace()); + d = Strings.CS.replace(d, replacement.find(), replacement.replace()); } return d; } diff --git a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/MDMangUtils.java b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/MDMangUtils.java index c244a58624..16c700637b 100644 --- a/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/MDMangUtils.java +++ b/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/MDMangUtils.java @@ -20,8 +20,7 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.*; import ghidra.app.util.SymbolPath; import ghidra.app.util.SymbolPathParser; @@ -273,7 +272,7 @@ public class MDMangUtils { for (int i = 0; i < parts.size(); i++) { String part = parts.get(i); // These anonymous namespaces are those that come in the clear (non-mangled) - StringUtils.replace(part, "`anonymous-namespace'", "`anonymous namespace'"); + Strings.CS.replace(part, "`anonymous-namespace'", "`anonymous namespace'"); StringBuilder sb = new StringBuilder(); Matcher m = LOCAL_NS_PATTERN.matcher(part); if (m.find()) { @@ -306,7 +305,7 @@ public class MDMangUtils { for (int i = 0; i < parts.size(); i++) { String part = parts.get(i); // These anonymous namespaces are those that come in the clear (non-mangled) - StringUtils.replace(part, "`anonymous-namespace'", "`anonymous namespace'"); + Strings.CS.replace(part, "`anonymous-namespace'", "`anonymous namespace'"); StringBuilder sb = new StringBuilder(); Matcher m = DEMANGLED_LOCAL_NS_PATTERN.matcher(part); if (m.find()) { diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/PdbDataTypeParser.java b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/PdbDataTypeParser.java index 08a78bee4d..b74e240c2a 100644 --- a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/PdbDataTypeParser.java +++ b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/PdbDataTypeParser.java @@ -17,7 +17,7 @@ package ghidra.app.util.bin.format.pdb; import java.util.*; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import ghidra.app.services.DataTypeManagerService; import ghidra.program.database.data.DataTypeUtilities; @@ -195,7 +195,7 @@ class PdbDataTypeParser { } // Deal with other unrecognized types - dataTypeName = StringUtils.replace(dataTypeName, "", "undefined"); + dataTypeName = Strings.CS.replace(dataTypeName, "", "undefined"); // Example type representations: // char *[2][3] pointer(array(array(char,3),2)) diff --git a/Ghidra/Framework/DB/src/main/java/db/IndexField.java b/Ghidra/Framework/DB/src/main/java/db/IndexField.java index 836673ab16..7b7a9bcbca 100644 --- a/Ghidra/Framework/DB/src/main/java/db/IndexField.java +++ b/Ghidra/Framework/DB/src/main/java/db/IndexField.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. @@ -81,7 +81,7 @@ class IndexField extends Field { * @deprecated this method serves no real purpose since the non-truncated * indexed field value is not retained within the index table. */ - @Deprecated + @Deprecated(since = "9.2") Field getNonTruncatedIndexField() { return nonTruncatedIndexedField; } @@ -93,7 +93,7 @@ class IndexField extends Field { * @deprecated this method serves no real purpose since the truncation * status is not retained within the index table. */ - @Deprecated + @Deprecated(since = "9.2") boolean usesTruncatedFieldValue() { return isTruncated; } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/menu/DockingToolBarUtils.java b/Ghidra/Framework/Docking/src/main/java/docking/menu/DockingToolBarUtils.java index 4ff4a85990..bd775d00c3 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/menu/DockingToolBarUtils.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/menu/DockingToolBarUtils.java @@ -22,6 +22,7 @@ import javax.swing.JButton; import javax.swing.KeyStroke; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import docking.action.DockingActionIf; import ghidra.docking.util.LookAndFeelUtils; @@ -63,7 +64,7 @@ public class DockingToolBarUtils { StringBuilder buffy = new StringBuilder(toolTipText); if (StringUtilities.startsWithIgnoreCase(toolTipText, "")) { String endHTMLTag = ""; - int closeTagIndex = StringUtils.indexOfIgnoreCase(toolTipText, endHTMLTag); + int closeTagIndex = Strings.CI.indexOf(toolTipText, endHTMLTag); if (closeTagIndex < 0) { // no closing tag, which is acceptable buffy.append(START_KEYBINDING_TEXT) diff --git a/Ghidra/Framework/Docking/src/main/java/docking/test/AbstractDockingTest.java b/Ghidra/Framework/Docking/src/main/java/docking/test/AbstractDockingTest.java index 3629dbee75..75c3714297 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/test/AbstractDockingTest.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/test/AbstractDockingTest.java @@ -255,7 +255,7 @@ public abstract class AbstractDockingTest extends AbstractGuiTest { * (we are standardizing timeouts). The timeouts passed to this method will * be ignored in favor of the standard value. */ - @Deprecated + @Deprecated(since = "9.1") public static Window waitForWindow(String title, int timeoutMS) { return waitForWindow(title); } @@ -610,7 +610,7 @@ public abstract class AbstractDockingTest extends AbstractGuiTest { * (we are standardizing timeouts). The timeouts passed to this method will * be ignored in favor of the standard value. */ - @Deprecated + @Deprecated(since = "9.1") public static T waitForDialogComponent(Window parentWindow, Class clazz, int timeoutMS) { if (!DialogComponentProvider.class.isAssignableFrom(clazz)) { diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/AutoLookup.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/AutoLookup.java index 882efbd1a6..3c07525a98 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/AutoLookup.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/AutoLookup.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. @@ -19,7 +19,7 @@ import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.util.function.Predicate; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; /** * A class that holds the logic and state for finding matching rows in a widget when a user types @@ -183,7 +183,7 @@ public abstract class AutoLookup { private boolean textMatches(String text, int row, int col) { String value = getValueString(row, col); - return StringUtils.startsWithIgnoreCase(value, text); + return Strings.CI.startsWith(value, text); } private boolean isIgnorableKeyEvent(KeyEvent event) { diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/GComponent.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/GComponent.java index 715396501f..1851c630ad 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/GComponent.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/GComponent.java @@ -17,7 +17,7 @@ package docking.widgets; import javax.swing.JComponent; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import docking.widgets.label.GLabel; import ghidra.util.Msg; @@ -57,7 +57,7 @@ public interface GComponent { */ public static void warnAboutHtmlText(String text) { // #ifdef still_finding_html_labels_in_our_huge_codebase - if (StringUtils.startsWithIgnoreCase(text, "")) { + if (Strings.CI.startsWith(text, "")) { Msg.warn(GLabel.class, "HTML text detected in non-HTML component: " + text, ReflectionUtilities.createJavaFilteredThrowable()); } diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/app/util/importer/MessageLog.java b/Ghidra/Framework/Generic/src/main/java/ghidra/app/util/importer/MessageLog.java index a37bcf00b6..ec2dc3c53a 100644 --- a/Ghidra/Framework/Generic/src/main/java/ghidra/app/util/importer/MessageLog.java +++ b/Ghidra/Framework/Generic/src/main/java/ghidra/app/util/importer/MessageLog.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. @@ -103,7 +103,7 @@ public class MessageLog { * @param message the message * @deprecated use {@link #appendMsg(String)} */ - @Deprecated + @Deprecated(since = "9.2") public void error(String originator, String message) { appendMsg(originator, message); } diff --git a/Ghidra/Framework/Generic/src/test/java/util/CollectionUtilsTest.java b/Ghidra/Framework/Generic/src/test/java/util/CollectionUtilsTest.java index 607b95089c..9dfb756e31 100644 --- a/Ghidra/Framework/Generic/src/test/java/util/CollectionUtilsTest.java +++ b/Ghidra/Framework/Generic/src/test/java/util/CollectionUtilsTest.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. @@ -15,7 +15,8 @@ */ package util; -import static org.hamcrest.collection.IsIn.*; +import static org.hamcrest.Matchers.*; +import static org.hamcrest.collection.IsIn.oneOf; import static org.junit.Assert.*; import java.util.*; @@ -300,7 +301,7 @@ public class CollectionUtilsTest { Collection c = Arrays.asList("One", "Two"); String any = CollectionUtils.any(c); assertNotNull(any); - assertThat(any, isOneOf("One", "Two")); + assertThat(any, is(oneOf("One", "Two"))); } @Test diff --git a/Ghidra/Framework/Gui/src/main/java/generic/theme/ColorValue.java b/Ghidra/Framework/Gui/src/main/java/generic/theme/ColorValue.java index a4e95c4b15..7c2b206d52 100644 --- a/Ghidra/Framework/Gui/src/main/java/generic/theme/ColorValue.java +++ b/Ghidra/Framework/Gui/src/main/java/generic/theme/ColorValue.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. @@ -17,7 +17,7 @@ package generic.theme; import java.awt.Color; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import ghidra.util.Msg; import ghidra.util.WebColors; @@ -77,7 +77,7 @@ public class ColorValue extends ThemeValue { * @return true if the given key string is a valid external key for a color value */ public static boolean isColorKey(String key) { - return StringUtils.startsWithAny(key, COLOR_ID_PREFIX, EXTERNAL_PREFIX, + return Strings.CS.startsWithAny(key, COLOR_ID_PREFIX, EXTERNAL_PREFIX, EXTERNAL_LAF_ID_PREFIX); } diff --git a/Ghidra/Framework/Gui/src/main/java/generic/theme/FontValue.java b/Ghidra/Framework/Gui/src/main/java/generic/theme/FontValue.java index cc98544114..3c6100e8e3 100644 --- a/Ghidra/Framework/Gui/src/main/java/generic/theme/FontValue.java +++ b/Ghidra/Framework/Gui/src/main/java/generic/theme/FontValue.java @@ -18,7 +18,7 @@ package generic.theme; import java.awt.Font; import java.text.ParseException; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import ghidra.util.Msg; @@ -110,7 +110,7 @@ public class FontValue extends ThemeValue { * @return true if the given key string is a valid external key for a font value */ public static boolean isFontKey(String key) { - return StringUtils.startsWithAny(key, FONT_ID_PREFIX, EXTERNAL_PREFIX, + return Strings.CS.startsWithAny(key, FONT_ID_PREFIX, EXTERNAL_PREFIX, EXTERNAL_LAF_ID_PREFIX); } diff --git a/Ghidra/Framework/Gui/src/main/java/generic/theme/IconValue.java b/Ghidra/Framework/Gui/src/main/java/generic/theme/IconValue.java index 45af8edf42..7e68920d6b 100644 --- a/Ghidra/Framework/Gui/src/main/java/generic/theme/IconValue.java +++ b/Ghidra/Framework/Gui/src/main/java/generic/theme/IconValue.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. @@ -19,7 +19,7 @@ import java.text.ParseException; import javax.swing.Icon; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import ghidra.util.Msg; import resources.ResourceManager; @@ -102,7 +102,7 @@ public class IconValue extends ThemeValue { * @return true if the given key string is a valid external key for an icon value */ public static boolean isIconKey(String key) { - return StringUtils.startsWithAny(key, ICON_ID_PREFIX, EXTERNAL_PREFIX, + return Strings.CS.startsWithAny(key, ICON_ID_PREFIX, EXTERNAL_PREFIX, EXTERNAL_LAF_ID_PREFIX); } diff --git a/Ghidra/Framework/Gui/src/main/java/gui/event/MouseBinding.java b/Ghidra/Framework/Gui/src/main/java/gui/event/MouseBinding.java index 12810bfb0e..916d50961e 100644 --- a/Ghidra/Framework/Gui/src/main/java/gui/event/MouseBinding.java +++ b/Ghidra/Framework/Gui/src/main/java/gui/event/MouseBinding.java @@ -15,8 +15,6 @@ */ package gui.event; -import static org.apache.commons.lang3.StringUtils.*; - import java.awt.Toolkit; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; @@ -25,6 +23,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Strings; import ghidra.util.Msg; @@ -139,20 +138,20 @@ public class MouseBinding { int modifiers = 0; for (Iterator iterator = pieces.iterator(); iterator.hasNext();) { String piece = iterator.next(); - if (indexOfIgnoreCase(piece, SHIFT) != -1) { + if (Strings.CI.indexOf(piece, SHIFT) != -1) { modifiers |= InputEvent.SHIFT_DOWN_MASK; iterator.remove(); } - else if (indexOfIgnoreCase(piece, CTRL) != -1) { + else if (Strings.CI.indexOf(piece, CTRL) != -1) { // This is the cross platform way to get the control key modifiers |= Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx(); iterator.remove(); } - else if (indexOfIgnoreCase(piece, ALT) != -1) { + else if (Strings.CI.indexOf(piece, ALT) != -1) { modifiers |= InputEvent.ALT_DOWN_MASK; iterator.remove(); } - else if (indexOfIgnoreCase(piece, META) != -1) { + else if (Strings.CI.indexOf(piece, META) != -1) { modifiers |= InputEvent.META_DOWN_MASK; iterator.remove(); } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramDB.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramDB.java index e3bee45402..1f6d0915f4 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramDB.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramDB.java @@ -1321,7 +1321,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM } // TODO: We need a more global solution for this. - @Deprecated + @Deprecated(since = "10.2") public void setEffectiveImageBase(Address imageBase) { effectiveImageBase = imageBase; } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/VariableSymbolDB.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/VariableSymbolDB.java index 8f69b64309..a731948ebe 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/VariableSymbolDB.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/VariableSymbolDB.java @@ -21,8 +21,7 @@ import db.DBRecord; import ghidra.program.database.function.FunctionDB; import ghidra.program.model.address.Address; import ghidra.program.model.address.OldGenericNamespaceAddress; -import ghidra.program.model.data.DataType; -import ghidra.program.model.data.Undefined; +import ghidra.program.model.data.*; import ghidra.program.model.listing.*; import ghidra.program.model.symbol.*; import ghidra.program.util.ProgramLocation; @@ -241,7 +240,7 @@ public class VariableSymbolDB extends SymbolDB { dt = DataType.DEFAULT; } else if (storage.isVoidStorage()) { - dt = DataType.VOID; + dt = VoidDataType.dataType; } else { dt = Undefined.getUndefinedDataType(storage.size()); diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataType.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataType.java index 136ac17d7e..624f55a4b4 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataType.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataType.java @@ -47,7 +47,7 @@ public interface DataType { * * @deprecated should use {@link VoidDataType#dataType} instead */ - @Deprecated + @Deprecated(since = "10.1") public static final DataType VOID = VoidDataType.dataType; /** diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/GenericCallingConvention.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/GenericCallingConvention.java index 49cd2acae6..e01e4256ac 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/GenericCallingConvention.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/GenericCallingConvention.java @@ -26,6 +26,7 @@ import ghidra.program.model.lang.CompilerSpec; * {@link CompilerSpec} provides constants for those included in this enumeration and other * setter/getter methods exist for using the string form. */ +@Deprecated(since = "10.3") public enum GenericCallingConvention { /** diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/PrototypeModel.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/PrototypeModel.java index 52b954d0b8..b1195a8e22 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/PrototypeModel.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/PrototypeModel.java @@ -248,7 +248,7 @@ public class PrototypeModel { * @return return location or {@link VariableStorage#UNASSIGNED_STORAGE} if * unable to determine suitable location */ - @Deprecated + @Deprecated(since = "12.2") public VariableStorage getReturnLocation(DataType dataType, Program program) { DataType clone = dataType.clone(program.getDataTypeManager()); PrototypePieces proto = new PrototypePieces(this, clone); @@ -286,7 +286,7 @@ public class PrototypeModel { * @deprecated This method does not apply any storage rules specific to varags functions. * Use {@link #getStorageLocations(Program,DataType[],boolean,boolean)} instead. */ - @Deprecated + @Deprecated(since = "12.2") public VariableStorage getNextArgLocation(Parameter[] params, DataType dataType, Program program) { return getArgLocation(params != null ? params.length : 0, params, dataType, program); @@ -322,7 +322,7 @@ public class PrototypeModel { * @deprecated This method does not apply any storage rules specific to varags functions. * Use {@link #getStorageLocations(Program,DataType[],boolean,boolean)} instead. */ - @Deprecated + @Deprecated(since = "12.2") public VariableStorage getArgLocation(int argIndex, Parameter[] params, DataType dataType, Program program) { if (dataType != null) { diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Function.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Function.java index b9166f0b06..386b71bf3b 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Function.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Function.java @@ -336,7 +336,7 @@ public interface Function extends Namespace { * which are easily overlooked when considering parameter ordinal. The function signature should generally be * adjusted with a single call to {@link #updateFunction(String, Variable, List, FunctionUpdateType, boolean, SourceType)} */ - @Deprecated + @Deprecated(since = "9.0") public Parameter addParameter(Variable var, SourceType source) throws DuplicateNameException, InvalidInputException; @@ -361,7 +361,7 @@ public interface Function extends Namespace { * which are easily overlooked when considering parameter ordinal. The function signature should generally be * adjusted with a single call to {@link #updateFunction(String, Variable, List, FunctionUpdateType, boolean, SourceType)} */ - @Deprecated + @Deprecated(since = "9.0") public Parameter insertParameter(int ordinal, Variable var, SourceType source) throws DuplicateNameException, InvalidInputException; @@ -467,7 +467,7 @@ public interface Function extends Namespace { * @deprecated The use of this method is discouraged. The function signature should generally be * adjusted with a single call to {@link #updateFunction(String, Variable, List, FunctionUpdateType, boolean, SourceType)} */ - @Deprecated + @Deprecated(since = "9.0") public void removeParameter(int ordinal); /** @@ -481,7 +481,7 @@ public interface Function extends Namespace { * @deprecated The use of this method is discouraged. The function signature should generally be * adjusted with a single call to {@link #updateFunction(String, Variable, List, FunctionUpdateType, boolean, SourceType)} */ - @Deprecated + @Deprecated(since = "9.0") public Parameter moveParameter(int fromOrdinal, int toOrdinal) throws InvalidInputException; /** @@ -682,7 +682,7 @@ public interface Function extends Namespace { * a recursive search is generally needed (see {@link #getFunctionThunkAddresses(boolean)}). * This method form may be removed in a future release. */ - @Deprecated + @Deprecated(since = "10.2") public default Address[] getFunctionThunkAddresses() { return getFunctionThunkAddresses(false); } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Program.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Program.java index fc3962f955..bb969dc78c 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Program.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/Program.java @@ -99,7 +99,7 @@ public interface Program extends DataTypeManagerDomainObject, ProgramArchitectur * @deprecated Method intended for internal ProgramDB use and is not intended for general use. * This method may be removed from this interface in a future release. */ - @Deprecated(forRemoval = true) + @Deprecated(since = "10.3", forRemoval = true) public AddressMap getAddressMap(); /** diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java index 96a4b5f98d..2eef18eb8c 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java @@ -745,11 +745,11 @@ public class VariableUtilities { DataType dt = findOrCreateClassStruct(function); if (dt == null) { - dt = DataType.VOID; + dt = VoidDataType.dataType; } dt = new PointerDataType(dt); DataType[] arr = new DataType[2]; - arr[0] = DataType.VOID; + arr[0] = VoidDataType.dataType; arr[1] = dt; VariableStorage thisStorage = convention.getStorageLocations(function.getProgram(), arr, true, diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeOverride.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeOverride.java index 329a4023b0..ca202a9d9f 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeOverride.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeOverride.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. @@ -125,7 +125,7 @@ public interface PcodeOverride { * Get the primary call reference address from the current instruction * @return call reference address or null */ - @Deprecated + @Deprecated(since = "9.0") Address getPrimaryCallReference(); } diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/service/graph/GraphDisplay.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/service/graph/GraphDisplay.java index b8b2d45420..3656a4a59d 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/service/graph/GraphDisplay.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/service/graph/GraphDisplay.java @@ -101,7 +101,7 @@ public interface GraphDisplay { * @throws CancelledException thrown if the graphing operation was cancelled * @deprecated You should now use the form that takes in a {@link GraphDisplayOptions} */ - @Deprecated + @Deprecated(since = "10.1") public default void setGraph(AttributedGraph graph, String title, boolean append, TaskMonitor monitor) throws CancelledException { setGraph(graph, new GraphDisplayOptions(graph.getGraphType()), title, append, monitor); diff --git a/Ghidra/Processors/JVM/src/main/java/ghidra/javaclass/format/DescriptorDecoder.java b/Ghidra/Processors/JVM/src/main/java/ghidra/javaclass/format/DescriptorDecoder.java index 66d18a10ce..24abfc04f7 100644 --- a/Ghidra/Processors/JVM/src/main/java/ghidra/javaclass/format/DescriptorDecoder.java +++ b/Ghidra/Processors/JVM/src/main/java/ghidra/javaclass/format/DescriptorDecoder.java @@ -307,7 +307,7 @@ public class DescriptorDecoder { case BASE_TYPE_LONG: return LongDataType.dataType; case BASE_TYPE_VOID: //void (only for return types) - return DataType.VOID; + return VoidDataType.dataType; default: throw new IllegalArgumentException("Invalid type descriptor: " + descriptor); } diff --git a/Ghidra/Processors/JVM/src/test/java/ghidra/javaclass/test/DescriptorDecoderTest.java b/Ghidra/Processors/JVM/src/test/java/ghidra/javaclass/test/DescriptorDecoderTest.java index c55b58c7a2..66095dd2d2 100644 --- a/Ghidra/Processors/JVM/src/test/java/ghidra/javaclass/test/DescriptorDecoderTest.java +++ b/Ghidra/Processors/JVM/src/test/java/ghidra/javaclass/test/DescriptorDecoderTest.java @@ -271,7 +271,7 @@ public class DescriptorDecoderTest extends AbstractGenericTest { String voidDescriptor = "V"; computedType = DescriptorDecoder.getDataTypeOfDescriptor(voidDescriptor, dtm); - assertTrue(computedType.equals(DataType.VOID)); + assertTrue(computedType.equals(VoidDataType.dataType)); } @Test @@ -450,7 +450,7 @@ public class DescriptorDecoderTest extends AbstractGenericTest { String voidTovoid = "()V"; type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(voidTovoid, dtm); - assertEquals(DataType.VOID, type); + assertEquals(VoidDataType.dataType, type); String ItoI = "(I)I"; type = DescriptorDecoder.getReturnTypeOfMethodDescriptor(ItoI, dtm); diff --git a/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/app/cmd/function/CreateFunctionThunkTest.java b/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/app/cmd/function/CreateFunctionThunkTest.java index 5af19235cf..ce8a3cc782 100644 --- a/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/app/cmd/function/CreateFunctionThunkTest.java +++ b/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/app/cmd/function/CreateFunctionThunkTest.java @@ -26,7 +26,7 @@ import ghidra.framework.options.Options; import ghidra.framework.plugintool.PluginTool; import ghidra.program.database.ProgramBuilder; import ghidra.program.model.data.DWordDataType; -import ghidra.program.model.data.DataType; +import ghidra.program.model.data.VoidDataType; import ghidra.program.model.listing.*; import ghidra.program.model.symbol.Reference; import ghidra.test.AbstractGhidraHeadedIntegrationTest; @@ -116,7 +116,7 @@ public class CreateFunctionThunkTest extends AbstractGhidraHeadedIntegrationTest builder.setBytes("0x466050", "3c 0f 00 47 8d f9 72 24 03 20 00 08 25 f8 72 24"); builder.setBytes("0x477224", "00 47 99 c0"); - builder.createEmptyFunction("chdir", "0x4799c0", 1, DataType.VOID); + builder.createEmptyFunction("chdir", "0x4799c0", 1, VoidDataType.dataType); builder.disassemble("0x466050", 27, true); builder.createFunction("0x466050");