Re: Incoming PRs related to 'tree' enhancements

2025-04-07 Thread Bear Giles
It's getting close to PR time - we should have my JIRA account situation straightened out but I need to verify that. The code is substantially complete - I just need to track down some new errors. I suspect they're related to (safe) changes to the generated output but need to be sure. I ended up

Re: Incoming PRs related to 'tree' enhancements

2025-04-06 Thread Bear Giles
I tried sending an update but hit the attachment size limit. After sleeping on it I realized that making several small patches might be better from the review perspective but many decisions won't make sense until you see it in action. So I'm back to a single larger patch, but one without the advan

Re: Incoming PRs related to 'tree' enhancements

2025-03-30 Thread Bear Giles
My primary motivation is making the `mvn dependency:tree -DoutputType=dot` output usable. That's why I've been looking at that code - I've used 'dependency' for years. I can definitely look at repeating the effort but unless the existing implementation is going away soon I would prefer to finish m

Re: Incoming PRs related to 'tree' enhancements

2025-03-30 Thread Guillaume Nodet
Which project are you targeting exactly ? If you're targeting Maven Core, do you think you could target the new API rather than the resolver one ? https://github.com/apache/maven/blob/master/api/maven-api-core/src/main/java/org/apache/maven/api/Node.java Or are you targeting the resolver ? Le dim

Re: Incoming PRs related to 'tree' enhancements

2025-03-30 Thread Bear Giles
P.S., another possibility is extending AutoCloseable - the implementation can have endVisit(node) cache the last node seen so it's available to the close() method. There are two benefits to this. The first is that it eliminates the need for a new method. AutoClosable requires 'close()' but that's

Re: Incoming PRs related to 'tree' enhancements

2025-03-30 Thread Bear Giles
Here's one proposal I mentioned. It would allow the *caller* to eliminate all calls to visit() and endVisit() while maintaining existing behavior. This may allow the callers to drop some now-unnecessary code as well. /** * UpdatedependencyNodeVisitor */ public interface NewDependencyNodeVisitor

Incoming PRs related to 'tree' enhancements

2025-03-30 Thread Bear Giles
I've taken the time to look around the other 'tree' classes, or more precisely the '*DependencyNodeVisitor" classes, and noticed that most if not all of them follow the anti-pattern of doing more than one thing in each method. More precisely they mix logic ('what to include') and presentation ('wha