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
8259216: javadoc omits method receiver for any nested type annotation #1997
Conversation
Hi @liach, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user liach" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
/signed |
Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated! |
Hi, |
Done. |
/test |
@liach you need to get approval to run the tests in tier1 for commits up until 450348c8 |
A quick summary:
|
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.
Thanks for the contribution, this looks good in general.
public Boolean visitDeclared(DeclaredType t, Void unused) { | ||
// kind 1 | ||
if (super.visitDeclared(t, unused) || visit(t.getEnclosingType())) | ||
return true; |
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.
By convention we always use braces in if-statements.
|
||
@Override | ||
public Boolean visitArray(ArrayType t, Void unused) { | ||
// kind 0 |
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.
Just wondering: what does "kind n" refer to?
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 is the "type path kind" as defined in https://docs.oracle.com/javase/specs/jvms/se15/html/jvms-4.html#jvms-4.7.20.2-210
@@ -328,6 +328,53 @@ public boolean isAnnotated(TypeMirror e) { | |||
return !e.getAnnotationMirrors().isEmpty(); | |||
} | |||
|
|||
public boolean isRecursivelyAnnotated(TypeMirror e) { |
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'm not sure this needs to be a new public method in Utils
since it is only used by AbstractExcecutableMemberWriter
. It also seems to do more than is necessary for that use case (array, wildcard).
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.
Agreed. Moved this to a helper method like addParameters
in AbstractExcecutableMemberWriter
. Also changed test so the tests for Generic2
's doc group together.
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.
Looks good! The only issue I found is a change in wording in a doc comment (see inline comment).
Please note that you can push an incremental commit to your branch so you don't have to force-push, this also makes it easier to review.
tree.add("this"); | ||
} | ||
|
||
/** | ||
* Returns if a receiver type is annotated anywhere in its type for |
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.
Should read "Returns {@code true} if..."
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. Rebased to fix merge conflict as well.
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.
Looks good!
@liach This change now passes all automated pre-integration checks. 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 23 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@hns) but any other Committer may sponsor as well.
|
/integrate |
/sponsor |
@hns @liach Since your change was applied there have been 25 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit eb7fa00. |
Fixes the bug where receiver type is omitted in generated Javadoc when the immediate receiver type is not annotated (but some other type within is).
In addition, fixed the bug where receiver type for constructor is not properly qualified (without a clickable link), i.e.
OuterClass.this
vsthis
.Testing can is done with these two Java Files:
Ape.java
Cute.java
Before the fix (tested in oracle jdk 15.0.1):
Ape#m2()
Bee#<init>()
Bee#f1()
Bee#f3(Bee)
in the method details sectionBee#<init>(Void)
is unqualified; such unqualified receiver fails injavac
After the fix:
Ape#m3
Bee#f0
still don't have receivers documented as their receivers are not annotatedBee#f3(Bee)
's receiver is not annotated due to a distinct bugBee#<init>(Void)
is now qualified asBee.this
(without a link onBee
)(Note: receiver parameters are never included in the method summary section; they only present in method details sections)
Non goal:
Ape.Bee#f3
in this exampleProgress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1997/head:pull/1997
$ git checkout pull/1997