GP-5164: Fix DebuggerAddRegionDialog.

This commit is contained in:
Dan
2024-12-04 08:41:55 -05:00
parent 954ff4e124
commit c3419572ae
8 changed files with 84 additions and 34 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.
@@ -310,8 +310,7 @@ public class DBTraceObjectMemoryRegion implements TraceObjectMemoryRegion, DBTra
public void setFlags(Lifespan lifespan, Collection<TraceMemoryFlag> flags) {
try (LockHold hold = object.getTrace().lockWrite()) {
for (TraceMemoryFlag flag : TraceMemoryFlag.values()) {
Boolean val = flags.contains(flag) ? true : null;
object.setValue(lifespan, keyForFlag(flag), val);
object.setValue(lifespan, keyForFlag(flag), flags.contains(flag));
}
}
}
@@ -329,7 +328,7 @@ public class DBTraceObjectMemoryRegion implements TraceObjectMemoryRegion, DBTra
public void clearFlags(Lifespan lifespan, Collection<TraceMemoryFlag> flags) {
try (LockHold hold = object.getTrace().lockWrite()) {
for (TraceMemoryFlag flag : flags) {
object.setValue(lifespan, keyForFlag(flag), null);
object.setValue(lifespan, keyForFlag(flag), false);
}
}
}

View File

@@ -539,9 +539,9 @@ public class DBTraceObjectManager implements TraceObjectManager, DBTraceManager
Class<? extends TargetObject> targetIf = TraceObjectInterfaceUtils.toTargetIf(iface);
TargetObjectSchema schema = rootSchema.getSuccessorSchema(keyList);
if (!schema.getInterfaces().contains(targetIf)) {
throw new IllegalStateException(
"Schema " + schema + " at " + PathUtils.toString(keyList) +
" does not provide interface " + iface.getSimpleName());
throw new BadSchemaException(
"Schema " + schema + " at '" + PathUtils.toString(keyList) +
"' does not provide interface " + iface.getSimpleName());
}
DBTraceObject obj = createObject(TraceObjectKeyPath.of(keyList));
return obj.queryInterface(iface);