Skip to content

MappingContextTypeInformationMapper: No initialization and verification performed on construction [DATACMNS-1627] #2054

Open
@spring-projects-issues

Description

@spring-projects-issues

shimikano opened DATACMNS-1627 and commented

While debugging some issues with type aliases, we noticed that MappingContextTypeInformationMapper is not actually initialized with the aliases of the PersistentEntities in the MappingContext given to the constructor:

public MappingContextTypeInformationMapper(MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) {
  Assert.notNull(mappingContext, "MappingContext must not be null!");

  this.typeMap = new ConcurrentHashMap<>();
  this.mappingContext = mappingContext;

  for (PersistentEntity<?, ?> entity : mappingContext.getPersistentEntities()) {
    verify(entity.getTypeInformation().getRawTypeInformation(), entity.getTypeAlias());
  }
}

verify(), contradictory to its javadoc, does not modify this.typeMap. Hence, neither verification nor initialization of the map is actually done.

Is this intended or am I missing something?


Affects: 2.2.2 (Moore SR2)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions