-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
8264124: Update MXBean specification and implementation to extend mapping of CompositeType to records #3201
Closed
Closed
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bf8b437
8264124: Update MXBean specification and implementation to extend map…
dfuch 1c3292c
Fixed typo. Moved example with record after example with from method …
dfuch 8e5a70c
Integrated review feedback. Added a section for Mapping to records.
dfuch aaf7449
Integrated review feedback. Updated the section for Mapping to records.
dfuch 4b87469
Merge branch 'master' into mxbeans-8264124
dfuch 2a75f25
Minor tweaks. Improved test.
dfuch 5996513
Merge branch 'master' into mxbeans-8264124
dfuch 7d478de
Moved mapping for records just before Mapping for MXBean interface; I…
dfuch 6e6f9d3
Improved test
dfuch 9227ba5
Integrated review feedback
dfuch 44bbf21
minor style issue
dfuch a624a76
minor style issue
dfuch 257a6ed
Merge
dfuch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It may be good to add a link like {@linkplain RecordComponent record components}
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.
You add record in "Mappings for other types". I think it deserves a separate section "Mappings for record classes" (maybe after primitive types). It's useful to add a row for record in the summary table above "Mappings for primitive types"
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.
Link added. With respect to adding a section for records, it's a bit difficult to separate that from the "Mapping for other types" without a lot of duplication. I can add a row in the summary table, and then add a new section "Mapping for records" just before "Mapping for other types", that just gives a brief overview and refers to the mapping for other types below.
Something like this - what do you think?
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.
Hi Mandy, I have updated the PR with a revised version of the text above. Is that more in line what you had in mind?
best regards,
-- daniel
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 looks better. I like a separate mapping section for records since the mapping rules are straight-forward. The complexity comes if we want to support a record to implement
CompositeDataView
that allows a type to support more flexible conversion toCompositeData
which is why you add records in the "Mappings for other types". I am wondering if we really want to support records to implementCompositeDataView
but we may want to avoid such a special case.I suggest add subsections in "Mappings for other types": There are two mapping rules: (1) opentype(J) maps
J
toCompositeType
(2) opendata(J) mapsJ
toCompositeData
. opentype(J) for record class does not need to refer to other types. The common cases for opendata(J) for record class is using the canonical constructors. The other less common cases like using non-canonical constructors andCompositeDataView
can state that it follows the same rules as specified for other types. "Mappings for other types" does not need any change for records."Reconstructing an instance of Java type J from a CompositeData" section should be renamed to "Reconstructing an instance of Java type or record class J from a CompositeData"
Here is a minor tweaking on "Mappings for Records"
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 have updated the PR with those changes, plus a few minor adjustments.