RFR: 8301756: Missed constructor from 8301659 [v2]

Julian Waters jwaters at openjdk.org
Tue Feb 7 13:52:49 UTC 2023


On Tue, 7 Feb 2023 04:08:09 GMT, Phil Race <prr at openjdk.org> wrote:

> How did you miss this ?

Oversight, my mistake, it happens sometimes



> Bigger question, why is it important ?

Code quality, constructors in C++ should generally have the initializer list in the same order as their declaration. It helps deduce class layout and initialization order at a quick glance when reviewing code with the constructor in an implementation file away from the class itself, as is the case here, ignoring everything about gcc (You could very easily disable the warning on this file in Awt2dLibraries and be done with it instead if you really wanted to anyway, but I don't think it's good to do that). Common pitfalls in C++ should really be avoided when it comes to JDK code as a whole (consistency is also another reason), or at least that's my opinion. Convention within the JDK has largely been to initialize class members in the correct order too, which is what this patch intends to help with



> ...no one is going to care if it breaks and no one is going to put any effort into making sure it works at all.

[What makes you](https://bugs.openjdk.org/browse/JDK-8288293) [so sure](https://github.com/TheShermanTanker/jdk/tree/compiler)?

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

PR: https://git.openjdk.org/jdk/pull/12405



More information about the client-libs-dev mailing list