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:
ghidra1 2024-03-20 17:37:14 -04:00
parent 434c3f315d
commit 41712078e2
161 changed files with 1243 additions and 1158 deletions

View file

@ -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;