Skip to content

IDETECT-5071: fixing SBT eviction bug#1718

Open
fzhengbd wants to merge 1 commit intomasterfrom
dev/zhengf/IDETECT-5071-sbt-evictions-fix
Open

IDETECT-5071: fixing SBT eviction bug#1718
fzhengbd wants to merge 1 commit intomasterfrom
dev/zhengf/IDETECT-5071-sbt-evictions-fix

Conversation

@fzhengbd
Copy link
Copy Markdown

@fzhengbd fzhengbd commented Apr 9, 2026

Description

Bug

Eviction check only tested childNode against evictedIds, but the evicted node is the parentNode in the eviction edge, so the edge was never filtered.

Fix

Added !evictedIds.contains(parentNode) check to the condition in both single-root and multi-root branches.
Also added the missing unit test SbtGraphParserTransformerTest.

Github Issues

N/A

// parentNode is the evicted node (guava:27.0) which is in evictedIds.
// The replacement (guava:30.1) is NOT in evictedIds, so legitimate edges
// like "guice" -> "guava:30.1" are preserved.
if (!evictedIds.contains(childNode) && !evictedIds.contains(parentNode)) {
Copy link
Copy Markdown
Collaborator

@zahidblackduck zahidblackduck Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use some small helper function like following for the two if conditionals on L47 and L57 as these checks are essentially the same,

private boolean shouldIncludeEdge(String childNode, String parentNode) {
    return !evictedIds.contains(childNode) && !evictedIds.contains(parentNode);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants