Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Bug: GH-1703
GroupTree did reset accepted state causing middle elements
to become forbidden.
  • Loading branch information
cstamas committed Dec 10, 2025
commit 438289b27b8b2da8320ca55df776b7424dad166d
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public boolean acceptedGroupId(String groupId) {
}
if (currentNode.isStop() && groupElements.equals(current)) {
accepted = currentNode.isAllow();
} else if (!currentNode.isStop()) {
} else if (!currentNode.isStop() && currentNode.isAllow() != null) {
accepted = currentNode.isAllow();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,19 @@ void implicitAndExplicitDefaultIsSame() {

assertEquals(implicitResults, explicitResults);
}

@Test
void gh1703One() {
GroupTree groupTree = new GroupTree("root");
// this is redundant, as 'org.apache' IMPLIES 'org.apache.maven.plugins'
groupTree.loadNodes(Stream.of(
"# comment",
"",
"org.apache",
"org.apache.maven.plugins"));

assertTrue(groupTree.acceptedGroupId("org.apache")); // this is given
assertTrue(groupTree.acceptedGroupId("org.apache.maven")); // implied by above
assertTrue(groupTree.acceptedGroupId("org.apache.maven.plugins")); // implied by above (line is redundant)
}
}
Loading