RFR: 8373661: Add edge case tests for Objects.requireNonNull methods [v5]

eunbin son duke at openjdk.org
Sun Dec 21 22:35:54 UTC 2025


On Fri, 19 Dec 2025 16:58:33 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> eunbin son has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8373661: Address code style feedback
>>   
>>   - Expanded wildcard imports to individual imports
>>   - Simplified test messages to identify tests only
>>   - Used Assertions.fail() where appropriate
>>   - Kept assertTrue/assertFalse for isNull API tests
>>   
>>   Thanks to @RogerRiggs and @liach for the feedback.
>
> Comment on the description contents and formatting:
> Skara (the automation for OpenJDK PRs) adds its own content (using Markdown) at the end to document the progress and steps.
> The final bit of `preformatted` text in the description does not seem to be closed properly so the Skara comment shows up as raw Markdown.

Thank you for your feedback, @RogerRiggs and @liach.

I’ve reviewed all comments again and addressed each item as listed below:
	•	✅ JUnit conversion (@RogerRiggs): Converted to JUnit format with @Test annotations and the @run junit directive; removed the main() method.
	•	✅ Wildcard imports (@RogerRiggs): Replaced wildcard imports with explicit individual imports.
	•	✅ Test message simplification (@RogerRiggs): All test messages now use method names only.
	•	✅ Exception message tests removal (@liach): Removed all exception message assertions; tests now verify only the exception types using assertThrows.
	•	✅ Copyright year update (@RogerRiggs): Updated the copyright header to include 2025.
	•	✅ Verbose comments removal (@liach): Removed unnecessary Javadoc and inline comments from the newly added test methods.
	•	✅ Exception instance verification (@liach): Updated testRequireNonNullWithSupplierThrowingException to allocate the exception outside the lambda and use assertSame to verify that the same instance is thrown.

All changes are included in the latest commit(s).
If I missed anything, please let me know and I’ll be happy to address it.
Please review when you have a chance.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28845#issuecomment-3679628190


More information about the core-libs-dev mailing list