[hibernate-dev] Covariant returns

Gunnar Morling gunnar.morling at googlemail.com
Tue Mar 13 18:35:16 EDT 2012


Hi,

I see it the same way as you do; narrowing down the return type in the
implementation class shouldn't be a problem.

I'm also getting no compilation error when compiling the user's code
(as you said, IdentifierLoadAccessImpl shouldn't even be visible at
the call site). Maybe it's a problem with a certain
compiler/environment only?

--Gunnar


2012/3/13 Steve Ebersole <steve at hibernate.org>:
> Can someone verify I am not off my rocker here?  Re :
> https://hibernate.onjira.com/browse/HHH-7161
>
> We have a case where Session defines a method that returns a public
> interface org.hibernate.IdentifierLoadAccess.  When SessionImpl
> implements those methods it redefines the return to instead be a private
> inner class that implements that org.hibernate.IdentifierLoadAccess
> interface.
>
> As I understood it, when accessed through the Session interface what
> return type is defined by SessionImpl is irrelevant.  And indeed I am
> not able to reproduce this when access those methods via Session.  My
> IDE gives me errors if I try to cast that reference to SessionImpl
> instead.
>
> --
> steve at hibernate.org
> http://hibernate.org
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev




More information about the hibernate-dev mailing list