[jira] [Commented] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type

2019-01-16 Thread Hudson (JIRA)


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

Hudson commented on TAP5-2032:
--

FAILURE: Integrated in Jenkins build tapestry-trunk-freestyle-java-9 #16 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle-java-9/16/])
TAP5-2560: fixing JavaDoc errors and adding one test for TAP5-2032 (thiago: rev 
a02bf98bcaa57e471ea472a53e2f4ee08d152676)
* (edit) 
commons/src/main/java/org/apache/tapestry5/services/GenericsResolver.java
* (edit) 
genericsresolver-guava/src/test/java/org/apache/tapestry5/internal/genericsresolverguava/AbstractBeanModelSourceImplTest.java


> GenericsUtils does not handle generics properly when extracting the actual 
> type
> ---
>
> Key: TAP5-2032
> URL: https://issues.apache.org/jira/browse/TAP5-2032
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-ioc
>Affects Versions: 5.3.6, 5.5.0, 5.4.3
>Reporter: DI Florian Hackenberger
>Assignee: Thiago H. de Paula Figueiredo
>Priority: Major
>  Labels: desired_for_5.5
>
> We have the following interfaces / classes
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo {
>   PersonRole getRole();
>   void setRole(PersonRole role);
> }
> public interface IEntityAssociationWithInfo {
>   P getParent();
>   void setParent(P parent);
>   C getChild();
>   void setChild(C child);
> }
> public class Person implements Serializable {
>   
>   String name;
>   public String getName() {
>   return name;
>   }
> }
> {code}
> and the page:
> {code:java}
> public class EditPersonsWithRoles {
>   @Property(write=false) IPersonWithRoleAssociation personWithRole;
> }
> {code}
> and the template snippet:
> {code:html}
> 
> {code}
> Leads to the following exception:
> {noformat}
> Exception generating conduit for expression 'personWithRole.child.name': ...
> ...
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:388)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:128)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractActualType(GenericsUtils.java:74)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.buildGetterMethodAccessTerm(PropertyConduitSourceImpl.java:1119)
>  ~[tapestry-core-5.3.6.jar:na]
> {noformat}
> At GenericsUtils.java:388 we have:
> {code:java}
> resolved = ((ParameterizedType) t).getActualTypeArguments()[i];
> {code}
> where:
> {code:java}
> i = 1
> resolved = C
> ((ParameterizedType) t).getActualTypeArguments() = 
> [org.topfive.entities.IPersonWithRoleAssociation]
> {code}
> so the problem seems to be that the code assumes that it can find the type 
> information for C as the second generic parameter for 
> IPersonWithRoleAssociation, when in fact is is the second generic parameter 
> for the superclass IEntityAssociationWithInfo which 
> IPersonWithRoleAssociation extends and passes C explicitly (Person). 
> Everything is fine, if I use a marker interface for Person (IPerson) and 
> declare:
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type

2019-01-16 Thread Hudson (JIRA)


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

Hudson commented on TAP5-2032:
--

FAILURE: Integrated in Jenkins build tapestry-trunk-freestyle #1730 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1730/])
TAP5-2560: fixing JavaDoc errors and adding one test for TAP5-2032 (thiago: rev 
a02bf98bcaa57e471ea472a53e2f4ee08d152676)
* (edit) 
genericsresolver-guava/src/test/java/org/apache/tapestry5/internal/genericsresolverguava/AbstractBeanModelSourceImplTest.java
* (edit) 
commons/src/main/java/org/apache/tapestry5/services/GenericsResolver.java


> GenericsUtils does not handle generics properly when extracting the actual 
> type
> ---
>
> Key: TAP5-2032
> URL: https://issues.apache.org/jira/browse/TAP5-2032
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-ioc
>Affects Versions: 5.3.6, 5.5.0, 5.4.3
>Reporter: DI Florian Hackenberger
>Assignee: Thiago H. de Paula Figueiredo
>Priority: Major
>  Labels: desired_for_5.5
>
> We have the following interfaces / classes
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo {
>   PersonRole getRole();
>   void setRole(PersonRole role);
> }
> public interface IEntityAssociationWithInfo {
>   P getParent();
>   void setParent(P parent);
>   C getChild();
>   void setChild(C child);
> }
> public class Person implements Serializable {
>   
>   String name;
>   public String getName() {
>   return name;
>   }
> }
> {code}
> and the page:
> {code:java}
> public class EditPersonsWithRoles {
>   @Property(write=false) IPersonWithRoleAssociation personWithRole;
> }
> {code}
> and the template snippet:
> {code:html}
> 
> {code}
> Leads to the following exception:
> {noformat}
> Exception generating conduit for expression 'personWithRole.child.name': ...
> ...
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:388)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:128)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractActualType(GenericsUtils.java:74)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.buildGetterMethodAccessTerm(PropertyConduitSourceImpl.java:1119)
>  ~[tapestry-core-5.3.6.jar:na]
> {noformat}
> At GenericsUtils.java:388 we have:
> {code:java}
> resolved = ((ParameterizedType) t).getActualTypeArguments()[i];
> {code}
> where:
> {code:java}
> i = 1
> resolved = C
> ((ParameterizedType) t).getActualTypeArguments() = 
> [org.topfive.entities.IPersonWithRoleAssociation]
> {code}
> so the problem seems to be that the code assumes that it can find the type 
> information for C as the second generic parameter for 
> IPersonWithRoleAssociation, when in fact is is the second generic parameter 
> for the superclass IEntityAssociationWithInfo which 
> IPersonWithRoleAssociation extends and passes C explicitly (Person). 
> Everything is fine, if I use a marker interface for Person (IPerson) and 
> declare:
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type

2019-01-16 Thread ASF subversion and git services (JIRA)


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

ASF subversion and git services commented on TAP5-2032:
---

Commit a02bf98bcaa57e471ea472a53e2f4ee08d152676 in tapestry-5's branch 
refs/heads/master from Thiago H. de Paula Figueiredo
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=a02bf98 ]

TAP5-2560: fixing JavaDoc errors and adding one test for TAP5-2032

> GenericsUtils does not handle generics properly when extracting the actual 
> type
> ---
>
> Key: TAP5-2032
> URL: https://issues.apache.org/jira/browse/TAP5-2032
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-ioc
>Affects Versions: 5.3.6, 5.5.0, 5.4.3
>Reporter: DI Florian Hackenberger
>Assignee: Thiago H. de Paula Figueiredo
>Priority: Major
>  Labels: desired_for_5.5
>
> We have the following interfaces / classes
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo {
>   PersonRole getRole();
>   void setRole(PersonRole role);
> }
> public interface IEntityAssociationWithInfo {
>   P getParent();
>   void setParent(P parent);
>   C getChild();
>   void setChild(C child);
> }
> public class Person implements Serializable {
>   
>   String name;
>   public String getName() {
>   return name;
>   }
> }
> {code}
> and the page:
> {code:java}
> public class EditPersonsWithRoles {
>   @Property(write=false) IPersonWithRoleAssociation personWithRole;
> }
> {code}
> and the template snippet:
> {code:html}
> 
> {code}
> Leads to the following exception:
> {noformat}
> Exception generating conduit for expression 'personWithRole.child.name': ...
> ...
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:388)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:128)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractActualType(GenericsUtils.java:74)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.buildGetterMethodAccessTerm(PropertyConduitSourceImpl.java:1119)
>  ~[tapestry-core-5.3.6.jar:na]
> {noformat}
> At GenericsUtils.java:388 we have:
> {code:java}
> resolved = ((ParameterizedType) t).getActualTypeArguments()[i];
> {code}
> where:
> {code:java}
> i = 1
> resolved = C
> ((ParameterizedType) t).getActualTypeArguments() = 
> [org.topfive.entities.IPersonWithRoleAssociation]
> {code}
> so the problem seems to be that the code assumes that it can find the type 
> information for C as the second generic parameter for 
> IPersonWithRoleAssociation, when in fact is is the second generic parameter 
> for the superclass IEntityAssociationWithInfo which 
> IPersonWithRoleAssociation extends and passes C explicitly (Person). 
> Everything is fine, if I use a marker interface for Person (IPerson) and 
> declare:
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type

2019-01-16 Thread Thiago H. de Paula Figueiredo (JIRA)


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

Thiago H. de Paula Figueiredo commented on TAP5-2032:
-

This should be fixed by TAP5-2560 and its new \{{genericsresolver-guava}} JAR.

