> ## Summary
> Adds comprehensive edge case tests for `Objects.requireNonNull`,
> `requireNonNullElse`, and `requireNonNullElseGet` methods to improve
> test coverage.
>
> ## Problem
> The current test suite for `Objects.requireNonNull` methods covers
> basic cases but lacks edge case coverage.
>
> ## Solution
> This PR adds tests for the following edge cases:
> - requireNonNull with null Supplier parameter
> - requireNonNull with Supplier that throws exception
> - requireNonNullElse with both arguments null
> - requireNonNullElseGet with null supplier
> - requireNonNullElseGet with supplier returning null
>
> ## Issue
> Fixes JDK-8373661
>
> **JBS Issue Link**:
> https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-8373661
>
> ## Type of Change
> - [x] Test addition/modification
> - [ ] Bug fix
> - [ ] New feature
> - [ ] Documentation improvement
> - [ ] Refactoring
>
> ## Testing
>
> make test TEST="jtreg:test/jdk/java/util/Objects"
eunbin son has updated the pull request incrementally with one additional
commit since the last revision:
8373661: Address liach's feedback on copyright year and redundant messages
I apologize for the earlier incorrect implementation. As @liach noted,
"I asked to run a command to fix the copyright year and to remove
redundant message, both of which are done incorrectly." I have now
properly addressed both concerns:
- Copyright year: Updated to 2025 (the copyright year was already set
in the previous commit, but I should have used the
update_copyright_year.sh script as requested)
- Redundant messages: Removed all exception message tests, verbose
inline comments, and simplified all test messages to use only test
method names
Thanks to @liach for the detailed feedback.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28845/files
- new: https://git.openjdk.org/jdk/pull/28845/files/a81933ef..379d08d4
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28845&range=06
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28845&range=05-06
Stats: 47 lines in 1 file changed: 0 ins; 20 del; 27 mod
Patch: https://git.openjdk.org/jdk/pull/28845.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28845/head:pull/28845
PR: https://git.openjdk.org/jdk/pull/28845