You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jochen Kemnade (JIRA)" <ji...@apache.org> on 2014/05/27 09:20:09 UTC

[jira] [Updated] (TAP5-1493) Property expressions on properties that are covariant on a base class use the type of the base class property, not the covariant subclass

     [ https://issues.apache.org/jira/browse/TAP5-1493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jochen Kemnade updated TAP5-1493:
---------------------------------

    Labels: bulk-close-candidate  (was: )

This issue has been last updated about 1.5 years ago, has no assignee, affects an old version of Tapestry that is not actively developed anymore, and is therefore prone to be bulk-closed in the near future.

If the issue still persists with the most recent development preview of Tapestry (5.4-beta-6, which is available from Maven Central), please update it as soon as possible. In the case of a feature request, please discuss it with the Tapestry developer community on the dev@tapestry.apache.org mailing list first.


> Property expressions on properties that are covariant on a base class use the type of the base class property, not the covariant subclass
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1493
>                 URL: https://issues.apache.org/jira/browse/TAP5-1493
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core, tapestry-ioc
>    Affects Versions: 5.2
>            Reporter: Howard M. Lewis Ship
>            Priority: Critical
>              Labels: bulk-close-candidate
>
> public abstract class AbstractFoo
> {
>  public abstract AbstractBar getBar();
> }
> public class Foo extends AbstractFoo
> {
>  public Bar getBar();
> }
> Here property bar is covariant; the subclass (Foo) changes the type of the return value (from AbstractBar to just Bar). Assuming that Bar is a subclass of AbstractBar, that's fine.
> The bug is that in this circumstance, the PropertyConduitSource sees the type of
> property "bar" of class Foo as AbstractBar, not Bar.
> Interestingly, a little debugging showed that the getter method for property bar was "public AbstractBar Foo.getBar()" ... in other words, much like with Generics, covariant return types may be largely
> a fiction of the compiler inserting the necessary casts in place.



--
This message was sent by Atlassian JIRA
(v6.2#6252)