Egor Andreevich
Jul 30, 2017 · 1 min read

Thanks for a great read, that small program printing out the order of execution is super useful!

Just to point out that this is likely an oversight on the part of the ProgressBar designers, here’s a quote from Effective Java (copied from this StackOverflow answer):

Constructors must not invoke overridable methods, directly or indirectly. If you violate this rule, program failure will result. The superclass constructor runs before the subclass constructor, so the overriding method in the subclass will be invoked before the subclass constructor has run. If the overriding method depends on any initialization performed by the subclass constructor, the method will not behave as expected.

Not sure though whether it’s been reported before, or if there’s a chance it’s gonna be fixed in future, or at least made clear in the documentation.

    Egor Andreevich

    Written by

    Android at Square Cash