mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Merge remote-tracking branch 'origin/GP-4165_ghidra1_ProgramUpgradeCacheImprovement--SQUASHED'
This commit is contained in:
commit
4b465a980e
2 changed files with 19 additions and 7 deletions
|
@ -15,6 +15,8 @@
|
|||
*/
|
||||
package ghidra.program.util;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.mem.MemoryAccessException;
|
||||
|
@ -23,8 +25,6 @@ import ghidra.util.*;
|
|||
import ghidra.util.exception.DuplicateNameException;
|
||||
import ghidra.util.exception.InvalidInputException;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* General utility class that provides convenience methods
|
||||
* to deal with Program objects.
|
||||
|
@ -173,4 +173,18 @@ public class ProgramUtilities {
|
|||
Msg.error(ProgramUtilities.class, "Unexpected Exception", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a program has a single unsaved change which corresponds to an
|
||||
* upgrade which occured during instantiation.
|
||||
* @param program the program to be checked for an unsaved upgrade condition.
|
||||
* @return true if program upgraded and has not been saved, else false
|
||||
*/
|
||||
public static boolean isChangedWithUpgradeOnly(Program program) {
|
||||
// The only non-undoable change is an upgrade that occurs during instantiation
|
||||
if (!program.isChanged()) {
|
||||
return false;
|
||||
}
|
||||
return !program.canUndo();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue