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

8277093: Vector should throw ClassNotFoundException for a missing class of an element #279

Closed
wants to merge 2 commits into from

Conversation

RogerRiggs
Copy link
Contributor

@RogerRiggs RogerRiggs commented Nov 17, 2021

Java.util.Vector reports a StreamCorruptedException instead of ClassNotFoundException due to the incorrect handling of a missing class by ObjectInputStream.GetField.get(name, val). (See JDK-8273660)

Vector checks the deserialized 'data' field for null and throws StreamCorruptedException.
The null can be a reflection of more than one condition, including the field is null, the field is not present in the stream, and the field is null because one of the array elements could not be deserialized due to a missing class.

The CSR includes a detailed description: JDK-8277153

This fix is targeted at JDK 17 and earlier versions.
For the JDK project (current) the underlying API and behavior is corrected to correctly throw and handle the ClassNotFoundException.
See JDK-8276665: ObjectInputStream.GetField.get(name, object) should throw ClassNotFoundException


Progress

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

Issue

  • JDK-8277093: Vector should throw ClassNotFoundException for a missing class of an element

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 279

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

Using diff file

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

…f an element

Check for special case of GetField.get and correct exception thrown to ClassNotFoundException
@RogerRiggs
Copy link
Contributor Author

RogerRiggs commented Nov 17, 2021

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 17, 2021

👋 Welcome back rriggs! 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 rfr Pull request is ready for review csr Pull request needs approved CSR before integration labels Nov 17, 2021
@openjdk
Copy link

openjdk bot commented Nov 17, 2021

@RogerRiggs this pull request will not be integrated until the CSR request JDK-8277153 for issue JDK-8277093 has been approved.

@mlbridge
Copy link

mlbridge bot commented Nov 17, 2021

Webrevs

@RogerRiggs RogerRiggs changed the title 8277093: Vector throws StreamCorruptedException for a missing class of an element 8277093: Vector should throw ClassNotFoundException for a missing class of an element Nov 17, 2021
@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Nov 22, 2021
@openjdk
Copy link

openjdk bot commented Nov 22, 2021

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

8277093: Vector should throw ClassNotFoundException for a missing class of an element

Reviewed-by: smarks

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

  • 716eeb0: 8275226: Shenandoah: Relax memory constraint for worker claiming tasks/ranges
  • 01a9e63: 8276864: Update boot JDKs to 17.0.1 in GHA
  • 66c051a: 8275426: PretouchTask num_chunks calculation can overflow
  • 2d69b2d: 8277224: sun.security.pkcs.PKCS9Attributes.toString() throws NPE
  • 6aa02d7: 8275703: System.loadLibrary fails on Big Sur for libraries hidden from filesystem
  • 38db452: 8272170: Missing memory barrier when checking active state for regions
  • acecce5: 8276801: gc/stress/CriticalNativeStress.java fails intermittently with Shenandoah
  • 19201da: 8276905: Use appropriate macosx_version_minimum value while compiling metal shaders
  • 55f8d8c: 8271308: (fc) FileChannel.transferTo() transfers no more than Integer.MAX_VALUE bytes in one call
  • fdcc3f1: 8233020: (fs) UnixFileSystemProvider should use StaticProperty.userDir().
  • ... and 9 more: https://git.openjdk.java.net/jdk17u/compare/f1a8a22f54438ede20d73297b19b9f95cfc3ad21...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 Nov 22, 2021
@RogerRiggs
Copy link
Contributor Author

RogerRiggs commented Nov 23, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Nov 23, 2021

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

  • ed45df2: 8277212: GC accidentally cleans valid megamorphic vtable inline caches
  • c47e233: 8140241: (fc) Data transfer from FileChannel to itself causes hang in case of overlap
  • 9be7550: 8272095: ProblemList java/nio/channels/FileChannel/Transfer2GPlus.java on linux-aarch64
  • d2d734c: 8276927: [ppc64] Port shenandoahgc to linux on ppc64le
  • dc7216a: 8275811: Incorrect instance to dispose
  • 6f2bdc0: 8274736: Concurrent read/close of SSLSockets causes SSLSessions to be invalidated unnecessarily
  • d998761: 8276139: TestJpsHostName.java not reliable, better to expand HostIdentifierCreate.java test
  • 7ffac79: 8277195: missing CAccessibility definition in [CommonComponentAccessibility accessibilityHitTest]
  • 03ef5a9: 8273235: tools/launcher/HelpFlagsTest.java Fails on Windows 32bit
  • 562cb4a: 8274942: AssertionError at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
  • ... and 19 more: https://git.openjdk.java.net/jdk17u/compare/f1a8a22f54438ede20d73297b19b9f95cfc3ad21...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 23, 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 Nov 23, 2021
@openjdk
Copy link

openjdk bot commented Nov 23, 2021

@RogerRiggs Pushed as commit 8571633.

💡 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
integrated Pull request has been integrated
2 participants