-
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back nbenalla! A progress list of the required criteria for merging this PR into |
@nizarbenalla This change is no longer ready for integration - check the PR body for details. |
@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?
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