> GenericsUtils does not handle generics properly when extracting the actual 
> type
> ---
>
> Key: TAP5-2032
> URL: https://issues.apache.org/jira/browse/TAP5-2032
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-ioc
>Affects Versions: 5.3.6, 5.5.0, 5.4.3
>Reporter: DI Florian Hackenberger
>Assignee: Thiago H. de Paula Figueiredo
>Priority: Major
>  Labels: desired_for_5.5
>
> We have the following interfaces / classes
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo {
>   PersonRole getRole();
>   void setRole(PersonRole role);
> }
> public interface IEntityAssociationWithInfo {
>   P getParent();
>   void setParent(P parent);
>   C getChild();
>   void setChild(C child);
> }
> public class Person implements Serializable {
>   
>   String name;
>   public String getName() {
>   return name;
>   }
> }
> {code}
> and the page:
> {code:java}
> public class EditPersonsWithRoles {
>   @Property(write=false) IPersonWithRoleAssociation personWithRole;
> }
> {code}
> and the template snippet:
> {code:html}
> 
> {code}
> Leads to the following exception:
> {noformat}
> Exception generating conduit for expression 'personWithRole.child.name': ...
> ...
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:388)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:128)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractActualType(GenericsUtils.java:74)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.buildGetterMethodAccessTerm(PropertyConduitSourceImpl.java:1119)
>  ~[tapestry-core-5.3.6.jar:na]
> {noformat}
> At GenericsUtils.java:388 we have:
> {code:java}
> resolved = ((ParameterizedType) t).getActualTypeArguments()[i];
> {code}
> where:
> {code:java}
> i = 1
> resolved = C
> ((ParameterizedType) t).getActualTypeArguments() = 
> [org.topfive.entities.IPersonWithRoleAssociation]
> {code}
> so the problem seems to be that the code assumes that it can find the type 
> information for C as the second generic parameter for 
> IPersonWithRoleAssociation, when in fact is is the second generic parameter 
> for the superclass IEntityAssociationWithInfo which 
> IPersonWithRoleAssociation extends and passes C explicitly (Person). 
> Everything is fine, if I use a marker interface for Person (IPerson) and 
> declare:
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type

2017-11-03 Thread Hudson (JIRA)

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

Hudson commented on TAP5-2032:
--

ABORTED: Integrated in Jenkins build tapestry-trunk-freestyle #1677 (See 
[https://builds.apache.org/job/tapestry-trunk-freestyle/1677/])
TAP5-2032, TAP5-2449, TAP5-1493: consider overridden methods first so we 
(jkemnade: rev 127f62edf90b2a838896626143f2ca9e6a718a76)
* (edit) 
beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/PropertyAccessImpl.java
* (edit) tapestry-ioc/src/test/groovy/ioc/specs/PropertyAccessImplSpec.groovy
* (edit) 
beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java


> GenericsUtils does not handle generics properly when extracting the actual 
> type
> ---
>
> Key: TAP5-2032
> URL: https://issues.apache.org/jira/browse/TAP5-2032
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-ioc
>Affects Versions: 5.3.6, 5.5.0, 5.4.3
>Reporter: DI Florian Hackenberger
>Assignee: Thiago H. de Paula Figueiredo
>Priority: Major
>
> We have the following interfaces / classes
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo {
>   PersonRole getRole();
>   void setRole(PersonRole role);
> }
> public interface IEntityAssociationWithInfo {
>   P getParent();
>   void setParent(P parent);
>   C getChild();
>   void setChild(C child);
> }
> public class Person implements Serializable {
>   
>   String name;
>   public String getName() {
>   return name;
>   }
> }
> {code}
> and the page:
> {code:java}
> public class EditPersonsWithRoles {
>   @Property(write=false) IPersonWithRoleAssociation personWithRole;
> }
> {code}
> and the template snippet:
> {code:html}
> 
> {code}
> Leads to the following exception:
> {noformat}
> Exception generating conduit for expression 'personWithRole.child.name': ...
> ...
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:388)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:128)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractActualType(GenericsUtils.java:74)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.buildGetterMethodAccessTerm(PropertyConduitSourceImpl.java:1119)
>  ~[tapestry-core-5.3.6.jar:na]
> {noformat}
> At GenericsUtils.java:388 we have:
> {code:java}
> resolved = ((ParameterizedType) t).getActualTypeArguments()[i];
> {code}
> where:
> {code:java}
> i = 1
> resolved = C
> ((ParameterizedType) t).getActualTypeArguments() = 
> [org.topfive.entities.IPersonWithRoleAssociation]
> {code}
> so the problem seems to be that the code assumes that it can find the type 
> information for C as the second generic parameter for 
> IPersonWithRoleAssociation, when in fact is is the second generic parameter 
> for the superclass IEntityAssociationWithInfo which 
> IPersonWithRoleAssociation extends and passes C explicitly (Person). 
> Everything is fine, if I use a marker interface for Person (IPerson) and 
> declare:
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type

2017-11-03 Thread Jochen Kemnade (JIRA)

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

Jochen Kemnade commented on TAP5-2032:
--

I think I fixed this issue, but we might want to add some argument checks to 
the {{GenericsUtils}} methods and throw {{IllegalArgumentException}}s early if 
the parameters don't make sense.

> GenericsUtils does not handle generics properly when extracting the actual 
> type
> ---
>
> Key: TAP5-2032
> URL: https://issues.apache.org/jira/browse/TAP5-2032
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-ioc
>Affects Versions: 5.3.6, 5.5.0, 5.4.3
>Reporter: DI Florian Hackenberger
>Assignee: Thiago H. de Paula Figueiredo
>Priority: Major
>
> We have the following interfaces / classes
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo {
>   PersonRole getRole();
>   void setRole(PersonRole role);
> }
> public interface IEntityAssociationWithInfo {
>   P getParent();
>   void setParent(P parent);
>   C getChild();
>   void setChild(C child);
> }
> public class Person implements Serializable {
>   
>   String name;
>   public String getName() {
>   return name;
>   }
> }
> {code}
> and the page:
> {code:java}
> public class EditPersonsWithRoles {
>   @Property(write=false) IPersonWithRoleAssociation personWithRole;
> }
> {code}
> and the template snippet:
> {code:html}
> 
> {code}
> Leads to the following exception:
> {noformat}
> Exception generating conduit for expression 'personWithRole.child.name': ...
> ...
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:388)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:128)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractActualType(GenericsUtils.java:74)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.buildGetterMethodAccessTerm(PropertyConduitSourceImpl.java:1119)
>  ~[tapestry-core-5.3.6.jar:na]
> {noformat}
> At GenericsUtils.java:388 we have:
> {code:java}
> resolved = ((ParameterizedType) t).getActualTypeArguments()[i];
> {code}
> where:
> {code:java}
> i = 1
> resolved = C
> ((ParameterizedType) t).getActualTypeArguments() = 
> [org.topfive.entities.IPersonWithRoleAssociation]
> {code}
> so the problem seems to be that the code assumes that it can find the type 
> information for C as the second generic parameter for 
> IPersonWithRoleAssociation, when in fact is is the second generic parameter 
> for the superclass IEntityAssociationWithInfo which 
> IPersonWithRoleAssociation extends and passes C explicitly (Person). 
> Everything is fine, if I use a marker interface for Person (IPerson) and 
> declare:
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type

2017-11-03 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on TAP5-2032:
---

Commit 127f62edf90b2a838896626143f2ca9e6a718a76 in tapestry-5's branch 
refs/heads/master from [~jkemnade]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=127f62e ]

TAP5-2032, TAP5-2449, TAP5-1493: consider overridden methods first so we
don't end up resolving types on the wrong classes


> GenericsUtils does not handle generics properly when extracting the actual 
> type
> ---
>
> Key: TAP5-2032
> URL: https://issues.apache.org/jira/browse/TAP5-2032
> Project: Tapestry 5
>  Issue Type: Bug
>  Components: tapestry-ioc
>Affects Versions: 5.3.6, 5.5.0, 5.4.3
>Reporter: DI Florian Hackenberger
>Assignee: Thiago H. de Paula Figueiredo
>Priority: Major
>
> We have the following interfaces / classes
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo {
>   PersonRole getRole();
>   void setRole(PersonRole role);
> }
> public interface IEntityAssociationWithInfo {
>   P getParent();
>   void setParent(P parent);
>   C getChild();
>   void setChild(C child);
> }
> public class Person implements Serializable {
>   
>   String name;
>   public String getName() {
>   return name;
>   }
> }
> {code}
> and the page:
> {code:java}
> public class EditPersonsWithRoles {
>   @Property(write=false) IPersonWithRoleAssociation personWithRole;
> }
> {code}
> and the template snippet:
> {code:html}
> 
> {code}
> Leads to the following exception:
> {noformat}
> Exception generating conduit for expression 'personWithRole.child.name': ...
> ...
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:388)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:128)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractActualType(GenericsUtils.java:74)
>  ~[tapestry-ioc-5.3.6.jar:na]
>   at 
> org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.buildGetterMethodAccessTerm(PropertyConduitSourceImpl.java:1119)
>  ~[tapestry-core-5.3.6.jar:na]
> {noformat}
> At GenericsUtils.java:388 we have:
> {code:java}
> resolved = ((ParameterizedType) t).getActualTypeArguments()[i];
> {code}
> where:
> {code:java}
> i = 1
> resolved = C
> ((ParameterizedType) t).getActualTypeArguments() = 
> [org.topfive.entities.IPersonWithRoleAssociation]
> {code}
> so the problem seems to be that the code assumes that it can find the type 
> information for C as the second generic parameter for 
> IPersonWithRoleAssociation, when in fact is is the second generic parameter 
> for the superclass IEntityAssociationWithInfo which 
> IPersonWithRoleAssociation extends and passes C explicitly (Person). 
> Everything is fine, if I use a marker interface for Person (IPerson) and 
> declare:
> {code:java}
> public interface IPersonWithRoleAssociation extends 
> IEntityAssociationWithInfo
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type

2014-06-30 Thread Thiago H. de Paula Figueiredo (JIRA)

[ 
https://issues.apache.org/jira/browse/TAP5-2032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14047990#comment-14047990
 ] 

Thiago H. de Paula Figueiredo commented on TAP5-2032:
-

Could you please provide all the classes involved? There are pieces missing and 
the description above is confusing. In addition, could you please try with the 
latest 5.4 beta? Some problems in GenericUtils were fixed in the last couple of 
years.

 GenericsUtils does not handle generics properly when extracting the actual 
 type
 ---

 Key: TAP5-2032
 URL: https://issues.apache.org/jira/browse/TAP5-2032
 Project: Tapestry 5
  Issue Type: Bug
  Components: tapestry-ioc
Affects Versions: 5.3.6
Reporter: DI Florian Hackenberger
Assignee: Thiago H. de Paula Figueiredo

 We have the following interfaces / classes
 public interface IPersonWithRoleAssociationA extends 
 IEntityAssociationWithInfoA, Person {
   PersonRole getRole();
   void setRole(PersonRole role);
 }
 public interface IEntityAssociationWithInfoP, C {
   P getParent();
   void setParent(P parent);
   C getChild();
   void setChild(C child);
 }
 public class Person implements Serializable {
   
   String name;
   public String getName() {
   return name;
   }
 }
 and the page:
 public class EditPersonsWithRoles {
   @Property(write=false) IPersonWithRoleAssociationA personWithRole;
 }
 and the template snippet:
 t:textfield t:id=personSex t:value=personWithRole.child.name/
 Leads to the following exception:
 Exception generating conduit for expression 'personWithRole.child.name': ...
 ...
 Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
   at 
 org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:388)
  ~[tapestry-ioc-5.3.6.jar:na]
   at 
 org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:128)
  ~[tapestry-ioc-5.3.6.jar:na]
   at 
 org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractActualType(GenericsUtils.java:74)
  ~[tapestry-ioc-5.3.6.jar:na]
   at 
 org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.buildGetterMethodAccessTerm(PropertyConduitSourceImpl.java:1119)
  ~[tapestry-core-5.3.6.jar:na]
 At GenericsUtils.java:388 we have:
 resolved = ((ParameterizedType) t).getActualTypeArguments()[i];
 where:
 i = 1
 resolved = C
 ((ParameterizedType) t).getActualTypeArguments() = 
 [org.topfive.entities.IPersonWithRoleAssociationP]
 so the problem seems to be that the code assumes that it can find the type 
 information for C as the second generic parameter for 
 IPersonWithRoleAssociation, when in fact is is the second generic parameter 
 for the superclass IEntityAssociationWithInfo which 
 IPersonWithRoleAssociation extends and passes C explicitly (Person). 
 Everything is fine, if I use a marker interface for Person (IPerson) and 
 declare:
 public interface IPersonWithRoleAssociationA, P extends IPerson extends 
 IEntityAssociationWithInfoA, P



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