[hibernate-dev] [HSEARCH] Question on TikaBridge

Emmanuel Bernard emmanuel at hibernate.org
Thu Apr 3 02:52:37 EDT 2014


>>> Is that ok / preferable if I do these type checking at the bridge creation time - in the BridgeProvider.
>> 
>> Not sure. AS you say, the problem is if you define the type as Object. Probably quite uncommon.
> 
> I'd enforce it. If a getter guarantees to provide a refined type, it
> could as well make it explicit on the signature.
> There is no (sane) reason to refuse fixing the signature, if you know
> for sure what you're returning will be compatible. Worst case the
> implementor will need to explicitly downcast, but when the CCE strikes
> he'll easily see his mistake.
> 

Well my point was that a method returning Blob|String (in Ceylon speak) would always be valid. The only way to represent that in Java is to return Object. But that's probably a rare use case. 


More information about the hibernate-dev mailing list