fix(api): allow to create input category node even if no matching files found (#2806)

This commit is contained in:
Skylot
2026-03-05 18:55:30 +00:00
parent 69fd88d883
commit 06c4fea4d2
2 changed files with 6 additions and 6 deletions
@@ -4,6 +4,7 @@ import java.nio.file.Path;
import java.util.List;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import jadx.gui.treemodel.JNode;
@@ -19,7 +20,11 @@ public interface ITreeInputCategory {
boolean filesFilter(Path file);
/**
* Build node for filtered files
* Build node for filtered files.
* Can be called with empty list (empty category might be useful)
*
* @return category node or null if not needed
*/
@Nullable
JNode buildInputNode(List<Path> files);
}
@@ -46,7 +46,6 @@ public class TreeInputsHelper {
public List<JNode> getCustomNodes() {
return categoryData.stream()
.filter(CategoryData::notEmpty)
.map(CategoryData::buildInputNode)
.filter(Objects::nonNull)
.collect(Collectors.toList());
@@ -84,9 +83,5 @@ public class TreeInputsHelper {
return null;
}
}
public boolean notEmpty() {
return !collectedFiles.isEmpty();
}
}
}