-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[java-source-utils] Better support orphaned Javadocs (#757)
Context: #687 (comment) What happens when there's a "regular" Java comment in between a Javadoc comment and a member? /* partial */ class Object { /** Create and return a copy of this object… */ // BEGIN Android-changed: Use native local helper for clone() // … protected Object clone() throws CloneNotSupportedException {…} } 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: class Outer { /** Orphaned #1 */ // cause orphaning class Inner {} void m() {} } Because containing types are fully processed before contained types, `Outer.m()` would grab the Javadoc for `Outer.Inner` before `Outer.Inner` would 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: * javaparser/javaparser@javaparser-parent-3.16.1...javaparser-parent-3.18.0
- Loading branch information
Showing
4 changed files
with
74 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters