Skip to content

Don't allow descriptionless assertion statements in production code #68616

Closed
@mark-vieira

Description

@mark-vieira

We use assertions instead of exceptions in various places throughout the Elasticsearch code base. We should probably enforce a convention here being either a) explicitly disallow the use of assertions altogether (even though we force -ea) and use exceptions instead or b) require that a description message be provided with the assertion to avoid things like java.lang.AssertionError: null in our logs.

I haven't really looked into it but this seems like something we could enforce with checkstyle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions