RFR: 7903730: Enhance the agentvm to be tolerant to unexpected connection on the port the Agent listens on for handshake with the AgentServer [v3]

Jaikiran Pai jpai at openjdk.org
Fri Jun 7 11:36:46 UTC 2024


On Fri, 24 May 2024 18:32:37 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> just log the error and return null
>> 
>>            log("handshake failed - " + totalRead + " bytes received from " + s);
>>             return null;
>> 
>> assert is the equivalent of a programming wart
>
> I totally disagree: assert tells the reader the intention of the writer
> The writer says: I have designed my code so that this condition will always be true. So I assert here. 
> 
> If the assert fails, then it means there's a programming error and the code must be revisited.

I agree with Daniel about the useful of `assert`. I have updated the PR to use Daniel's suggested approach in that snippet.

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

PR Review Comment: https://git.openjdk.org/jtreg/pull/195#discussion_r1631071214


More information about the jtreg-dev mailing list