You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Robert Zeigler (JIRA)" <ji...@apache.org> on 2011/06/15 16:59:48 UTC

[jira] [Created] (TAP5-1548) Property expressions fails when using a supertype that implements an interface with a matching method

Property expressions fails when using a supertype that implements an interface with a matching method
-----------------------------------------------------------------------------------------------------

                 Key: TAP5-1548
                 URL: https://issues.apache.org/jira/browse/TAP5-1548
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.2.5
            Reporter: Robert Zeigler


Given:
public interface Baz { 
  String getBar();
}

public class AbstractFoo implements Baz {
  private String bar;
  public String getBar() { return bar; }
  public void setBar(String bar) { this.bar =bar; }
}

public class Foo extends AbstractFoo {}

public class AComponent {
  @Parameter
  @Property
  private AbstractFoo foo;
}

.tml:
  <t:form><t:textfield value="foo.bar"/></t:form>


The update of the textfield will fail with "Failure writing parameter 'value' of component Index:layout.acomponent.textfield: Expression 'foo.bar' for class org.apache.tapestry5.generics1.components.AComponent is read-only".

Note that if you:
  a) Specify Foo directly, it works
  b) Remove the "getFoo" from interface "Baz", it works
  c) add "setFoo" to the interface "Baz", it works.

I would expect Tapestry to find the property from the base class first.  In fact, it used to, in T5.1.0.4 at least, because I found this issue upgrading a project from 5.1.0.4 to 5.2.5 and a component that used to work broke.  In that case, the component was using generic types (public class AComponent<T extends AbstractFoo>), but the problem shows up with or without the generics.  

I can accept that if I specify the type of the property as "Baz", I will get the above exception even if I pass in a "Foo" or "AbstractFoo".  But using the (read-only) property from the Baz interface when I explicitly declare the property type to be AbstractFoo is unacceptable and a regression from previous behavior.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1548) Property expressions fails when using a supertype that implements an interface with a matching method

Posted by "Paul Stanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409138#comment-13409138 ] 

Paul Stanton commented on TAP5-1548:
------------------------------------

this just stung me, took a little while to figure out that adding the setter to the interface would resolve the issue.

please fix!
                
> Property expressions fails when using a supertype that implements an interface with a matching method
> -----------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1548
>                 URL: https://issues.apache.org/jira/browse/TAP5-1548
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2
>            Reporter: Robert Zeigler
>         Attachments: generics.bug1demo.tgz
>
>
> Given:
> public interface Baz { 
>   String getBar();
> }
> public class AbstractFoo implements Baz {
>   private String bar;
>   public String getBar() { return bar; }
>   public void setBar(String bar) { this.bar =bar; }
> }
> public class Foo extends AbstractFoo {}
> public class AComponent {
>   @Parameter
>   @Property
>   private AbstractFoo foo;
> }
> .tml:
>   <t:form><t:textfield value="foo.bar"/></t:form>
> The update of the textfield will fail with "Failure writing parameter 'value' of component Index:layout.acomponent.textfield: Expression 'foo.bar' for class org.apache.tapestry5.generics1.components.AComponent is read-only".
> Note that if you:
>   a) Specify Foo directly, it works
>   b) Remove the "getFoo" from interface "Baz", it works
>   c) add "setFoo" to the interface "Baz", it works.
> I would expect Tapestry to find the property from the base class first.  In fact, it used to, in T5.1.0.4 at least, because I found this issue upgrading a project from 5.1.0.4 to 5.2.5 and a component that used to work broke.  In that case, the component was using generic types (public class AComponent<T extends AbstractFoo>), but the problem shows up with or without the generics.  
> I can accept that if I specify the type of the property as "Baz", I will get the above exception even if I pass in a "Foo" or "AbstractFoo".  But using the (read-only) property from the Baz interface when I explicitly declare the property type to be AbstractFoo is unacceptable and a regression from previous behavior.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TAP5-1548) Property expressions fails when using a supertype that implements an interface with a matching method

Posted by "Robert Zeigler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Zeigler updated TAP5-1548:
---------------------------------

    Attachment: generics.bug1demo.tgz

Simple project that illustrates the bug. I originally thought this was related to generics support, hence the "generics" naming throughout.  But I found generics were not necessary to reproduce the problem.

> Property expressions fails when using a supertype that implements an interface with a matching method
> -----------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1548
>                 URL: https://issues.apache.org/jira/browse/TAP5-1548
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.5
>            Reporter: Robert Zeigler
>         Attachments: generics.bug1demo.tgz
>
>
> Given:
> public interface Baz { 
>   String getBar();
> }
> public class AbstractFoo implements Baz {
>   private String bar;
>   public String getBar() { return bar; }
>   public void setBar(String bar) { this.bar =bar; }
> }
> public class Foo extends AbstractFoo {}
> public class AComponent {
>   @Parameter
>   @Property
>   private AbstractFoo foo;
> }
> .tml:
>   <t:form><t:textfield value="foo.bar"/></t:form>
> The update of the textfield will fail with "Failure writing parameter 'value' of component Index:layout.acomponent.textfield: Expression 'foo.bar' for class org.apache.tapestry5.generics1.components.AComponent is read-only".
> Note that if you:
>   a) Specify Foo directly, it works
>   b) Remove the "getFoo" from interface "Baz", it works
>   c) add "setFoo" to the interface "Baz", it works.
> I would expect Tapestry to find the property from the base class first.  In fact, it used to, in T5.1.0.4 at least, because I found this issue upgrading a project from 5.1.0.4 to 5.2.5 and a component that used to work broke.  In that case, the component was using generic types (public class AComponent<T extends AbstractFoo>), but the problem shows up with or without the generics.  
> I can accept that if I specify the type of the property as "Baz", I will get the above exception even if I pass in a "Foo" or "AbstractFoo".  But using the (read-only) property from the Baz interface when I explicitly declare the property type to be AbstractFoo is unacceptable and a regression from previous behavior.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1548) Property expressions fails when using a supertype that implements an interface with a matching method

Posted by "Paul Stanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409138#comment-13409138 ] 

Paul Stanton commented on TAP5-1548:
------------------------------------

this just stung me, took a little while to figure out that adding the setter to the interface would resolve the issue.

please fix!
                
> Property expressions fails when using a supertype that implements an interface with a matching method
> -----------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1548
>                 URL: https://issues.apache.org/jira/browse/TAP5-1548
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2
>            Reporter: Robert Zeigler
>         Attachments: generics.bug1demo.tgz
>
>
> Given:
> public interface Baz { 
>   String getBar();
> }
> public class AbstractFoo implements Baz {
>   private String bar;
>   public String getBar() { return bar; }
>   public void setBar(String bar) { this.bar =bar; }
> }
> public class Foo extends AbstractFoo {}
> public class AComponent {
>   @Parameter
>   @Property
>   private AbstractFoo foo;
> }
> .tml:
>   <t:form><t:textfield value="foo.bar"/></t:form>
> The update of the textfield will fail with "Failure writing parameter 'value' of component Index:layout.acomponent.textfield: Expression 'foo.bar' for class org.apache.tapestry5.generics1.components.AComponent is read-only".
> Note that if you:
>   a) Specify Foo directly, it works
>   b) Remove the "getFoo" from interface "Baz", it works
>   c) add "setFoo" to the interface "Baz", it works.
> I would expect Tapestry to find the property from the base class first.  In fact, it used to, in T5.1.0.4 at least, because I found this issue upgrading a project from 5.1.0.4 to 5.2.5 and a component that used to work broke.  In that case, the component was using generic types (public class AComponent<T extends AbstractFoo>), but the problem shows up with or without the generics.  
> I can accept that if I specify the type of the property as "Baz", I will get the above exception even if I pass in a "Foo" or "AbstractFoo".  But using the (read-only) property from the Baz interface when I explicitly declare the property type to be AbstractFoo is unacceptable and a regression from previous behavior.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (TAP5-1548) Property expressions fails when using a supertype that implements an interface with a matching method

Posted by "Robert Zeigler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Zeigler updated TAP5-1548:
---------------------------------

    Attachment: generics.bug1demo.tgz

Simple project that illustrates the bug. I originally thought this was related to generics support, hence the "generics" naming throughout.  But I found generics were not necessary to reproduce the problem.

> Property expressions fails when using a supertype that implements an interface with a matching method
> -----------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1548
>                 URL: https://issues.apache.org/jira/browse/TAP5-1548
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.5
>            Reporter: Robert Zeigler
>         Attachments: generics.bug1demo.tgz
>
>
> Given:
> public interface Baz { 
>   String getBar();
> }
> public class AbstractFoo implements Baz {
>   private String bar;
>   public String getBar() { return bar; }
>   public void setBar(String bar) { this.bar =bar; }
> }
> public class Foo extends AbstractFoo {}
> public class AComponent {
>   @Parameter
>   @Property
>   private AbstractFoo foo;
> }
> .tml:
>   <t:form><t:textfield value="foo.bar"/></t:form>
> The update of the textfield will fail with "Failure writing parameter 'value' of component Index:layout.acomponent.textfield: Expression 'foo.bar' for class org.apache.tapestry5.generics1.components.AComponent is read-only".
> Note that if you:
>   a) Specify Foo directly, it works
>   b) Remove the "getFoo" from interface "Baz", it works
>   c) add "setFoo" to the interface "Baz", it works.
> I would expect Tapestry to find the property from the base class first.  In fact, it used to, in T5.1.0.4 at least, because I found this issue upgrading a project from 5.1.0.4 to 5.2.5 and a component that used to work broke.  In that case, the component was using generic types (public class AComponent<T extends AbstractFoo>), but the problem shows up with or without the generics.  
> I can accept that if I specify the type of the property as "Baz", I will get the above exception even if I pass in a "Foo" or "AbstractFoo".  But using the (read-only) property from the Baz interface when I explicitly declare the property type to be AbstractFoo is unacceptable and a regression from previous behavior.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira