"AssertionFailure: Unexpected duplicate key" when an entity has two getters for the same property

Description

It's technically possible to write a class with a duplicate getter, e.g.:

Currently, when Hibernate Search encounters such a property, it will throw a cryptic exception at bootstrap:

We should at least avoid the error when the property is not used in the Hibernate Search mapping, and probably just pick one of the getter and log a warning when the property is used.

Environment

None

Activity

Show:
lan zen
January 28, 2021, 5:57 AM

I also cause this failure

It’s message too simple and I found it very hard

Finally I find it’s problem, like this:

my pojo:

and org.hibernate.search.mapper.pojo.model.hcann.spi.AbstractPojoHCAnnBootstrapIntrospector#declaredFieldAccessXPropertiesByName

cause,

when I delete isValid method, It’s okay…

Fixed

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major