Skip to content

ErrorWindow constructor should not call overridable methods #44

@javier-godoy

Description

@javier-godoy

Calling an overridable method from a constructor could result in failures or strange behaviors when instantiating a subclass which overrides the method.

ErrorWindow constructor (indirectly) calls createStackTraceArea() (protected, non-final) through the following chain: initWindow() -> createMainLayout() -> createExceptionTraceLayout() -> createStackTraceArea()

Moreover, the current approach makes impossible to to extend ErrorWindow in a sane way, or configure an existing instance of ErrorWindow. In addition, O(2^n) constructors are required (since most parameters are deemed "optional").

Proposal: initialize the window on attach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions