Implementations of {{LuceneWork}} (which are API) expect a parameter of type {{IndexedTypeIdentifier}} (which is SPI) , but they in their constructor. This is already wrong. But there is worse: users cannot cannot create instances of it {{IndexedTypeIdentifier}} , because instances are created through {{org.hibernate.search.spi.impl.PojoIndexedTypeIdentifier#convertFromLegacy}}, which is internal code.
There is definitely something wrong here, but fixing the design issue is probably not worth it: we'd need to break SPIs, maybe APIs, and we would probably remove this concept in 6 anyway (because the internals of the Lucene/Elasticsearch integration no longer deal with types, only with indexes).
However, we need to adress the issue of breaking APIs when we introduced the change in 5.8.
Our choices:
* Add back the older versions of the constructors, to restore API compatibility * OR make {{org.hibernate.search.spi.impl.PojoIndexedTypeIdentifier#convertFromLegacy}} API. The API break will still be there, but at least people will be able to use the APIs without relying on internal types. |
|