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

8319324: FFM: Reformat javadocs #16518

Closed
wants to merge 17 commits into from
Closed

Conversation

minborg
Copy link
Contributor

@minborg minborg commented Nov 6, 2023

This PR proposes to reformat all the JavaDocs for the FFM API. This would bring the FFM API docs more in line with the existing Java documentation (see below). Occasional drive-by fixes are also included in this PR (such as spelling and capitalization).

I am aware this PR will (if approved) make a significant mark in the change logs which is regrettable.

Background:

Older classes like Object and List have a maximum line length of 80 characters whereas newer classes like ScopedValue have a maximum line length of 90 characters.

The FFM API currently has javadoc lines that exceed 135 characters per line. It is also customary to use double spaces when starting a new sentence.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16518/head:pull/16518
$ git checkout pull/16518

Update a local copy of the PR:
$ git checkout pull/16518
$ git pull https://git.openjdk.org/jdk.git pull/16518/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16518

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16518.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 6, 2023

👋 Welcome back pminborg! 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 Nov 6, 2023
@openjdk
Copy link

openjdk bot commented Nov 6, 2023

@minborg The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Nov 6, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 6, 2023

* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
*/
boolean get(ValueLayout.OfBoolean layout, long offset);

/**
* Writes a boolean into this segment at the given offset, with the given layout.
*
* @param layout the layout of the region of memory to be written.
* @param offset offset in bytes (relative to this segment address) at which this access operation will occur.
* @param offset offset in bytes (relative to this segment address) at which this
Copy link
Contributor

Choose a reason for hiding this comment

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

The first @param (layout) here has been deleted?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not just here - happened elsewhere too

* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
* @throws UnsupportedOperationException if {@code value} is not a {@linkplain #isNative() native} segment
* @throws UnsupportedOperationException if this segment is
Copy link
Contributor

Choose a reason for hiding this comment

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

one UOE went missing

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

Generally looks good (I've been relying a lot on github diff annotations, so I hope those are accurate :-) ). There seem to be a couple of issues with deleted text.

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

You might also want to look into the MethodHandles XYZCoordinates combinators (as they have also been added as part of FFM). And, also, ModuleLayer::Controller::enableNativeAccess, Module::isNativeAccessEnabled and FileChannel::map(... Arena).

@JornVernee
Copy link
Member

JornVernee commented Nov 6, 2023

FWIW, I've been sticking to a soft 120 character limit per line when writing javadoc. Why should we use 90 columns specifically?

It is also customary to use double spaces when starting a new sentence.

I thought this was the exception rather than the rule, to be honest.

@minborg
Copy link
Contributor Author

minborg commented Nov 6, 2023

FWIW, I've been sticking to a soft 120 character limit per line when writing javadoc. Why should we use 90 columns specifically?

It is also customary to use double spaces when starting a new sentence.

I thought this was the exception rather than the rule, to be honest.

We should try to get some clarity on this. I've sampled a handful of prominent Java classes and they have the style as in this PR. If we can find support that other styles are to be preferred, I am happy to update accordingly.

@minborg
Copy link
Contributor Author

minborg commented Nov 6, 2023

You might also want to look into the MethodHandles XYZCoordinates combinators (as they have also been added as part of FFM). And, also, ModuleLayer::Controller::enableNativeAccess, Module::isNativeAccessEnabled and FileChannel::map(... Arena).

These are checked now. Only FileChannel needed a very small adjustment.

@openjdk
Copy link

openjdk bot commented Nov 6, 2023

@minborg this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout javadoc-reformat
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Nov 6, 2023
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Nov 6, 2023
Copy link
Contributor

@mcimadamore mcimadamore 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. I found some (few) sentences that still have a full stop in @param/@throws

Copy link
Contributor

@mcimadamore mcimadamore left a comment

Choose a reason for hiding this comment

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

Please create a specdiff between the old version and the version in this PR, so that we can take a look at the differences in the resulting javadoc, and make sure that nothing else got affected (by accident).

@minborg
Copy link
Contributor Author

minborg commented Nov 9, 2023

A specdiff is available here https://cr.openjdk.org/~pminborg/panama/22/specdiff-panamajavadocrework/package-summary.html

The specdiff is from this PR's latest commit (at the time of writing this message) and compares with ee57e73 which is a commit just before we started integrating a number of spec updates. This means the diff will include updates from other PRs including @JornVernee 's Linker improvements.

@@ -1931,7 +1931,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
* layout size.
*
* @param layout the layout of the region of memory to be read
* @param index a logical index, the offset in bytes (relative to this
* @param index a logical index denoting the offset in bytes (relative to this
Copy link
Contributor

Choose a reason for hiding this comment

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

apologies for sending you the wrong way. As a single sentence this doesn't make sense. I suggest the original text (e.g. before this PR) is restored.

@openjdk
Copy link

openjdk bot commented Nov 9, 2023

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

8319324: FFM: Reformat javadocs

Reviewed-by: mcimadamore

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

  • a3f1b33: 8319664: IGV always output on PhaseRemoveUseless
  • f57b78c: 8319726: Parallel GC: Re-use object in object-iterator
  • 4451a92: 8319748: [JVMCI] TestUseCompressedOopsFlagsWithUlimit.java crashes on libgraal
  • 7d8adfa: 8316746: Top of lock-stack does not match the unlocked object

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 Nov 9, 2023
@minborg
Copy link
Contributor Author

minborg commented Nov 9, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Nov 9, 2023

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

  • a3f1b33: 8319664: IGV always output on PhaseRemoveUseless
  • f57b78c: 8319726: Parallel GC: Re-use object in object-iterator
  • 4451a92: 8319748: [JVMCI] TestUseCompressedOopsFlagsWithUlimit.java crashes on libgraal
  • 7d8adfa: 8316746: Top of lock-stack does not match the unlocked object

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 9, 2023
@openjdk openjdk bot closed this Nov 9, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 9, 2023
@openjdk
Copy link

openjdk bot commented Nov 9, 2023

@minborg Pushed as commit f939542.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
3 participants