Better handling of duplicate getters

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:

I don't think we can handle such a situation without an error, so throwing an exception is not a problem IMO. However, the exception message should be clearer and explain that it's a limitation, not a bug.

Ideally we should not throw this exception at all when the property is not used in the Hibernate Search mapping anyway, but that's easier said than done... Maybe we should allow more than two XProperties per property: instead of just field/method, we would have field/method1/method2/... . Then we could get annotations as usual, and would only get into trouble and throw an exception when trying to determine the type of the property, or its "ValueReadHandle". Which would not happen unless the property is actually used in the mapping.

Environment

None

Assignee

Unassigned

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure