Skip to content

Misleading AggregateReference.getId() @Nullable annotation #2104

@chrshnv

Description

@chrshnv

When I work with AggregateReference I get Intellij warning “Argument ‘entity.getMachine().getId()’ might be null ”.
Looking through the AggregateReference code I do find the Nullable annotation on the getId method, but at the same time in the code of the only implementation there is an explicit assert that the passed id cannot be null.

public IdOnlyAggregateReference(ID id) {
            Assert.notNull(id, "Id must not be null");
            this.id = id;
 }

I think the Nullable annotation should be removed from the getId method.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions