GP-0: Fixing raw type warnings

This commit is contained in:
Ryan Kurtz 2025-05-29 08:39:27 -04:00
parent a6cd5b5dbc
commit 0cbf33d074
58 changed files with 241 additions and 241 deletions

View file

@ -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.
@ -233,7 +233,8 @@ public enum BackgroundUtils {
}
protected void executeBackground(Runnable command) {
BackgroundCommand cmd = new BackgroundCommand(name, opts.contains(TaskOpt.HAS_PROGRESS),
BackgroundCommand<DomainObject> cmd =
new BackgroundCommand<>(name, opts.contains(TaskOpt.HAS_PROGRESS),
opts.contains(TaskOpt.CAN_CANCEL), opts.contains(TaskOpt.IS_MODAL)) {
@Override
public boolean applyTo(DomainObject obj, TaskMonitor monitor) {

View file

@ -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.
@ -21,6 +21,7 @@ import ghidra.app.cmd.label.RenameLabelCmd;
import ghidra.app.script.GhidraScript;
import ghidra.framework.cmd.CompoundCmd;
import ghidra.program.model.address.*;
import ghidra.program.model.listing.Program;
import ghidra.program.model.symbol.*;
public class AutoRenameLabelsScript extends GhidraScript {
@ -45,7 +46,7 @@ public class AutoRenameLabelsScript extends GhidraScript {
SymbolTable symbolTable = currentProgram.getSymbolTable();
AddressIterator it = view.getAddresses(true);
CompoundCmd cmd = new CompoundCmd("Auto Rename Labels");
CompoundCmd<Program> cmd = new CompoundCmd<>("Auto Rename Labels");
while (it.hasNext()) {
Address address = it.next();
Symbol primary = symbolTable.getPrimarySymbol(address);

View file

@ -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.
@ -83,7 +83,7 @@ public class SetEquateScript extends GhidraScript {
// looking for was found
// Sets the equate to the user defined name and execute
Command cmd =
Command<Program> cmd =
new SetEquateCmd(equateName, tempValue.getAddress(), i, scalarValue);
state.getTool().execute(cmd, currentProgram);

View file

@ -113,7 +113,7 @@ public class ClearPlugin extends Plugin {
}
CodeUnit cu = program.getListing().getCodeUnitContaining(location.getAddress());
Command cmd = new ClearCmd(cu, options);
Command<Program> cmd = new ClearCmd(cu, options);
tool.execute(cmd, program);
}

View file

@ -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,8 +34,7 @@ import ghidra.app.plugin.ProgramPlugin;
import ghidra.app.plugin.core.navigation.NavigationOptions;
import ghidra.app.services.*;
import ghidra.framework.cmd.Command;
import ghidra.framework.model.DomainObjectChangedEvent;
import ghidra.framework.model.DomainObjectListener;
import ghidra.framework.model.*;
import ghidra.framework.options.SaveState;
import ghidra.framework.plugintool.PluginInfo;
import ghidra.framework.plugintool.PluginTool;
@ -191,7 +190,7 @@ public class ColorizingPlugin extends ProgramPlugin implements DomainObjectListe
return;
}
Command command = null;
Command<DomainObject> command = null;
ProgramSelection selection = listingContext.getSelection();
if (selection != null && !selection.isEmpty()) {
command = new SetColorCommand(color, service, selection);

View file

@ -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.
@ -112,7 +112,7 @@ class CreateArrayAction extends ListingContextAction {
int maxNoConflictElements = getMaxNoConflictElements(struct, comp.getComponentIndex(), dt);
int numElements = getNumElements(dt, maxNoConflictElements, maxElements);
Command cmd = new CreateArrayInStructureCmd(addr, numElements, dt, compPath);
Command<Program> cmd = new CreateArrayInStructureCmd(addr, numElements, dt, compPath);
if (!tool.execute(cmd, program)) {
tool.setStatusInfo(cmd.getStatusMsg());
}
@ -144,7 +144,7 @@ class CreateArrayAction extends ListingContextAction {
// Arrays currently use aligned-length only
int numElements = length / dt.getAlignedLength();
Command cmd = new CreateArrayInStructureCmd(from.getAddress(), numElements, dt,
Command<Program> cmd = new CreateArrayInStructureCmd(from.getAddress(), numElements, dt,
from.getComponentPath());
if (!tool.execute(cmd, program)) {
tool.setStatusInfo(cmd.getStatusMsg());

View file

@ -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.
@ -26,8 +26,7 @@ import ghidra.framework.cmd.BackgroundCommand;
import ghidra.program.model.address.Address;
import ghidra.program.model.data.CycleGroup;
import ghidra.program.model.data.DataType;
import ghidra.program.model.listing.Data;
import ghidra.program.model.listing.Listing;
import ghidra.program.model.listing.*;
import ghidra.program.util.*;
import ghidra.util.Msg;
@ -83,7 +82,7 @@ public class CycleGroupAction extends ListingContextAction {
// Handle selection case
if (selection != null && !selection.isEmpty()) {
BackgroundCommand cmd = null;
BackgroundCommand<Program> cmd = null;
DataType dt = null;
Address addr = selection.getMinAddress();
Data data = listing.getDataContaining(addr);

View file

@ -206,7 +206,7 @@ public class EquateTablePlugin extends ProgramPlugin implements DomainObjectList
}
if (isValid(oldEquate, newEquateName)) {
Command cmd = new RenameEquatesCmd(oldEquateName, newEquateName);
Command<Program> cmd = new RenameEquatesCmd(oldEquateName, newEquateName);
tool.execute(cmd, currentProgram);
}
}

View file

@ -15,6 +15,9 @@
*/
package ghidra.app.plugin.core.fallthrough;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import ghidra.app.cmd.refs.ClearFallThroughCmd;
import ghidra.app.cmd.refs.SetFallThroughCmd;
import ghidra.app.util.viewer.field.BrowserCodeUnitFormat;
@ -23,9 +26,6 @@ import ghidra.framework.plugintool.PluginTool;
import ghidra.program.model.address.*;
import ghidra.program.model.listing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
/**
* This class is really a model for the FallThroughDialog state. However, it is used as a
* convenience for executing the auto-override and clear-fallthrough actions.
@ -187,7 +187,7 @@ class FallThroughModel implements ChangeListener {
* @param currentSelection
*/
void autoOverride(AddressSetView view) {
CompoundCmd cmd = new CompoundCmd("Auto-Override");
CompoundCmd<Program> cmd = new CompoundCmd<>("Auto-Override");
AddressRangeIterator iter = view.getAddressRanges();
while (iter.hasNext()) {
override(iter.next(), cmd);
@ -200,7 +200,7 @@ class FallThroughModel implements ChangeListener {
}
void clearOverride(AddressSetView view) {
CompoundCmd cmd = new CompoundCmd("Clear FallThroughs");
CompoundCmd<Program> cmd = new CompoundCmd<>("Clear FallThroughs");
InstructionIterator it = program.getListing().getInstructions(view, true);
while(it.hasNext()) {
Instruction inst = it.next();
@ -225,7 +225,7 @@ class FallThroughModel implements ChangeListener {
return program;
}
private void override(AddressRange range, CompoundCmd cmd) {
private void override(AddressRange range, CompoundCmd<Program> cmd) {
Address min = range.getMinAddress();
Address max = range.getMaxAddress();
Listing listing = program.getListing();
@ -248,7 +248,7 @@ class FallThroughModel implements ChangeListener {
}
}
private void setFallThrough(Address addr, CompoundCmd cmd) {
private void setFallThrough(Address addr, CompoundCmd<Program> cmd) {
Instruction inst = program.getListing().getInstructionAfter(addr);
if (inst != null) {
cmd.add(new SetFallThroughCmd(addr, inst.getMinAddress()));

View file

@ -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.
@ -60,7 +60,7 @@ public class AddVarArgsAction extends ListingContextAction {
Function function = functionPlugin.getFunction(context);
if ((function != null) && (!function.hasVarArgs())) {
Command command = new SetFunctionVarArgsCommand(function, true);
Command<Program> command = new SetFunctionVarArgsCommand(function, true);
PluginTool tool = functionPlugin.getTool();
Program program = context.getProgram();

View file

@ -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 @@ class AnalyzeStackRefsAction extends ListingContextAction {
doParameterAnalysis = options.getBoolean("Create Param Variables", doParameterAnalysis);
BackgroundCommand cmd = null;
BackgroundCommand<Program> cmd = null;
if (doNewStackAnalysis) {
cmd = new NewFunctionStackAnalysisCmd(funcSet, doParameterAnalysis, doLocalAnalysis,
true);

View file

@ -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.
@ -95,7 +95,7 @@ public class CreateExternalFunctionAction extends ProgramContextAction {
@Override
protected void actionPerformed(ProgramActionContext context) {
CompoundCmd compoundCmd = null;
CompoundCmd<Program> compoundCmd = null;
CreateExternalFunctionCmd cmd = null;
if (context instanceof ListingActionContext) {
ListingActionContext listingContext = (ListingActionContext) context;
@ -107,7 +107,7 @@ public class CreateExternalFunctionAction extends ProgramContextAction {
CreateExternalFunctionCmd extFuncCmd = new CreateExternalFunctionCmd(s);
if (cmd != null) {
if (compoundCmd == null) {
compoundCmd = new CompoundCmd("Create External Functions");
compoundCmd = new CompoundCmd<>("Create External Functions");
compoundCmd.add(cmd);
}
compoundCmd.add(extFuncCmd);

View file

@ -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.
@ -139,7 +139,7 @@ class CreateFunctionAction extends ListingContextAction {
funcPlugin.getTool().clearStatusInfo();
}
BackgroundCommand cmd;
BackgroundCommand<Program> cmd;
if (createThunk) {
cmd = getCreateThunkFunctionCmd(context.getProgram(), entry, body);
if (cmd == null) {

View file

@ -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,6 +15,7 @@
*/
package ghidra.app.plugin.core.function;
import docking.action.MenuData;
import ghidra.app.cmd.function.SetFunctionVarArgsCommand;
import ghidra.app.context.ListingActionContext;
import ghidra.app.context.ListingContextAction;
@ -25,7 +25,6 @@ import ghidra.program.model.listing.Function;
import ghidra.program.model.listing.Program;
import ghidra.program.util.*;
import ghidra.util.HelpLocation;
import docking.action.MenuData;
/**
* Action that changes a Function so that it has VarArgs (a variable argument list).
@ -62,7 +61,7 @@ public class DeleteVarArgsAction extends ListingContextAction {
public void actionPerformed(ListingActionContext context) {
Function function = functionPlugin.getFunction(context);
if ((function != null) && (function.hasVarArgs())) {
Command command = new SetFunctionVarArgsCommand(function, false);
Command<Program> command = new SetFunctionVarArgsCommand(function, false);
PluginTool tool = functionPlugin.getTool();
Program program = context.getProgram();

View file

@ -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.
@ -84,7 +84,7 @@ public class EditFunctionPurgeAction extends ListingContextAction {
int newFunctionPurgeSize = numberInputDialog.getValue();
if (newFunctionPurgeSize != currentFunctionPurgeSize) {
Command command = new SetFunctionPurgeCommand(function, newFunctionPurgeSize);
Command<Program> command = new SetFunctionPurgeCommand(function, newFunctionPurgeSize);
PluginTool tool = functionPlugin.getTool();
Program program = function.getProgram();

View file

@ -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.
@ -38,7 +37,7 @@ public class X86FunctionPurgeAnalyzer extends AbstractAnalyzer {
@Override
public boolean added(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log) {
BackgroundCommand cmd;
BackgroundCommand<Program> cmd;
cmd = new FunctionPurgeAnalysisCmd(set);

View file

@ -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,8 +20,7 @@ import java.util.Set;
import ghidra.app.cmd.function.RemoveFunctionTagCmd;
import ghidra.framework.cmd.Command;
import ghidra.framework.plugintool.PluginTool;
import ghidra.program.model.listing.Function;
import ghidra.program.model.listing.FunctionTag;
import ghidra.program.model.listing.*;
/**
* Displays a list of tags that have been assigned to the current function
@ -73,7 +72,8 @@ public class TargetTagsPanel extends TagListPanel {
public void removeSelectedTags() {
Set<FunctionTag> selectedTags = getSelectedTags();
for (FunctionTag tag : selectedTags) {
Command cmd = new RemoveFunctionTagCmd(tag.getName(), function.getEntryPoint());
Command<Program> cmd =
new RemoveFunctionTagCmd(tag.getName(), function.getEntryPoint());
tool.execute(cmd, program);
}
}

View file

@ -115,7 +115,8 @@ public class LabelMgrPlugin extends Plugin {
protected void removeLabelCallback(ListingActionContext context) {
Symbol s = getSymbol(context);
if (s != null) {
Command cmd = new DeleteLabelCmd(s.getAddress(), s.getName(), s.getParentNamespace());
Command<Program> cmd =
new DeleteLabelCmd(s.getAddress(), s.getName(), s.getParentNamespace());
if (!tool.execute(cmd, context.getProgram())) {
tool.setStatusInfo(cmd.getStatusMsg());

View file

@ -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.
@ -94,7 +94,7 @@ public class OperandLabelDialog extends DialogComponentProvider {
Address symAddr = sym.getAddress();
Reference ref = refMgr.getReference(addr, symAddr, opIndex);
CompoundCmd cmd = new CompoundCmd("Set Label");
CompoundCmd<Program> cmd = new CompoundCmd<>("Set Label");
Namespace scope = null;
Symbol newSym = findSymbol(symTable, currentLabel, symAddr);

View file

@ -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,6 +15,11 @@
*/
package ghidra.app.plugin.core.module;
import javax.swing.tree.TreePath;
import docking.ActionContext;
import docking.action.DockingAction;
import docking.action.MenuData;
import ghidra.app.CorePluginPackage;
import ghidra.app.cmd.module.RenameCmd;
import ghidra.app.context.ListingActionContext;
@ -26,8 +31,9 @@ import ghidra.app.services.ProgramTreeService;
import ghidra.framework.cmd.CompoundCmd;
import ghidra.framework.plugintool.PluginInfo;
import ghidra.framework.plugintool.PluginTool;
import ghidra.framework.plugintool.util.*;
import ghidra.framework.plugintool.util.PluginStatus;
import ghidra.program.model.address.Address;
import ghidra.program.model.listing.Program;
import ghidra.program.model.listing.ProgramFragment;
import ghidra.program.model.symbol.Symbol;
import ghidra.program.model.symbol.SymbolTable;
@ -35,12 +41,6 @@ import ghidra.program.util.LabelFieldLocation;
import ghidra.program.util.ProgramLocation;
import ghidra.util.HelpLocation;
import javax.swing.tree.TreePath;
import docking.ActionContext;
import docking.action.DockingAction;
import docking.action.MenuData;
/**
* Plugin provides the following Fragment rename actions:
* 1. Automatically rename selected Program Fragments to match the
@ -113,7 +113,7 @@ public class AutoRenamePlugin extends ProgramPlugin {
if (obj instanceof ProgramNode) {
ProgramNode node = (ProgramNode) obj;
CompoundCmd cmd = new CompoundCmd("Auto Rename Fragment(s)");
CompoundCmd<Program> cmd = new CompoundCmd<>("Auto Rename Fragment(s)");
SymbolTable symTable = currentProgram.getSymbolTable();
// Find selected Fragments

View file

@ -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 ghidra.app.context.ListingActionContext;
import ghidra.app.context.ListingContextAction;
import ghidra.framework.cmd.Command;
import ghidra.program.model.address.Address;
import ghidra.program.model.listing.Program;
import ghidra.program.model.symbol.Reference;
import ghidra.program.model.symbol.ReferenceManager;
import ghidra.program.util.*;
@ -58,7 +59,7 @@ public class DeleteReferencesAction extends ListingContextAction {
if (loc instanceof OperandFieldLocation) {
opIndex = ((OperandFieldLocation) loc).getOperandIndex();
}
Command cmd = new RemoveAllReferencesCmd(loc.getAddress(), opIndex);
Command<Program> cmd = new RemoveAllReferencesCmd(loc.getAddress(), opIndex);
plugin.getTool().execute(cmd, context.getProgram());
}

View file

@ -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.
@ -173,13 +173,13 @@ class EditReferencesModel extends AbstractSortedTableModel<Reference> {
case REF_TYPE_COL:
if (ref.getReferenceType() != value) {
Command cmd = new EditRefTypeCmd(ref, (RefType) value);
Command<Program> cmd = new EditRefTypeCmd(ref, (RefType) value);
plugin.getTool().execute(cmd, cu.getProgram());
}
break;
case IS_PRIMARY_COL:
Command cmd = new SetPrimaryRefCmd(ref, ((Boolean) value).booleanValue());
Command<Program> cmd = new SetPrimaryRefCmd(ref, ((Boolean) value).booleanValue());
plugin.getTool().execute(cmd, cu.getProgram());
break;

View file

@ -212,7 +212,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
private void deleteExternalProgram() {
ExternalManager externalManager = program.getExternalManager();
StringBuilder buf = new StringBuilder();
CompoundCmd cmd = new CompoundCmd("Delete External Program Name");
CompoundCmd<Program> cmd = new CompoundCmd<>("Delete External Program Name");
for (String externalName : getSelectedExternalNames()) {
boolean hasLocations = externalManager.getExternalLocations(externalName).hasNext();
if (hasLocations) {
@ -251,7 +251,8 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
ExternalManager externalManager = program.getExternalManager();
String externalLibraryPath = externalManager.getExternalLibraryPath(externalName);
if (!pathName.equals(externalLibraryPath)) {
Command cmd = new SetExternalNameCmd(externalName, domainFile.getPathname());
Command<Program> cmd =
new SetExternalNameCmd(externalName, domainFile.getPathname());
getTool().execute(cmd, program);
}
});
@ -260,7 +261,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
}
private void clearExternalAssociation() {
CompoundCmd cmd = new CompoundCmd("Clear External Program Associations");
CompoundCmd<Program> cmd = new CompoundCmd<>("Clear External Program Associations");
for (String externalName : getSelectedExternalNames()) {
cmd.add(new ClearExternalNameCmd(externalName));
}
@ -435,7 +436,8 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
rowToHighlightDuringNextReload = newName;
String oldName = path.getName();
Command cmd = new UpdateExternalNameCmd(oldName, newName, SourceType.USER_DEFINED);
Command<Program> cmd =
new UpdateExternalNameCmd(oldName, newName, SourceType.USER_DEFINED);
if (!tool.execute(cmd, program)) {
tool.setStatusInfo(cmd.getStatusMsg());
}

View file

@ -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.
@ -525,25 +525,27 @@ public class ReferencesPlugin extends Plugin {
}
}
BackgroundCommand cmd =
BackgroundCommand<Program> cmd =
new AddMemRefsCmd(cuAddr, set, rt, SourceType.USER_DEFINED, opIndex);
tool.executeBackgroundCommand(cmd, cu.getProgram());
}
boolean addDefaultReference(Program program, Address fromAddr, int opIndex, Address toAddr,
RefType refType) {
Command cmd =
Command<Program> cmd =
new AddMemRefCmd(fromAddr, toAddr, refType, SourceType.USER_DEFINED, opIndex, true);
return tool.execute(cmd, program);
}
boolean addDefaultReference(Program program, Address fromAddr, int opIndex, int stackOffset) {
Command cmd = new AddStackRefCmd(fromAddr, opIndex, stackOffset, SourceType.USER_DEFINED);
Command<Program> cmd =
new AddStackRefCmd(fromAddr, opIndex, stackOffset, SourceType.USER_DEFINED);
return tool.execute(cmd, program);
}
boolean addDefaultReference(Program program, Address fromAddr, int opIndex, Register reg) {
Command cmd = new AddRegisterRefCmd(fromAddr, opIndex, reg, SourceType.USER_DEFINED);
Command<Program> cmd =
new AddRegisterRefCmd(fromAddr, opIndex, reg, SourceType.USER_DEFINED);
return tool.execute(cmd, program);
}
@ -559,7 +561,7 @@ public class ReferencesPlugin extends Plugin {
* Remove specified set of references
*/
void deleteReferences(Program program, Reference[] refs) {
CompoundCmd cmd = new CompoundCmd("Remove Reference(s)");
CompoundCmd<Program> cmd = new CompoundCmd<>("Remove Reference(s)");
for (Reference ref : refs) {
cmd.add(new RemoveReferenceCmd(ref));
}
@ -573,7 +575,7 @@ public class ReferencesPlugin extends Plugin {
*/
boolean updateReference(Reference editRef, CodeUnit fromCodeUnit, Address toAddr,
boolean isOffsetRef, long offset, RefType refType) {
CompoundCmd cmd = new CompoundCmd("Update Memory Reference");
CompoundCmd<Program> cmd = new CompoundCmd<>("Update Memory Reference");
int opIndex = editRef.getOperandIndex();
cmd.add(new RemoveReferenceCmd(editRef));
if (isOffsetRef) {
@ -610,7 +612,7 @@ public class ReferencesPlugin extends Plugin {
return false;
}
Command cmd;
Command<Program> cmd;
if (isOffsetRef) {
cmd = new AddOffsetMemRefCmd(fromAddr, toAddr, false, refType, SourceType.USER_DEFINED,
opIndex, offset);
@ -632,7 +634,7 @@ public class ReferencesPlugin extends Plugin {
return false;
}
CompoundCmd cmd = new CompoundCmd("Update Register Reference");
CompoundCmd<Program> cmd = new CompoundCmd<>("Update Register Reference");
cmd.add(new RemoveReferenceCmd(editRef));
cmd.add(new AddRegisterRefCmd(fromAddr, editRef.getOperandIndex(), reg, refType,
SourceType.USER_DEFINED));
@ -670,7 +672,7 @@ public class ReferencesPlugin extends Plugin {
return false;
}
CompoundCmd cmd = new CompoundCmd("Update Stack Reference");
CompoundCmd<Program> cmd = new CompoundCmd<>("Update Stack Reference");
cmd.add(new RemoveReferenceCmd(editRef));
cmd.add(new AddStackRefCmd(fromAddr, editRef.getOperandIndex(), stackOffset, refType,
SourceType.USER_DEFINED));
@ -699,7 +701,8 @@ public class ReferencesPlugin extends Plugin {
return tool.execute(cmd, p);
}
private void buildAddExtRefCmd(CompoundCmd cmd, Program p, Address fromAddr, int opIndex,
private void buildAddExtRefCmd(CompoundCmd<Program> cmd, Program p, Address fromAddr,
int opIndex,
String extName, String path, Address addr, String label, RefType refType) {
cmd.add(new SetExternalRefCmd(fromAddr, opIndex, extName, label, addr, refType,
@ -721,7 +724,7 @@ public class ReferencesPlugin extends Plugin {
ExternalLocation oldExtLoc = editRef.getExternalLocation();
String oldExtName = oldExtLoc.getLibraryName();
CompoundCmd cmd = new CompoundCmd("Update External Reference");
CompoundCmd<Program> cmd = new CompoundCmd<>("Update External Reference");
// TODO: Add RefType entry to External Reference editor panel (assume unchanged to avoid merge conflict)
@ -790,7 +793,7 @@ public class ReferencesPlugin extends Plugin {
}
}
CompoundCmd cmd = new CompoundCmd("Add External Reference");
CompoundCmd<Program> cmd = new CompoundCmd<>("Add External Reference");
buildAddExtRefCmd(cmd, p, fromCodeUnit.getMinAddress(), opIndex, extName, path, addr, label,
refType);

View file

@ -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.
@ -231,7 +231,7 @@ public class RegisterPlugin extends ProgramPlugin {
while (it.hasNext()) {
AddressRange range = it.next();
if (range.contains(addr)) {
Command cmd = new SetRegisterCmd(register, range.getMinAddress(),
Command<Program> cmd = new SetRegisterCmd(register, range.getMinAddress(),
range.getMaxAddress(), null);
if (!tool.execute(cmd, context.getProgram())) {
Msg.showError(this, tool.getToolFrame(), "Register Context Error",
@ -246,7 +246,7 @@ public class RegisterPlugin extends ProgramPlugin {
RegisterFieldLocation location = (RegisterFieldLocation) context.getLocation();
Register register = location.getRegister();
Address addr = location.getAddress();
Command cmd = new SetRegisterCmd(register, addr, addr, null);
Command<Program> cmd = new SetRegisterCmd(register, addr, addr, null);
if (!tool.execute(cmd, context.getProgram())) {
Msg.showError(this, tool.getToolFrame(), "Register Context Error", cmd.getStatusMsg());
}
@ -377,7 +377,7 @@ public class RegisterPlugin extends ProgramPlugin {
return;
}
CompoundCmd cmd = new CompoundCmd("Set Register Values");
CompoundCmd<Program> cmd = new CompoundCmd<>("Set Register Values");
for (AddressRange range : addressSet) {
SetRegisterCmd regCmd =
new SetRegisterCmd(register, range.getMinAddress(), range.getMaxAddress(), value);

View file

@ -102,9 +102,9 @@ class RegisterValuesPanel extends JPanel {
private void updateValue(Address start, Address end, Address newStart, Address newEnd,
BigInteger newValue) {
CompoundCmd cmd = new CompoundCmd("Update Register Range");
Command cmd1 = new SetRegisterCmd(selectedRegister, start, end, null);
Command cmd2 = new SetRegisterCmd(selectedRegister, newStart, newEnd, newValue);
CompoundCmd<Program> cmd = new CompoundCmd<>("Update Register Range");
Command<Program> cmd1 = new SetRegisterCmd(selectedRegister, start, end, null);
Command<Program> cmd2 = new SetRegisterCmd(selectedRegister, newStart, newEnd, newValue);
cmd.add(cmd1);
cmd.add(cmd2);
tool.execute(cmd, currentProgram);
@ -250,7 +250,7 @@ class RegisterValuesPanel extends JPanel {
}
void deleteSelectedRanges() {
CompoundCmd cmd = new CompoundCmd("Delete Register Value Ranges");
CompoundCmd<Program> cmd = new CompoundCmd<>("Delete Register Value Ranges");
int[] rows = table.getSelectedRows();
boolean containsDefaultValues = false;
for (int row : rows) {

View file

@ -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.
@ -95,7 +95,8 @@ public class SetExternalProgramAction extends SymbolTreeContextAction {
String pathName = domainFile.toString();
dialog.close();
if (!pathName.equals(externalLibraryPath)) {
Command cmd = new SetExternalNameCmd(externalName, domainFile.getPathname());
Command<Program> cmd =
new SetExternalNameCmd(externalName, domainFile.getPathname());
plugin.getTool().execute(cmd, plugin.getProgram());
}
});

View file

@ -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.
@ -73,7 +73,7 @@ public class PropertyManagerProvider extends ComponentProviderAdapter {
String propName = (String) model.getValueAt(row,
PropertyManagerTableModel.PROPERTY_NAME_COLUMN);
model.removeRow(row);
Command cmd = new PropertyDeleteCmd(propName, restrictedView);
Command<Program> cmd = new PropertyDeleteCmd(propName, restrictedView);
PropertyManagerProvider.this.plugin.getTool().execute(cmd, currentProgram);
}
}

View file

@ -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.
@ -121,7 +121,7 @@ public final class ObjectiveC1_Utilities {
if (state.thumbCodeLocations.contains(address)) {
Register tmodeRegister = state.program.getLanguage().getRegister("TMode");
if (tmodeRegister != null) {
Command c =
Command<Program> c =
new SetRegisterCmd(tmodeRegister, address, address, BigInteger.valueOf(1));
c.applyTo(state.program);
}
@ -300,7 +300,7 @@ public final class ObjectiveC1_Utilities {
ObjectiveC1_Utilities.setThumbBit(state, address);
BackgroundCommand command = null;
BackgroundCommand<Program> command = null;
command = new DisassembleCommand(address, null, true);
command.applyTo(state.program, state.monitor);

View file

@ -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.
@ -218,7 +218,7 @@ class MarkupXmlMgr {
RefType refType = getDefaultRefType(fromAddr, toAddr, opIndex);
Command cmd = null;
Command<Program> cmd = null;
if (baseAddr != null) {
long offset = toAddr.subtract(baseAddr);
cmd = new AddOffsetMemRefCmd(fromAddr, toAddr, false, refType,

View file

@ -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.
@ -124,7 +124,7 @@ class PropertiesXmlMgr {
}
if (!overwrite && !"bookmarks".equals(type)) {
PropertyMap map = propMapMgr.getPropertyMap(name);
PropertyMap<?> map = propMapMgr.getPropertyMap(name);
if (map != null && map.hasProperty(addr)) {
log.appendMsg("Conflicting '" + name + "' PROPERTY ignored at: " + addr);
return; // skip - property conflicts

View file

@ -573,7 +573,7 @@ public class GhidraProject {
* @param program
* the program on which the command is to be applied.
*/
public void execute(Command cmd, Program program) {
public void execute(Command<Program> cmd, Program program) {
AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager(program);
cmd.applyTo(program);
mgr.initializeOptions();

View file

@ -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.
@ -58,7 +58,7 @@ public class BookmarkEditCmdTest extends AbstractGhidraHeadedIntegrationTest {
private Address[] createBookmarks(ProgramLocation[] locs) {
CompoundCmd compoundCmd = new CompoundCmd("Create Bookmarks");
CompoundCmd<Program> compoundCmd = new CompoundCmd<>("Create Bookmarks");
Address[] addrs = new Address[locs.length];
for (int i = 0; i < locs.length; i++) {

View file

@ -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.
@ -484,7 +484,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
// note: we want to test a specific code path, so we must delete more than 20 items
// add more to our current set
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
addCmd.add(new BookmarkEditCmd(addr("01001110"), "Type1", "Cat1a", "Cmt1A"));
addCmd.add(new BookmarkEditCmd(addr("01001120"), "Type1", "Cat1a", "Cmt1B"));
addCmd.add(new BookmarkEditCmd(addr("01001120"), "Type1", "Cat1b", "Cmt1C"));
@ -545,7 +545,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
assertFalse(addressSet.contains(addr("01001100")));
assertFalse(addressSet.contains(addr("01001120")));
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
addCmd.add(new BookmarkEditCmd(addr("01001100"), "Type1", "Cat1a", "Cmt1A"));
addCmd.add(new BookmarkEditCmd(addr("01001120"), "Type1", "Cat1a", "Cmt1B"));
applyCmd(program, addCmd);
@ -558,7 +558,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
@Test
public void testDeleteOffcutBookmarks() throws Exception {
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
Address a = addr("0100b6db");
for (int i = 0; i < 20; i++) {
addCmd.add(new BookmarkEditCmd(a, "Type1", "Cat1a", "Cmt1A"));
@ -706,7 +706,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
applyCmd(program, delCmd);
// Add specific bookmarks
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
addCmd.add(new BookmarkEditCmd(addr("01001010"), "Type1", "Cat1a", "Cmt1A"));
addCmd.add(new BookmarkEditCmd(addr("01001020"), "Type1", "Cat1a", "Cmt1B"));
addCmd.add(new BookmarkEditCmd(addr("01001020"), "Type1", "Cat1b", "Cmt1C"));

View file

@ -789,8 +789,8 @@ public class CodeBrowserOptionsTest extends AbstractGhidraHeadedIntegrationTest
//--- Verify register variable markup options
Command cmd = new AddRegisterRefCmd(addr("0x1002d0b"), 0, program.getRegister("EDI"),
SourceType.USER_DEFINED);
Command<Program> cmd = new AddRegisterRefCmd(addr("0x1002d0b"), 0,
program.getRegister("EDI"), SourceType.USER_DEFINED);
applyCmd(program, cmd);
cb.updateNow();

View file

@ -91,7 +91,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + 23));
Command cmd = new CreateStructureCmd(addr, 24);
Command<Program> cmd = new CreateStructureCmd(addr, 24);
cmd.applyTo(program);
Data d = program.getListing().getDataAt(addr);
@ -127,7 +127,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + 23));
Command cmd = new CreateArrayCmd(addr, 6, new Pointer32DataType(), 4);
Command<Program> cmd = new CreateArrayCmd(addr, 6, new Pointer32DataType(), 4);
cmd.applyTo(program);
Symbol s = createLabel(addr, "ArrayA");
@ -161,7 +161,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));
Command cmd = new CreateStructureCmd(addr, 24);
Command<Program> cmd = new CreateStructureCmd(addr, 24);
cmd.applyTo(program);
Data d = program.getListing().getDataAt(addr);
@ -207,11 +207,11 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
for (int i = 0; i < 4; i++) {
Address a = addr(EXT_POINTERS_OFFSET + (i * 24));
Command cmd = new CreateArrayCmd(a, 6, new Pointer32DataType(), 4);
Command<Program> cmd = new CreateArrayCmd(a, 6, new Pointer32DataType(), 4);
cmd.applyTo(program);
}
Command cmd = new CreateStructureCmd(addr, 4 * 24);
Command<Program> cmd = new CreateStructureCmd(addr, 4 * 24);
cmd.applyTo(program);
Data d = program.getListing().getDataAt(addr);
@ -254,7 +254,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));
Command cmd = new CreateArrayCmd(addr, 6, new Pointer32DataType(), 4);
Command<Program> cmd = new CreateArrayCmd(addr, 6, new Pointer32DataType(), 4);
cmd.applyTo(program);
Data d = program.getListing().getDataAt(addr);
@ -294,7 +294,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr(EXT_POINTERS_OFFSET + (4 * 24)));
Command cmd = new CreateStructureCmd(addr, 24);
Command<Program> cmd = new CreateStructureCmd(addr, 24);
cmd.applyTo(program);
Data d = program.getListing().getDataAt(addr);
@ -349,7 +349,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr.add(23));
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(23)));
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(23)));
cmd.applyTo(program);
addr = addr(EXT_POINTERS_OFFSET + 2);
@ -407,7 +407,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address structAddr = addr(EXT_POINTERS_OFFSET);
clearSymbols(structAddr, structAddr.add(23));
Command cmd = new ClearCmd(new AddressSet(structAddr, structAddr.add(23)));
Command<Program> cmd = new ClearCmd(new AddressSet(structAddr, structAddr.add(23)));
cmd.applyTo(program);
structAddr = addr(EXT_POINTERS_OFFSET + 2);
@ -443,7 +443,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr.add(23));
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(23)));
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(23)));
cmd.applyTo(program);
addr = addr(EXT_POINTERS_OFFSET + 2);
@ -488,7 +488,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr.add(7));
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
cmd.applyTo(program);
addr = addr(EXT_POINTERS_OFFSET + 2);
@ -508,7 +508,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr.add(7));
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
cmd.applyTo(program);
addr = addr(EXT_POINTERS_OFFSET + 2);
@ -528,7 +528,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr.add(7));
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
cmd.applyTo(program);
addr = addr(EXT_POINTERS_OFFSET + 2);
@ -551,7 +551,7 @@ public class DataReferencesTest extends AbstractGhidraHeadedIntegrationTest {
Address addr = addr(EXT_POINTERS_OFFSET);
clearSymbols(addr, addr.add(7));
Command cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
Command<Program> cmd = new ClearCmd(new AddressSet(addr, addr.add(7)));
cmd.applyTo(program);
addr = addr(EXT_POINTERS_OFFSET + 2);

View file

@ -287,7 +287,7 @@ public class MarkerTest extends AbstractGhidraHeadedIntegrationTest {
@Test
public void testToolTipMaxLines() throws Exception {
tool.addPlugin(BookmarkPlugin.class.getName());
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
Address a = addr("0x0100b6db");
for (int i = 0; i < 20; i++) {
addCmd.add(new BookmarkEditCmd(a, "Type1", "Cat1a", "Cmt1A_" + (i + 1)));

View file

@ -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.
@ -637,7 +637,7 @@ public class NextPrevCodeUnitPluginTest extends AbstractGhidraHeadedIntegrationT
clearExisingBookmarks();
// add more to our current set
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
addCmd.add(new BookmarkEditCmd(addr("01001110"), BookmarkType.ERROR, "Cat1a", "Cmt1A"));
addCmd.add(new BookmarkEditCmd(addr("01001118"), BookmarkType.NOTE, "Cat1a", "Cmt1B"));
addCmd.add(new BookmarkEditCmd(addr("01001120"), BookmarkType.ERROR, "Cat1a", "Cmt1B"));
@ -736,7 +736,7 @@ public class NextPrevCodeUnitPluginTest extends AbstractGhidraHeadedIntegrationT
clearExisingBookmarks();
// add more to our current set
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
addCmd.add(new BookmarkEditCmd(addr("01003e2c"), BookmarkType.WARNING, "Cat1a", "Cmt1A"));
addCmd.add(new BookmarkEditCmd(addr("01003e2e"), BookmarkType.NOTE, "Cat1a", "Cmt1B"));
addCmd.add(new BookmarkEditCmd(addr("01003e30"), BookmarkType.WARNING, "Cat1a", "Cmt1B"));
@ -803,7 +803,7 @@ public class NextPrevCodeUnitPluginTest extends AbstractGhidraHeadedIntegrationT
String typeString = bob.getTypeString();
// add more to our current set
CompoundCmd addCmd = new CompoundCmd("Add Bookmarks");
CompoundCmd<Program> addCmd = new CompoundCmd<>("Add Bookmarks");
addCmd.add(new BookmarkEditCmd(addr("0100529b"), typeString, "Cat1a", "Cmt1A"));
addCmd.add(new BookmarkEditCmd(addr("0100529d"), BookmarkType.NOTE, "Cat1a", "Cmt1B"));
addCmd.add(new BookmarkEditCmd(addr("0100529e"), typeString, "Cat1a", "Cmt1B"));

View file

@ -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,9 +15,7 @@
*/
package ghidra.app.plugin.core.scalartable;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.List;
@ -818,7 +816,7 @@ public class ScalarSearchTest extends AbstractGhidraHeadedIntegrationTest {
assertTrue("Unable to apply data type at address: " + address, apply(createDataCommand));
}
private boolean apply(Command cmd) throws RollbackException {
private boolean apply(Command<Program> cmd) throws RollbackException {
return cmd.applyTo(program);
}

View file

@ -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.
@ -558,7 +558,7 @@ public class SymbolTreeNavigationTest extends AbstractProgramBasedTest {
assertNull("Found a selected node when there should be no selection", node);
}
public void applyCmd(Command cmd) throws RollbackException {
public void applyCmd(Command<Program> cmd) throws RollbackException {
boolean success = applyCmd(program, cmd);
assertTrue("Command failed - " + cmd.getName() + "; status = " + cmd.getStatusMsg(),
success);

View file

@ -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.
@ -1438,7 +1438,8 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
private void addLabel(String label, String namespaceName, Address address) throws Exception {
Namespace namespace = null;
if (namespaceName != null) {
Command command = new CreateNamespacesCmd(namespaceName, SourceType.USER_DEFINED);
Command<Program> command =
new CreateNamespacesCmd(namespaceName, SourceType.USER_DEFINED);
if (tool.execute(command, program)) {
List<Namespace> namespaces =
NamespaceUtils.getNamespaceByPath(program, null, namespaceName);
@ -1450,7 +1451,8 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
}
}
Command command = new AddLabelCmd(address, label, namespace, SourceType.USER_DEFINED);
Command<Program> command =
new AddLabelCmd(address, label, namespace, SourceType.USER_DEFINED);
tool.execute(command, program);
waitForNotBusy();
}
@ -1700,7 +1702,7 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
waitForSwing();
int max = symbolTable.getRowCount();
for (int i = 0; i < max; i++) {
Symbol s = (Symbol) symbolTable.getValueAt(i, SymbolTableModel.LABEL_COL);
Symbol s = (Symbol) symbolTable.getValueAt(i, AbstractSymbolTableModel.LABEL_COL);
if (s == null) {
continue; // symbol deleted
}

View file

@ -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.
@ -294,7 +294,7 @@ public class OperandFieldFactoryTest extends AbstractGhidraHeadedIntegrationTest
structure.add(IntegerDataType.dataType, "field3", "Comment 3");
Address arrayAddr = addr("01001888");
Command cmd = new CreateArrayCmd(arrayAddr, 3, structure, 12);
Command<Program> cmd = new CreateArrayCmd(arrayAddr, 3, structure, 12);
applyCmd(program, cmd);
String arrayName = "ArrayOfStructures";
@ -330,7 +330,7 @@ public class OperandFieldFactoryTest extends AbstractGhidraHeadedIntegrationTest
structure.add(IntegerDataType.dataType, "field3", "Comment 3");
Address structAddr = addr("01001888");
Command cmd = new CreateStructureCmd(structure, structAddr);
Command<Program> cmd = new CreateStructureCmd(structure, structAddr);
applyCmd(program, cmd);
String structName = "Structure";
@ -358,7 +358,7 @@ public class OperandFieldFactoryTest extends AbstractGhidraHeadedIntegrationTest
//==================================================================================================
protected void disassembleAt(Address addr) {
Command cmd = new DisassembleCommand(addr, null, false);
Command<Program> cmd = new DisassembleCommand(addr, null, false);
applyCmd(program, cmd);
waitForSwing();
}

View file

@ -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.
@ -256,7 +256,8 @@ public class StructureFactoryTest extends AbstractGhidraHeadedIntegrationTest {
// create a valid structure...
int defaultPtrLen = program.getAddressFactory().getDefaultAddressSpace().getPointerSize();
Command cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structureLength);
Command<Program> cmd =
new CreateStructureCmd("TestStructA", addr(startOffset), structureLength);
cmd.applyTo(program);
Data d = program.getListing().getDataAt(addr(startOffset));

View file

@ -72,7 +72,7 @@ public class CreateArrayInStructureCmdTest extends AbstractGenericTest {
Address addr = addr(UNDEFINED_AREA);
int structLen = 30;
Command cmd = new CreateStructureCmd(addr, structLen);
Command<Program> cmd = new CreateStructureCmd(addr, structLen);
cmd.applyTo(program);
DataType dt = new Pointer16DataType(new ByteDataType());
@ -120,7 +120,7 @@ public class CreateArrayInStructureCmdTest extends AbstractGenericTest {
struct1.add(new DWordDataType());
struct1.add(new QWordDataType());
Command cmd = new CreateDataCmd(addr(startOffset + 1), struct1);
Command<Program> cmd = new CreateDataCmd(addr(startOffset + 1), struct1);
cmd.applyTo(program);
Data dataAt = program.getListing().getDataAt(addr(startOffset + 1));
struct1 = (Structure) dataAt.getDataType();

View file

@ -69,7 +69,7 @@ public class CreateDataInStructureBackgroundCmdTest extends AbstractGenericTest
int structLen = (2 * defaultPtrLen) + 2;
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
cmd.applyTo(program);
cmd = new CreateDataInStructureBackgroundCmd(addr(startOffset), new int[] { 0 }, 2,
@ -126,7 +126,7 @@ public class CreateDataInStructureBackgroundCmdTest extends AbstractGenericTest
int structLen = (2 * defaultPtrLen) + (2 * structA.getLength());
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
cmd.applyTo(program);
cmd = new CreateDataInStructureBackgroundCmd(addr(startOffset), new int[] { 0 },
@ -175,7 +175,7 @@ public class CreateDataInStructureBackgroundCmdTest extends AbstractGenericTest
long startOffset = UNDEFINED_AREA;
int structLen = 4;
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
cmd.applyTo(program);
cmd = new CreateDataInStructureBackgroundCmd(addr(startOffset), new int[] { 0 }, 4,

View file

@ -69,7 +69,7 @@ public class CreateDataInStructureCmdTest extends AbstractGenericTest {
int structLen = defaultPtrLen + 1;
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
cmd.applyTo(program);
cmd = new CreateDataInStructureCmd(addr(startOffset), new int[] { 0 }, new ByteDataType());
@ -116,7 +116,7 @@ public class CreateDataInStructureCmdTest extends AbstractGenericTest {
int structLen = defaultPtrLen + structA.getLength();
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
cmd.applyTo(program);
cmd = new CreateDataInStructureCmd(addr(startOffset), new int[] { 0 }, structA);
@ -155,7 +155,7 @@ public class CreateDataInStructureCmdTest extends AbstractGenericTest {
long startOffset = UNDEFINED_AREA;
int structLen = 1;
Command cmd = new CreateStructureCmd(addr(startOffset), structLen);
Command<Program> cmd = new CreateStructureCmd(addr(startOffset), structLen);
cmd.applyTo(program);
cmd = new CreateDataInStructureCmd(addr(startOffset), new int[] { 0 }, new ByteDataType());
@ -203,7 +203,7 @@ public class CreateDataInStructureCmdTest extends AbstractGenericTest {
struct1.add(adt);
struct1.add(new WordDataType());
Command cmd = new CreateDataCmd(addr(startOffset + 1000), struct1);
Command<Program> cmd = new CreateDataCmd(addr(startOffset + 1000), struct1);
cmd.applyTo(program);
Data dataAt = program.getListing().getDataAt(addr(startOffset + 1000));
struct1 = (Structure) dataAt.getDataType();

View file

@ -102,7 +102,7 @@ public class CreateStructureInStructureCmdTest extends AbstractGenericTest {
offset = createArray(offset, 8, 4, stringPtr);
int structLen = (int) (offset - startOffset);
Command cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structLen);
Command<Program> cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structLen);
cmd.applyTo(program);
Data d = program.getListing().getDataAt(addr(startOffset));
@ -179,7 +179,7 @@ public class CreateStructureInStructureCmdTest extends AbstractGenericTest {
offset = createArray(offset, 8, 4, stringPtr);
int structLen = (int) (offset - startOffset);
Command cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structLen);
Command<Program> cmd = new CreateStructureCmd("TestStructA", addr(startOffset), structLen);
cmd.applyTo(program);
Data d = program.getListing().getDataAt(addr(startOffset));

View file

@ -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,7 +20,6 @@ import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import generic.test.AbstractGenericTest;
import ghidra.app.plugin.core.analysis.AnalysisBackgroundCommand;
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
import ghidra.framework.cmd.Command;
@ -30,7 +29,6 @@ import ghidra.program.database.ProgramBuilder;
import ghidra.program.database.function.OverlappingFunctionException;
import ghidra.program.model.address.*;
import ghidra.program.model.listing.*;
import ghidra.program.model.symbol.SourceType;
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
import ghidra.test.TestEnv;
@ -78,7 +76,7 @@ public class CreateFunctionCmdWithFlowTest extends AbstractGhidraHeadedIntegrati
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
analysisMgr.reAnalyzeAll(null);
Command cmd = new AnalysisBackgroundCommand(analysisMgr, false);
Command<Program> cmd = new AnalysisBackgroundCommand(analysisMgr, false);
tool.execute(cmd, program);
waitForBusyTool(tool);
}

View file

@ -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.
@ -263,7 +263,7 @@ public class AddLabelCmdTest extends AbstractGenericTest {
return p.getSymbolTable().getPrimarySymbol(addr);
}
private boolean execute(Command cmd) {
private boolean execute(Command<Program> cmd) {
int txId = notepad.startTransaction("Transaction");
boolean result = cmd.applyTo(notepad);
notepad.endTransaction(txId, true);

View file

@ -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.
@ -68,7 +68,8 @@ public class CreateNamespacesCmdTest extends AbstractGenericTest {
String[] namespaces1 = new String[] { "Global", "child1", "child2" };
String namespaceString1 = createNamespaceStringFromArray(namespaces1);
Command command = new CreateNamespacesCmd(namespaceString1, SourceType.USER_DEFINED);
Command<Program> command =
new CreateNamespacesCmd(namespaceString1, SourceType.USER_DEFINED);
boolean success = execute(command);
assertTrue("Failed to create namespaces from string: " + namespaceString1 + "\nMessage: " +
command.getStatusMsg(), success);
@ -348,7 +349,7 @@ public class CreateNamespacesCmdTest extends AbstractGenericTest {
}
}
private boolean execute(Command cmd) {
private boolean execute(Command<Program> cmd) {
int txId = program.startTransaction("Transaction");
boolean result = cmd.applyTo(program);
program.endTransaction(txId, true);

View file

@ -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 @@ import ghidra.util.exception.RollbackException;
public class AddMemoryBlockCmdTest extends AbstractGenericTest {
private Program notepad;
private Program x08;
private Command command;
private Command<Program> command;
public AddMemoryBlockCmdTest() {
super();
@ -73,7 +73,7 @@ public class AddMemoryBlockCmdTest extends AbstractGenericTest {
assertEquals(block.getName(), f.getName());
}
private boolean applyCmd(Program p, Command c) {
private boolean applyCmd(Program p, Command<Program> c) {
int txId = p.startTransaction(c.getName());
boolean commit = true;
try {

View file

@ -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.
@ -33,8 +33,7 @@ import ghidra.program.database.ProgramBuilder;
import ghidra.program.database.ProgramDB;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressFactory;
import ghidra.program.model.listing.CodeUnit;
import ghidra.program.model.listing.Listing;
import ghidra.program.model.listing.*;
import ghidra.program.model.symbol.RefType;
import ghidra.program.model.symbol.SourceType;
import ghidra.test.AbstractGhidraHeadlessIntegrationTest;
@ -96,7 +95,7 @@ public class EolCommentsTest extends AbstractGenericTest {
@Test
public void testReferenceToStringData() throws Exception {
Command cmd = new AddMemRefCmd(addr("0x1001000"), addr("0x1001234"),
Command<Program> cmd = new AddMemRefCmd(addr("0x1001000"), addr("0x1001234"),
SourceType.USER_DEFINED, 0, true);
applyCmd(cmd);
@ -115,7 +114,7 @@ public class EolCommentsTest extends AbstractGenericTest {
Address dataStartAddress = addr("0x1001234");
Address offcutAddress = dataStartAddress.add(2);
Command cmd =
Command<Program> cmd =
new AddMemRefCmd(addr("0x1001000"), offcutAddress, SourceType.USER_DEFINED, 0, true);
applyCmd(cmd);
@ -138,7 +137,7 @@ public class EolCommentsTest extends AbstractGenericTest {
Address dataStartAddress = addr("0x1001234");
Address offcutAddress = dataStartAddress.add(2);
Command cmd =
Command<Program> cmd =
new AddMemRefCmd(addr("0x1001000"), offcutAddress, SourceType.USER_DEFINED, 0, true);
applyCmd(cmd);
@ -165,7 +164,7 @@ public class EolCommentsTest extends AbstractGenericTest {
//
Address dataStartAddress = addr("0x1001234");
Address offcutAddress = dataStartAddress.add(4);
Command cmd =
Command<Program> cmd =
new AddMemRefCmd(addr("0x1001000"), offcutAddress, SourceType.USER_DEFINED, 0, true);
applyCmd(cmd);
@ -226,7 +225,7 @@ public class EolCommentsTest extends AbstractGenericTest {
assertEquals(0, comments.size());
}
public boolean applyCmd(Command cmd) throws RollbackException {
public boolean applyCmd(Command<Program> cmd) throws RollbackException {
return AbstractGhidraHeadlessIntegrationTest.applyCmd(program, cmd);
}

View file

@ -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,6 +27,7 @@ import ghidra.app.plugin.core.decompile.DecompilerActionContext;
import ghidra.app.util.HelpTopics;
import ghidra.framework.cmd.Command;
import ghidra.framework.plugintool.PluginTool;
import ghidra.program.model.listing.Program;
import ghidra.program.model.symbol.SourceType;
import ghidra.program.model.symbol.Symbol;
import ghidra.util.HelpLocation;
@ -64,7 +65,8 @@ public class RemoveLabelAction extends AbstractDecompilerAction {
@Override
protected void decompilerActionPerformed(DecompilerActionContext context) {
Symbol s = getSymbol(context);
Command cmd = new DeleteLabelCmd(s.getAddress(), s.getName(), s.getParentNamespace());
Command<Program> cmd =
new DeleteLabelCmd(s.getAddress(), s.getName(), s.getParentNamespace());
PluginTool tool = context.getTool();
if (!tool.execute(cmd, context.getProgram())) {
tool.setStatusInfo(cmd.getStatusMsg());

View file

@ -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.
@ -157,7 +157,7 @@ public class TagFilterEditorDialog extends DialogComponentProvider implements Ta
// Inner Classes
//==================================================================================================
private class TagListModel extends DefaultListModel {
private class TagListModel extends DefaultListModel<TagInfo> {
TagListModel(Map<String, VTMatchTag> allTags, Map<String, VTMatchTag> excludedTags) {
for (Map.Entry<String, VTMatchTag> entry : allTags.entrySet()) {
boolean isExcluded = excludedTags.containsKey(entry.getKey());

View file

@ -180,7 +180,7 @@ public class LayoutLocationMap<V, E> {
return row;
}
public int gridX(Column col) {
public int gridX(Column<V> col) {
return col.index;
}

View file

@ -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,17 +19,12 @@ import static org.junit.Assert.*;
import org.junit.*;
import ghidra.app.plugin.core.analysis.AnalysisBackgroundCommand;
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
import ghidra.framework.cmd.Command;
import ghidra.framework.options.Options;
import ghidra.framework.plugintool.PluginTool;
import ghidra.program.database.ProgramBuilder;
import ghidra.program.model.address.AddressSet;
import ghidra.program.model.data.DWordDataType;
import ghidra.program.model.data.DataType;
import ghidra.program.model.listing.*;
import ghidra.program.model.symbol.SourceType;
import ghidra.program.model.listing.Instruction;
import ghidra.program.model.listing.Program;
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
import ghidra.test.TestEnv;
@ -67,7 +62,7 @@ public class ArmBranchReturnDetectionTest extends AbstractGhidraHeadedIntegratio
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
analysisMgr.reAnalyzeAll(null);
Command cmd = new AnalysisBackgroundCommand(analysisMgr, false);
Command<Program> cmd = new AnalysisBackgroundCommand(analysisMgr, false);
tool.execute(cmd, program);
waitForBusyTool(tool);
}

View file

@ -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.
@ -433,7 +433,7 @@ public class JavaAnalyzer extends AbstractJavaAnalyzer implements AnalysisWorker
Data referredData = constantPoolData.getComponent(indexMap.get(index));
instruction.addOperandReference(0, referredData.getAddress(), RefType.DATA,
SourceType.ANALYSIS);
CompoundCmd cmd = new CompoundCmd("Add constant pool reference");
CompoundCmd<Program> cmd = new CompoundCmd<>("Add constant pool reference");
String constantPoolLabel = "CPOOL[" + index + "]";
cmd.add(
new AddLabelCmd(referredData.getAddress(), constantPoolLabel, SourceType.ANALYSIS));

View file

@ -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.
@ -25,12 +25,10 @@ import ghidra.framework.cmd.Command;
import ghidra.framework.options.Options;
import ghidra.framework.plugintool.PluginTool;
import ghidra.program.database.ProgramBuilder;
import ghidra.program.model.address.AddressSet;
import ghidra.program.model.data.DWordDataType;
import ghidra.program.model.data.DataType;
import ghidra.program.model.listing.*;
import ghidra.program.model.symbol.Reference;
import ghidra.program.model.symbol.SourceType;
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
import ghidra.test.TestEnv;
@ -69,7 +67,7 @@ public class CreateFunctionThunkTest extends AbstractGhidraHeadedIntegrationTest
AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(program);
analysisMgr.reAnalyzeAll(null);
Command cmd = new AnalysisBackgroundCommand(analysisMgr, false);
Command<Program> cmd = new AnalysisBackgroundCommand(analysisMgr, false);
tool.execute(cmd, program);
waitForBusyTool(tool);
}