On Tue, 25 Feb 2025 01:02:13 GMT, Alexey Semenyuk <asemen...@openjdk.org> wrote:
>> test/jdk/tools/jpackage/helpers-test/jdk/jpackage/test/TKitTest.java line >> 232: >> >>> 230: if ((expectedExceptionClass == null) == (expectedPath == >>> null)) { >>> 231: throw new IllegalArgumentException("Only one of >>> `expectedPath` and `expectedExceptionClass` can be null"); >>> 232: } >> >> This one is confusing. It will evaluate to true if both != null. Did you >> mean "&&" instead of "=="? > >> This one is confusing. It will evaluate to true if both != null > > Correct. They both shouldn't be `true`. One of them must be `true`, and > another one must be `false`. > >> Did you mean "&&" instead of "=="? > > No. I meant `==` :) If they both set to non-null value, then exception will be thrown since false == false. In this case exception message is confusing. Maybe change it to: `Only one of `expectedPath` and `expectedExceptionClass` should be set` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23754#discussion_r1968658398