jmx-dev RFR: 8343378: Exceptions in javax/management DeadLockTest.java do not cause test failure
Chris Plummer
cjplummer at openjdk.org
Thu Oct 31 22:00:33 UTC 2024
On Thu, 31 Oct 2024 20:55:39 GMT, Kevin Walls <kevinw at openjdk.org> wrote:
>> test/jdk/javax/management/remote/mandatory/connection/DeadLockTest.java line 54:
>>
>>> 52: test(protocols[i]);
>>> 53: } catch (Exception e) {
>>> 54: fail = true; // any one protocol failure, fails the test
>>
>> Suggestion:
>>
>> fail = true; // any one protocol failure fails the test
>
> I actually think it's more readable with the comma.
> If there is (one protocol failure), then that (fails the test).
> Without the comma, "failure fails" runs together, but the failure did not fail, it was a perfectly good failure. Pause for breath. What do we do now? Well, experiencing that kind of problem, fails the test.
>
> Extended discussions on language style, from the test that brought you "listner" and "should no block". 8-)
The best way to get to the right answer here is simplify to the subject and verb: "failure fails". You don't put a comma between the subject and the verb, unless is something more much complex like "a failure, for which there can be more than one, fails the test". I think the reason you feel it reads better with the comma is because of the repetition of "fail". Would you still want a comma if the sentence was "any one protocol error fails the test"? I assume no, but the sentence is structurally identical.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21804#discussion_r1825216696
More information about the jmx-dev
mailing list