-
Notifications
You must be signed in to change notification settings - Fork 5.8k
JDK-8265042: javadoc HTML files not generated for types nested in records #3821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back jjg! A progress list of the required criteria for merging this PR into |
@jonathan-gibbons The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like both the predicate/lambda based methods and the new test a lot! I found some bits that should be cleaned up before integrating.
* @param e the element, such as a package element or type element | ||
* @param select the predicate for the selected members | ||
* @param clazz the class of the filtered members | ||
* @param <T> the class of the filtered members |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter documentation in this and other new methods above is a bit messy/wrong. For example, the boolean all
is not documented anywhere, and <T>
is documented as a parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix the docs for all
, which was a late-addition. I had previously tried to get away with using just the select filter. <T>
is supposed to be documented when it is a type parameter in the signature of a generic method.
List<TypeElement> classes = getItems0(e, all, this::isTypeElement, TypeElement.class); | ||
for (TypeElement c : classes) { | ||
list.addAll(getItems0(c, all, filter, clazz)); | ||
recursiveGetItems(list, c, all, filter, clazz); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you are adding these items twice, directly in the first line of the loop and then again in the recursive invocation. (I think this was carried over from the prior implementation.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
private <T extends Element> List<T> getItems0(Element e, boolean all, Predicate<Element> select, Class<T> clazz) { | ||
return e.getEnclosedElements().stream() | ||
.filter(e_ -> select.test(e_) && (all || shouldDocument(e_))) | ||
.map(ee -> clazz.cast(ee)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be written as method reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@jonathan-gibbons This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 113 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
@jonathan-gibbons Since your change was applied there have been 127 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 947d69d. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This addresses an oversight in the support for records.
The fix could have been as simple as a one-word addition to a list of element kinds to check for nested classes. However, instead of that, the fix is more of a cleanup of a group of methods in
Utils
to fix this issue and to reduce the likelihood of anything similar happening again, when the next new kind of class is added.The cleanup uses new code idioms using lambdas, predicates, and generic methods to replace varargs and temporary sets and copying lists. The naming is somewhat cleaned up as well, but it was a self-imposed restriction that the cleanup is limited to the
Utils
class, and does not leak into clients of the class.There is a core
getItems
method which is somewhat multi-purpose, supporting recursive and non-recursive use, and examining either just documented members or all members, including members that are not directly documented. (The latter occurs mostly in serialization.) It is possible there is a future refactoring to further improve this method, perhaps to break it into different methods. With that in mind, the signature of some methods was narrowed from accepting anyElement
to a specific kind of element: generally, one ofPackageElement
orTypeElement
.A new test is provided that checks that all the expected files are generated for various kinds of nested classes and interfaces in all kinds of classes and interfaces. The test is designed to fail if a new kind of class or interface is added in future without a corresponding update to the test.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3821/head:pull/3821
$ git checkout pull/3821
Update a local copy of the PR:
$ git checkout pull/3821
$ git pull https://git.openjdk.java.net/jdk pull/3821/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3821
View PR using the GUI difftool:
$ git pr show -t 3821
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3821.diff