Prevent stack overflow in deps calc

This commit is contained in:
crschnick
2026-06-13 17:55:00 +00:00
parent 568e06f8da
commit 800034fc7e
2 changed files with 5 additions and 3 deletions
@@ -451,7 +451,7 @@ public abstract class DataStorage {
entry.finalizeEntry();
}
public Collection<DataStoreEntryRef<?>> getDependencies(DataStoreEntry entry) {
public Set<DataStoreEntryRef<?>> getDependencies(DataStoreEntry entry) {
var l = new HashSet<DataStoreEntryRef<?>>();
var store = entry.getStore();
@@ -462,7 +462,9 @@ public abstract class DataStorage {
var deps = store.getDependencies();
l.addAll(deps);
for (DataStoreEntryRef<?> dep : deps) {
l.addAll(getDependencies(dep.get()));
if (!l.contains(dep)) {
l.addAll(getDependencies(dep.get()));
}
}
return l;
}
@@ -686,8 +686,8 @@ public class DataStoreEntry extends StorageElement {
}
try {
store.checkComplete();
incrementBusyCounter();
store.checkComplete();
if ((store instanceof ValidatableStore l)) {
l.validate();
}