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

8275137: jdk.unsupported/sun.reflect.ReflectionFactory.readObjectNoDataForSerialization uses wrong signature #5951

Closed
wants to merge 1 commit into from

Conversation

FrauBoes
Copy link
Member

@FrauBoes FrauBoes commented Oct 14, 2021

sun.reflect.ReflectionFactory provides MethodHandles for the various serialization methods, it is a critical internal API in the jdk.unsupported module (see JEP 260 [1]) that may be used by 3rd party serialization libraries.

One of these serialization methods is readObjectNoData [2]:

private void readObjectNoData() throws ObjectStreamException;

The issue: The method that returns the matching handle, sun.reflect.ReflectionFactory.readObjectNoDataForSerialization, uses an erroneous signature readObjectNoData(ObjectInputStream) - note the superfluous parameter.

This change updates the specification and fixes the implementation in java.base/jdk.internal.reflect.ReflectionFactory.

Testing: tier 1-3

[1] https://openjdk.java.net/jeps/260
[2] https://docs.oracle.com/en/java/javase/15/docs/specs/serialization/input.html#the-readobjectnodata-method


Progress

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

Issue

  • JDK-8275137: jdk.unsupported/sun.reflect.ReflectionFactory.readObjectNoDataForSerialization uses wrong signature

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5951

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 14, 2021

👋 Welcome back jboes! 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.

@FrauBoes
Copy link
Member Author

@FrauBoes FrauBoes commented Oct 14, 2021

/csr needed

@openjdk openjdk bot added rfr csr labels Oct 14, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 14, 2021

@FrauBoes has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@FrauBoes please create a CSR request for issue JDK-8275137. This pull request cannot be integrated until the CSR request is approved.

@openjdk
Copy link

@openjdk openjdk bot commented Oct 14, 2021

@FrauBoes 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 label Oct 14, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 14, 2021

Webrevs

dfuch
dfuch approved these changes Oct 14, 2021
Copy link
Member

@dfuch dfuch left a comment

LGTM.
The update on the throws declaration in the test is a bit of a distraction.

@FrauBoes
Copy link
Member Author

@FrauBoes FrauBoes commented Oct 14, 2021

The update on the throws declaration in the test is a bit of a distraction.

Right, should have mentioned that the only relevant change in the test is on line 253, the rest is cleanup.

@openjdk openjdk bot removed the csr label Oct 22, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 22, 2021

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

8275137: jdk.unsupported/sun.reflect.ReflectionFactory.readObjectNoDataForSerialization uses wrong signature

Reviewed-by: dfuchs

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

  • 88bbf3c: 8273111: Default timezone should return zone ID if /etc/localtime is valid but not canonicalization on linux
  • 4dec8fc: 8275645: [JVMCI] avoid unaligned volatile reads on AArch64
  • 4e647aa: 8275416: G1: remove unnecessary make_referent_alive in precleaning phase
  • dd622e5: 8275783: G1: fix incorrect region type documentation in HeapRegionType
  • b2128a9: 8263155: Allow additional contents for DMG
  • 1efe946: 8275712: Hashtable literal_size functions are broken
  • fab3d6c: 8275761: Backout: JDK-8274794 Print all owned locks in hs_err file
  • c978ca8: 8275344: -Xcheck:jni produces some warnings in the LCMS.c
  • 6a466fe: 8202056: Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields
  • 4e9dd4b: 8275384: Change nested classes in jdk.jconsole to static nested classes
  • ... and 185 more: https://git.openjdk.java.net/jdk/compare/b60837a7d5d6f920d2fb968369564df155dc1018...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 label Oct 22, 2021
@FrauBoes
Copy link
Member Author

@FrauBoes FrauBoes commented Oct 26, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Oct 26, 2021

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

  • 174f553: 8275869: Problem list applications/jcstress/copy.java on Linux-aarch64
  • 3ff085e: 8275582: Don't purge metaspace mapping lists
  • 10e1610: 8251134: Unwrapping a key with a Private Key generated by Microsoft CNG fails
  • 4361945: 8185844: MSCAPI doesn't list aliases correctly
  • 337a9b7: 8269853: Prefetch::read should accept pointer to const
  • 97d3280: 8275536: Add test to check that File::lastModified returns same time stamp as Files.getLastModifiedTime
  • 89671aa: 8273712: C2: Add mechanism for rejecting inlining of low frequency call sites and deprecate MinInliningThreshold.
  • 3221a14: 8273678: TableAccessibility and TableRowAccessibility miss autorelease
  • 7cf68b1: 8202932: java/awt/Component/NativeInLightShow/NativeInLightShow.java fails
  • f610ef0: 8196440: Regression automated Test 'java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java' fails
  • ... and 205 more: https://git.openjdk.java.net/jdk/compare/b60837a7d5d6f920d2fb968369564df155dc1018...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 26, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Oct 26, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 26, 2021

@FrauBoes Pushed as commit 4961373.

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

@FrauBoes FrauBoes deleted the 8275137-rond branch Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs integrated
2 participants