More explicit failure message when two types target the same index

Description

Currently we may throw an exception because the same field ("name") is declared twice. It's not immediately obvious that the cause is that two types target the same index and that it's forbidden to do so.

We should:

  1. add a test for this configuration error (in org.hibernate.search.integrationtest.mapper.pojo.mapping.definition.IndexedBaseIT, maybe?)

  2. add a check in org.hibernate.search.engine.common.impl.IndexManagerBuildingStateHolder.BackendInitialBuildState#getIndexManagerBuildingState that throws an exception if state already exists, but its mappedTypeName doesn't match the method argument. (feel free to add a private field to remember the initial mappedTypeName in IndexManagerInitialBuildState).

Environment

None

Assignee

Fabio Massimo Ercoli

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure