Skip to content

[Proposal] Use unboxed boolean types in ResourceHandlerRequest #341

@osdrv

Description

@osdrv

There are 2 recent changes that landed in ResourceHandlerRequest: ebca1dc#diff-adfb207dac8dff5107b68b36280ccad4525f92176184ad2ffff9aa7e591b2e8a and e34f047#diff-adfb207dac8dff5107b68b36280ccad4525f92176184ad2ffff9aa7e591b2e8a.

Both changes favor boxed Boolean over primitive types.

As a result, the usage of this class implies on importing BooleanUtils or a similar helper in order to avoid constructions like: if (request.getSnapshotRequested() != null && request.getSnapshotRequested() == true) { ... }.

And the code that is performing a "naive" boolean comparison like: if (request.getSnapshotRequested()) { ... } will fail with a null-pointer exception.

The same stands for the rollback flag.

I wonder if var type boxing was done for some specific reasons? If there are no strict reasons, I would vote for unboxing them to simplify condition checking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions