Merge remote-tracking branch 'origin/GP-0-dragonmacher-test-fixes-10-29-24'

This commit is contained in:
Ryan Kurtz 2024-10-29 11:29:31 -04:00
commit 24a5928c3c
3 changed files with 21 additions and 4 deletions

View File

@ -61,6 +61,10 @@ public class CodeUnitTableColumn
@Override
public CodeUnitTableCellData getValue(ProgramLocation rowObject, Settings settings,
Program data, ServiceProvider serviceProvider) throws IllegalArgumentException {
if (rowObject == null) {
return null; // This can happen when using mapped table columns
}
ProgramLocation loc = rowObject;
return new CodeUnitTableCellData(loc, getCodeUnitFormat(serviceProvider),
CODE_UNIT_OFFSET.getOffset(settings), CODE_UNIT_COUNT.getCount(settings));

View File

@ -51,6 +51,10 @@ public class LabelTableColumn
@Override
public String getValue(ProgramLocation rowObject, Settings settings, Program program,
ServiceProvider serviceProvider) throws IllegalArgumentException {
if (rowObject == null) {
return null; // This can happen when using mapped table columns
}
if (rowObject instanceof LabelFieldLocation) {
LabelFieldLocation labelFieldLocation = (LabelFieldLocation) rowObject;
return labelFieldLocation.getSymbolPath().getName();
@ -70,6 +74,12 @@ public class LabelTableColumn
private Symbol getSymbol(ProgramLocation rowObject, Program program)
throws IllegalArgumentException {
if (rowObject == null) {
// this can happen when a bookmark is deleted and we use a mapping column that can no
// longer find the bookmark for the BookmarkRowObject
return null;
}
ProgramLocation location = rowObject;
if (rowObject instanceof VariableLocation) {
Variable var = ((VariableLocation) rowObject).getVariable();

View File

@ -125,6 +125,9 @@ public class MappedTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE, DATA_SO
ServiceProvider serviceProvider) throws IllegalArgumentException {
EXPECTED_ROW_TYPE mappedRowObject = map(rowObject, data, serviceProvider);
if (mappedRowObject == null) {
return null;
}
return tableColumn.getValue(mappedRowObject, settings, data, serviceProvider);
}