Skip to content

Do not re-validate messages with validate() already called with no errors #50

@alexander-yevsyukov

Description

@alexander-yevsyukov

... since Messages are immutable.

We use runtime validate in some framework places. For example, CommandFactory validates incoming command messages when producing commands.

This:

  1. It causes some side effects like warnings on command ID fields of primitive integer types.
  2. Is unnecessary if the message was already validated.

Implementation details

In order to address this we should update code generation introducing a new field which would keep the state of the call to validate(FieldPath parentPath, @Nullable TypeName parentName) to which validate() delegates. The overload with parameters does the real job on validation, and it's the one we generate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions