tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "I D (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (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
Date Sat, 02 Apr 2011 03:11:05 GMT

    [ https://issues.apache.org/jira/browse/TAP5-1493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014938#comment-13014938
] 

I D commented on TAP5-1493:
---------------------------

This issue does not arise with JVM 6u24 running on Win7x64. Which version JVM are you running?

> 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.3.0, 5.2.5
>            Reporter: Howard M. Lewis Ship
>            Priority: Critical
>
> 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 is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message