| See org.hibernate.search.v6poc.entity.pojo.mapping.building.impl.PojoIndexModelBinderImpl#addValueBridge in particular: we just compare raw types, which might not be enough when a bridge is defined as something like ValueBridge<List<? extends Integer>, Integer> for example. A safer approach would be to use the TypePatternMatcherFactory to create a pattern from the type argument, and ask that pattern to check that the value we're passing to the bridge has a supported type. We wouldn't support everything, that's for sure, but at least we would get safety by default: we would fail when an unsupported type pattern is encountered. And we could improve in the future, adding new supported patterns. |