-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8177100: APIs duplicated in JavaDoc #25123
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 nbenalla! A progress list of the required criteria for merging this PR into |
@nizarbenalla 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 29 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 |
@nizarbenalla 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
|
@@ -689,10 +689,15 @@ private boolean allowInheritedMethod(ExecutableElement inheritedMethod, | |||
if (inInterface) { | |||
List<ExecutableElement> list = overriddenByTable.get(inheritedMethod); | |||
if (list != null) { |
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.
Can't we change this to if (list != null && !list.isEmpty) return false;
?
Comments can be to update the overall block comment to indicate that there is no contention - when a method overrides multiple superinterfaces' methods, including when it is final from superclasses, the superclass method always prevails due to method resolution rules in Java. All interface methods have low resolution priority.
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 think this simplification works just fine.
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, thanks!
I'm not sure about this. @nizarbenalla have you tested whether this changes the output for JDK docs? |
There's a problem with character encoding in this patch, please do not integrate:
|
/reviewers 2 committer |
As I suspected, this removes methods from the "Methods declared in interface XY" sections. For example, in the |
Hannes suggested in offline discussion where the check can be instead of the old approach. Thanks for catching this oversight during the review. |
Please don't review this yet, I plan on pushing an other update. |
I've updated the test as the name was not accurate, and simplified the code in |
I have to apologize for my previous review. When I noticed that JDK documentation had changed, my knee-jerk reaction was to assume that the change was wrong. But it is indeed the current documentation that is wrong. For example in StringBuilder, the methods overridden in the hidden Similarly (but without the hidden superclass), the So your first solution (in the simplified form) was actually correct after all. |
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 identical to the initial version.
@liach I realized the first version was right after all (see my comment above). We should not document a method as inherited from some interface when it is implemented in the local class or some superclass. So this gets rid of duplicate inherited methods, such as |
"sb"); | ||
checkExit(Exit.OK); | ||
|
||
checkOutput("sb/U.html", false, |
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 you add a positive check to this test and testHashMapInheritance
that the method is documented as expected (as local method in this test, and as inherited from the public abstract class in testHashMapInheritance
), and that the method details has a "Specified by: ..." entry pointing to the interface method?
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.
Updated the test to add a positive check. Tests are currently running in CI.
If the update look trivial enough, could you set the reviewer count back to 1?
Passes tier 1-3. |
<div class="horizontal-scroll"> | ||
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">V</span>()</div> | ||
</div> | ||
"""); |
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.
That's the doc for the constructor. I was looking for method testJ
inherited from abstract class PubJ
.
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 believe testJ
does not have it's own doc in V.html
. It only appears in the "methods inherited from class J" section
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.
Yes, that's what should be tested.
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 in a34c4d5.
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, looks good.
And sorry for being nit-picky about the tests, but it's better to have all details covered.
Thank you for the reviews Hannes and Chen. I will integrate once CI jobs are completed on all platforms. Better to be careful. |
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.
The test update looks good.
/integrate |
Going to push as commit f2d2eef.
Your commit was automatically rebased without conflicts. |
@nizarbenalla Pushed as commit f2d2eef. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this patch to fix a bug where a method can be documented multiple times
Consider these 4 classes
Where
A
declarestestA()
,C
implements itpublic final void testA()
,B
extendsA
but does not override it,D
extendsC
and implementsB
In the generated javadoc,
testA()
is documented twice.After the patch,
testA()
is only documented once:Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25123/head:pull/25123
$ git checkout pull/25123
Update a local copy of the PR:
$ git checkout pull/25123
$ git pull https://git.openjdk.org/jdk.git pull/25123/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25123
View PR using the GUI difftool:
$ git pr show -t 25123
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25123.diff
Using Webrev
Link to Webrev Comment