RFR: 8256154: Some TestNG tests require default constructors

Daniel Fuchs dfuchs at openjdk.java.net
Fri Nov 20 18:14:06 UTC 2020


On Fri, 20 Nov 2020 09:37:19 GMT, Conor Cleary <ccleary at openjdk.org> wrote:

>> Ah, missed the final on depth :-)
>
> Any particular strengths associated with `this(0)` as opposed to the actual assignment? Aside from the brevity it provides of course. Happy to modify the PR to include it

My personal preference is to chain constructors whenever possible, ideally ending up in a single constructor that all other constructors call. This way the initialization logic is in a single place - instead of being duplicated all over.

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

PR: https://git.openjdk.java.net/jdk/pull/1317


More information about the core-libs-dev mailing list