bug6239: junit failed tests are running green locally

This commit is contained in:
masha.kashirina
2026-05-18 15:15:56 +02:00
parent 6b7741ccbd
commit 03f61a1b45
2 changed files with 21 additions and 7 deletions
@@ -1,5 +1,6 @@
package com.sap.sse.gwt.client.celltable;
import java.util.ArrayList;
import java.util.List;
import com.google.gwt.view.client.ListDataProvider;
@@ -133,10 +134,26 @@ public class RefreshableMultiSelectionModel<T> extends MultiSelectionModelWithSe
setSelected(it, true); // this updates matching elements in the selection model
}
}
// elements that were selected before and that don't have a corresponding element in newObjects
// will just be left alone; they will probably remain in selectedSet, and they were probably not in
// newObjects because a filter removed them. But when they re-appear, e.g., because the filter is
// removed, the elements will naturally be selected again.electionChangeEvent.fire(this);
// Deselect items that are no longer present in newObjects (e.g. because they were deleted).
// newObjects comes from getAllListDataProvider() (the unfiltered list), so absence here means
// true deletion, not just a filter hiding the item.
// Snapshot first to avoid ConcurrentModificationException while calling super.setSelected below.
final List<T> selectedSnapshot = new ArrayList<>();
for (final T s : getSelectedElements()) {
selectedSnapshot.add(s);
}
for (final T selected : selectedSnapshot) {
boolean foundInNew = false;
for (final T candidate : newObjects) {
if (comp != null ? comp.representSameEntity(selected, candidate) : selected.equals(candidate)) {
foundInNew = true;
break;
}
}
if (!foundInNew) {
super.setSelected(selected, false);
}
}
SelectionChangeEvent.fire(this);
}
} finally {
@@ -199,9 +199,6 @@ public abstract class AbstractFilterablePanel<T> extends HorizontalPanel {
}
private void setAll(Iterable<? extends T> all) {
if (getCellTable() != null) {
deselectAll();
}
this.all.getList().clear();
if (all != null) {
for (T t : all) {