[java-source-utils] Better support orphaned Javadocs #757
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: #687 (comment)
What happens when there's a "regular" Java comment in between a
Javadoc comment and a member?
What happens is that the Javadoc becomes orphaned.
Commit 69e1b80 attempted to handle such orphaned Javadocs via
heuristic, using the first orphaned Javadoc comment in the parent
scope. This didn't work reliably, as the parent scope could contain
multiple "unrelated" orphaned Javadoc comments:
Because containing types are fully processed before contained types,
Outer.m()would grab the Javadoc forOuter.InnerbeforeOuter.Innerwould have a chance to grab it.Re-work the logic to associate orphaned Javadocs with their members,
by requiring that the Javadoc comment begin before the member of
interest, and after any preceding members. This should prevent
incorrect correlation of orphaned Javadoc comment blocks.
Additionally, update gradle to use javaparser 3.18.0, from 3.16.1.