Skip to content
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

JDK-8270195: Add missing links between methods of JavaFX properties #5102

Closed

Conversation

jonathan-gibbons
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons commented Aug 12, 2021

Please review a medium-size update to the support for JavaFX properties in the Standard Doclet.

A JavaFX property is typically defined by a group of up to 4 elements:

  • an optional field, which is typically private
  • a no-args property method, whose name ends in Property and which returns an appropriate property object
  • an optional getter method which can get the value of the property
  • an optional setter method which can set the value of the property

Either the field (if present) or the property method (but not both) should have a comment describing the property. The rest should generally _not_have comments: comments will be automatically generated.

This change is primarily to improve the generation of the comments. @see links are generated between the methods for a property. In addition, improvements are made to the handling of @return ... adding it as needed, and removing it when not (the latter occurs when generating the docs for the property itself, using the info in the property method.)

There is some amount of cleanup to the implementation, most notably moving (and rewriting) the code to generate comments for property methods from MemberSummaryBuilder to CommentUtils,which is where most other synthesized comments are generated. However, the goal has also been to not unduly change the spirit and spec of the original code.

A new combo test for JavaFX properties is provided, that creates different instances of a class, containing different property-related methods with and without comments. Basic properties of the output are then verified for each property method: the description, any parameter info, any return info, and any links to other related methods.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8270195: Add missing links between methods of JavaFX properties

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5102/head:pull/5102
$ git checkout pull/5102

Update a local copy of the PR:
$ git checkout pull/5102
$ git pull https://git.openjdk.java.net/jdk pull/5102/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5102

View PR using the GUI difftool:
$ git pr show -t 5102

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5102.diff

Sorry, something went wrong.

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 12, 2021

👋 Welcome back jjg! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 12, 2021
@openjdk
Copy link

openjdk bot commented Aug 12, 2021

@jonathan-gibbons The following label will be automatically applied to this pull request:

  • javadoc

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.

@openjdk openjdk bot added the javadoc javadoc-dev@openjdk.org label Aug 12, 2021
@mlbridge
Copy link

mlbridge bot commented Aug 12, 2021

Webrevs

@kevinrushforth kevinrushforth self-requested a review August 12, 2021 22:09
Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran javadoc with this patch to generate the JavaFX docs, and it all looks good. I verified that the synthesized @see, @param, and @return are now all consistently added. The name of the property is now consistently in <code></code> style, too.

* @param o2 string or tree argument to be formatted into the result
* @return a content tree for the text
*/
public List<? extends DocTree> getComment(String key, Object o0, Object o1, Object o2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this rather complex method to format a text resource? It seems like it is arguments o1 and o2 are never used. Couldn't this be implemented simply using MessageFormat as it used to be?

Copy link
Contributor Author

@jonathan-gibbons jonathan-gibbons Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this rather complex method to format a text resource? It seems like it is arguments o1 and o2 are never used. Couldn't this be implemented simply using MessageFormat as it used to be?

This is the DocTree equivalent of similar code in Content, to format structured objects into a format string. Previously, using MessageFormat, the code used "regular" text to inject the name of the property. Now, using this new code, we can inject the equivalent of {@code _name_ }.

Yes, it is currently a bit more general than strictly required, in that currently we only require a single value to be injected. I guess I was just following the pattern of supporting future use.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. Sounds reasonable.

Copy link
Member

@hns hns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Apologies for the slow review, It took some time to get acquainted with the workings and handling of javafx properties.

* @param o2 string or tree argument to be formatted into the result
* @return a content tree for the text
*/
public List<? extends DocTree> getComment(String key, Object o0, Object o1, Object o2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. Sounds reasonable.

@openjdk
Copy link

openjdk bot commented Aug 24, 2021

@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:

8270195: Add missing links between methods of JavaFX properties

Reviewed-by: kcr, hannesw

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 101 new commits pushed to the master branch:

  • 22ef4f0: 5015261: NPE may be thrown if JDesktopIcon is set to null on a JInternalFrame
  • 9bc0232: 8269223: -Xcheck:jni WARNINGs working with fonts on Linux
  • 2ff4c01: 8271600: C2: CheckCastPP which should closely follow Allocate is sunk of a loop
  • ad92033: 8272736: [JVMCI] Add API for reading and writing JVMCI thread locals
  • 709b591: 8272553: several hotspot runtime/CommandLine tests don't check exit code
  • 1884072: 8265253: javac -Xdoclint:all gives "no comment" warning for code that can't be commented
  • 594e516: 8272778: Consolidate is_instance and is_instance_inlined in java_lang_String
  • d542745: 8267894: Skip work for empty regions in G1 Full GC
  • 741f58c: 8272417: ZGC: fastdebug build crashes when printing ClassLoaderData
  • b7f75c0: 8271142: package help is not displayed for missing X11/extensions/Xrandr.h
  • ... and 91 more: https://git.openjdk.java.net/jdk/compare/9ba8a12cfbb3d7d17be454e29ee6ff476c8690c2...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 24, 2021
@jonathan-gibbons
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Aug 24, 2021

Going to push as commit d34f17c.
Since your change was applied there have been 110 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Aug 24, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Aug 24, 2021
@openjdk
Copy link

openjdk bot commented Aug 24, 2021

@jonathan-gibbons Pushed as commit d34f17c.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@jonathan-gibbons jonathan-gibbons deleted the 8270195.javafx-props branch November 18, 2022 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated javadoc javadoc-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

None yet

3 participants