-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8373186: Improve readability of core reflection toString specifications #28688
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 darcy! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
| * public static final int java.lang.Thread.MIN_PRIORITY | ||
| * private int java.io.FileDescriptor.fd | ||
| * public static java.util.List Foo.bar | ||
| * </pre> |
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.
Having such examples here means this method has a specified output that users can parse. We should move this to some non-normative section like an implementation note.
(Don't know why github mobile didn't capture my comment before, I already commented yesterday)
| * by the field type, followed by a space, followed by | ||
| * the fully-qualified name of the class declaring the field, | ||
| * followed by a period, followed by the name of the field. | ||
| * {@return a string describing this {@code Field}} |
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.
Field::toString has been specified this way since JDK 1.1 and we have to assume there are frameworks or libraries that would break if we were ever change the format of the String representation. Would it be possible to put more context for the proposal in the JBS or PR? I think I'm mostly trying to understand if this is just about readability or whether an incompatible change to the string representation might follow.
| * by the field type, followed by a space, followed by | ||
| * the fully-qualified name of the class declaring the field, | ||
| * followed by a period, followed by the name of the field. | ||
| * {@return a string describing this {@code Field}} |
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 don't see a compelling reason to backtrack on the format of toString.
Its likely to break some application or description of the field to a user.
| * @apiNote | ||
| * Specific information about {@linkplain #getModifiers() | ||
| * modifiers} or other aspects of the field should be retrieved | ||
| * using methods for that purpose. |
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.
This is needlessly vague and gives an opportunity to reinforce the preferred order of modifiers.
Partial implementation of a spec refactoring to get some feedback before writing similar changes for other core reflection types.
Progress
Issues
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28688/head:pull/28688$ git checkout pull/28688Update a local copy of the PR:
$ git checkout pull/28688$ git pull https://git.openjdk.org/jdk.git pull/28688/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28688View PR using the GUI difftool:
$ git pr show -t 28688Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28688.diff
Using Webrev
Link to Webrev Comment