Skip to content

Conversation

@cstamas
Copy link
Member

@cstamas cstamas commented Sep 14, 2025

The new "path" CR in certain cases (cycle involving two different instances of DependencyNode as one was managed into same as other + parent of the cycle node has multiple/mixed children of cycling and non cycling + parent of the cycle head was the sole winner) left cycles in place even at verbosity levels of NONE and STANDARD when cycles should be removed. This is fixed. Another issue was that "path" CR was "too eager" by applying winner scope/optional to all nodes, while it should have apply it only to winner, as losers are marked as such (and possibly eliminated).

Changes:

  • fixed the bug, also cleaned up push(int) method as it had some redundancy and misplaced comments
  • fixed the eager application of winner scope/optional -- only winner have those applied
  • dropped some copy-pasta constant remnants (they are all in super class)
  • improved Verbosity javadoc re loops
  • added UT that reproduces the issue covering all CRs and verbosity levels
  • added demo with this exact case; demos also run as part of run-its, so is an extra safety belt

Fixes #1583

If the cycle is among winner nodes. Created UT as reproducer
but we will need more.
But all these fail the classic CR not the path!
Created UT that reproduces: classic CR passes ok, but
path CR fails, leave cycle in.
@cstamas cstamas self-assigned this Sep 14, 2025
@cstamas cstamas added this to the 2.0.12 milestone Sep 14, 2025
@cstamas cstamas changed the title Bug: Reproducer for #1583 Bug: Reproducer and fix for #1583 Sep 14, 2025
@cstamas cstamas linked an issue Sep 14, 2025 that may be closed by this pull request
@cstamas cstamas added the bug Something isn't working label Sep 14, 2025
@cstamas cstamas marked this pull request as ready for review September 14, 2025 12:16
As other nodes will be marked as losers anyway (and probably eliminated)
Original code LEFT OUT some nodes from Path graph, hence implicitly left
cycles in as well (as Path graph was unaware of it). Now we make sure
all cycle starting nodes are added as well, AND we make sure they
are always "claimed" (winner or loser) as then the DN graph
is adjusted properly.
Copy link
Member

@slawekjaranowski slawekjaranowski left a comment

Choose a reason for hiding this comment

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

checked with enforcer, dependency and mojo version plugins

@cstamas cstamas merged commit 652ae3d into apache:master Sep 17, 2025
8 checks passed
@cstamas cstamas deleted the issue-1583-ut branch September 17, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StackOverflowError in ManagedDependencyContextRefiner

2 participants