Skip to content

Conversation

liach
Copy link
Member

@liach liach commented Feb 25, 2025

Core reflection's generic signature parsing system is used for many aspects, including annotations and enclosing methods, yet it is under-tested. It is better for us to set up tests to ensure that sensitive error behaviors of core reflection remain the same across implementation updates, such as #19281.

This patch also includes a JUnit converted version of #22581 (comment) test checking behavior around annotations with duplicate interfaces. Interesting that this causes failure in class, field, and methods (constructors), but not in parameters.

Testing: jdk-tier 1, jdk-tier 2


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

  • JDK-8350704: Create tests to ensure the failure behavior of core reflection APIs (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23788

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 25, 2025

👋 Welcome back liach! 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
Copy link

openjdk bot commented Feb 25, 2025

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

8350704: Create tests to ensure the failure behavior of core reflection APIs

Reviewed-by: darcy

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

  • afcad8c: 5043343: FileImageInputStream and FileImageOutputStream do not properly track streamPos for RandomAccessFile
  • 6891490: 8353324: Clean up of comments and import after 8319192
  • 07fd666: 8342984: Bump minimum boot jdk to JDK 24
  • 6a46d55: 8353129: CDS ArchiveRelocation tests fail after JDK-8325132
  • 19eabaf: 8353227: JFR: Prepare tests for strong parser validation
  • 564066d: 8353118: Deprecate the use of java.locale.useOldISOCodes system property
  • a1ab1d8: 8353449: [BACKOUT] One instance of STATIC_LIB_CFLAGS was missed in JDK-8345683
  • 2a31f69: 8353331: Test ForkJoinPool20Test::testFixedDelaySequence is failing
  • 1809138: 8352284: EXTRA_CFLAGS incorrectly applied to BUILD_LIBJVM src/hotspot C++ source files
  • cef5610: 8353272: One instance of STATIC_LIB_CFLAGS was missed in JDK-8345683
  • ... and 130 more: https://git.openjdk.org/jdk/compare/6e6a39d35fda929300c7668fdf5d2f0fbfed0606...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 rfr Pull request is ready for review label Feb 25, 2025
@openjdk
Copy link

openjdk bot commented Feb 25, 2025

@liach 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.

@mlbridge
Copy link

mlbridge bot commented Feb 25, 2025

Webrevs

@jddarcy
Copy link
Member

jddarcy commented Mar 24, 2025

The code of the tests look fine and of it itself; however, I think the test files should get some more comments describing in more details what and how the test is checking what it is testing.

@liach
Copy link
Member Author

liach commented Mar 24, 2025

Added comments and reran "jdk/java/lang/Class jdk/java/lang/annotation jdk/java/lang/reflect/Generics" tests.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 1, 2025
@liach
Copy link
Member Author

liach commented Apr 4, 2025

Thanks for the reviews!

/integrate

@openjdk
Copy link

openjdk bot commented Apr 4, 2025

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

  • 57df89c: 8353684: [BACKOUT] j.u.l.Handler classes create deadlock risk via synchronized publish() method
  • ebcb9a8: 8349206: j.u.l.Handler classes create deadlock risk via synchronized publish() method
  • d894b78: 8353588: [REDO] DaCapo xalan performance with -XX:+UseObjectMonitorTable
  • db08726: 8352966: Opensource Several Font related tests - Batch 2
  • 6b7b324: 8351431: Type annotations on new class creation expressions can't be retrieved
  • 64b691a: 8271870: G1: Add objArray splitting when scanning object with evacuation failure
  • b428cda: 8349686: [s390x] C1: Improve Class.isInstance intrinsic
  • 70e3250: 8352419: Test tools/jpackage/share/ErrorTest.java#id0 and #id1 fail
  • 296d9d6: 8353345: C2 asserts because maskShiftAmount modifies node without deleting the hash
  • 3ceabf0: 8353359: C2: Or(I|L)Node::Ideal is missing AddNode::Ideal call
  • ... and 172 more: https://git.openjdk.org/jdk/compare/6e6a39d35fda929300c7668fdf5d2f0fbfed0606...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 4, 2025

@liach Pushed as commit a449aee.

💡 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 [email protected] integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants