mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-10 09:13:58 -09:00
GP-4403 Use OpenMode enum instead of DBConstants integer value. Disallow transactions when using immutable DomainObject (implemented for ProgramDB and Datatype Archives).
This commit is contained in:
@@ -16,9 +16,9 @@
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import db.DBConstants;
|
||||
import db.DBHandle;
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.framework.data.OpenMode;
|
||||
import ghidra.framework.store.db.PackedDatabase;
|
||||
import ghidra.program.database.ProgramDB;
|
||||
import ghidra.program.model.lang.LanguageNotFoundException;
|
||||
@@ -75,8 +75,8 @@ public class UpgradeTestProgramScript extends GhidraScript {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean upgradeProgramArchive(File gzf) throws IOException, CancelledException,
|
||||
VersionException {
|
||||
private boolean upgradeProgramArchive(File gzf)
|
||||
throws IOException, CancelledException, VersionException {
|
||||
|
||||
PackedDatabase db = PackedDatabase.getPackedDatabase(gzf, TaskMonitor.DUMMY);
|
||||
DBHandle dbh = null;
|
||||
@@ -89,7 +89,7 @@ public class UpgradeTestProgramScript extends GhidraScript {
|
||||
}
|
||||
|
||||
try {
|
||||
p = new ProgramDB(dbh, DBConstants.UPDATE, monitor, this);
|
||||
p = new ProgramDB(dbh, OpenMode.UPDATE, monitor, this);
|
||||
return false;
|
||||
}
|
||||
catch (LanguageNotFoundException e) {
|
||||
@@ -107,7 +107,7 @@ public class UpgradeTestProgramScript extends GhidraScript {
|
||||
}
|
||||
|
||||
dbh = db.openForUpdate(monitor);
|
||||
p = new ProgramDB(dbh, DBConstants.UPGRADE, monitor, this);
|
||||
p = new ProgramDB(dbh, OpenMode.UPGRADE, monitor, this);
|
||||
|
||||
if (!p.isChanged()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user