Reset options only on id change

This commit is contained in:
caheckman 2022-03-01 14:21:49 -05:00
parent b2853d40f3
commit bf7412b86a

View File

@ -2051,6 +2051,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
setEventsEnabled(false);
try {
boolean redisassemblyRequired = true;
LanguageID oldLanguageId = languageID;
int oldLanguageVersion = languageVersion;
int oldLanguageMinorVersion = languageMinorVersion;
if (translator != null) {
@ -2079,8 +2080,11 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM
if (newCompilerSpecID != null) {
compilerSpec = ProgramCompilerSpec.getProgramCompilerSpec(this,
language.getCompilerSpecByID(newCompilerSpecID));
if (compilerSpec instanceof ProgramCompilerSpec) {
((ProgramCompilerSpec) compilerSpec).resetProgramOptions(monitor);
if (!oldLanguageId.equals(languageID) ||
!compilerSpecID.equals(newCompilerSpecID)) {
if (compilerSpec instanceof ProgramCompilerSpec) {
((ProgramCompilerSpec) compilerSpec).resetProgramOptions(monitor);
}
}
}
compilerSpecID = compilerSpec.getCompilerSpecID();