tapestry-5 git commit: increment version number
Repository: tapestry-5 Updated Branches: refs/heads/master adf455bd9 -> 232f029f3 increment version number Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/232f029f Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/232f029f Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/232f029f Branch: refs/heads/master Commit: 232f029f3b5e0d6e7407e09a65e53485f20e5b25 Parents: adf455b Author: Jochen Kemnade Authored: Fri Nov 3 12:02:33 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 12:02:33 2017 +0100 -- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/232f029f/build.gradle -- diff --git a/build.gradle b/build.gradle index 40feca1..b29fd91 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ project.version = tapestryVersion() def tapestryVersion() { def major = "5.5.0" -def minor = "-alpha-9" +def minor = "-alpha-10" // When building on the CI server, make sure -SNAPSHOT is appended, as it is a nightly build. // When building normally, or for a release, no suffix is desired.
[tapestry-5] Git Push Summary
Repository: tapestry-5 Updated Tags: refs/tags/5.5.0-alpha-9 [created] adf455bd9
tapestry-5 git commit: improve wait for page load
Repository: tapestry-5 Updated Branches: refs/heads/master 9c5e8abc4 -> adf455bd9 improve wait for page load Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/adf455bd Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/adf455bd Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/adf455bd Branch: refs/heads/master Commit: adf455bd9d3bd49a41472e891213d640e159742a Parents: 9c5e8ab Author: Jochen Kemnade Authored: Fri Nov 3 11:53:09 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 11:53:09 2017 +0100 -- .../apache/tapestry5/test/SeleniumTestCase.java | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/adf455bd/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java -- diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java index 4a64591..a1fba91 100644 --- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java +++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java @@ -19,6 +19,7 @@ import com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; @@ -1377,15 +1378,20 @@ public abstract class SeleniumTestCase extends Assert implements Selenium // In a limited number of cases, a "page" is an container error page or raw HTML content // that does not include the body element and data-page-initialized element. In those cases, // there will never be page initialization in the Tapestry sense and we return immediately. - -if (!isElementPresent("css=body[data-page-initialized]")) +try { -return; -} - +WebElement body = webDriver.findElement(By.cssSelector("body")); - waitForCondition(ExpectedConditions.attributeToBe(By.cssSelector("body"), "data-page-initialized", "true"), 30); +if (body.getAttribute("data-page-initialized") == null) +{ +return; +} +waitForCondition(ExpectedConditions.attributeToBe(body, "data-page-initialized", "true"), 30); +} catch (NoSuchElementException e) +{ +// no body element found, there's nothing to wait for +} } @Override
tapestry-5 git commit: fix isElementPresent
Repository: tapestry-5 Updated Branches: refs/heads/master 7c398b117 -> 9c5e8abc4 fix isElementPresent Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/9c5e8abc Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/9c5e8abc Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/9c5e8abc Branch: refs/heads/master Commit: 9c5e8abc437aa048f0c2ab031c9eae41fe7012c0 Parents: 7c398b1 Author: Jochen Kemnade Authored: Fri Nov 3 11:47:40 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 11:47:40 2017 +0100 -- .../src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/9c5e8abc/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java -- diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java index 6ae7c64..4a64591 100644 --- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java +++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java @@ -976,7 +976,7 @@ public abstract class SeleniumTestCase extends Assert implements Selenium @Override public boolean isElementPresent(String locator) { -return webDriver.findElement(convertLocator(locator)) != null; +return !webDriver.findElements(convertLocator(locator)).isEmpty(); } @Override
tapestry-5 git commit: increment version number
Repository: tapestry-5 Updated Branches: refs/heads/master 3eaf96507 -> 7c398b117 increment version number Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/7c398b11 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/7c398b11 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/7c398b11 Branch: refs/heads/master Commit: 7c398b117aa3ce073cab0b45d1902a18b404e20a Parents: 3eaf965 Author: Jochen Kemnade Authored: Fri Nov 3 11:33:34 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 11:33:34 2017 +0100 -- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7c398b11/build.gradle -- diff --git a/build.gradle b/build.gradle index 12a364b..40feca1 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ project.version = tapestryVersion() def tapestryVersion() { def major = "5.5.0" -def minor = "-alpha-8" +def minor = "-alpha-9" // When building on the CI server, make sure -SNAPSHOT is appended, as it is a nightly build. // When building normally, or for a release, no suffix is desired.
[tapestry-5] Git Push Summary
Repository: tapestry-5 Updated Tags: refs/tags/5.5.0-alpha-8 [created] 3eaf96507
tapestry-5 git commit: improve wait for page load
Repository: tapestry-5 Updated Branches: refs/heads/master 8932267e4 -> 3eaf96507 improve wait for page load Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/3eaf9650 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/3eaf9650 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/3eaf9650 Branch: refs/heads/master Commit: 3eaf96507902268728b07a77894ebcef024819a5 Parents: 8932267 Author: Jochen Kemnade Authored: Fri Nov 3 11:18:55 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 11:18:55 2017 +0100 -- .../apache/tapestry5/test/SeleniumTestCase.java | 32 +--- 1 file changed, 8 insertions(+), 24 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/3eaf9650/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java -- diff --git a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java index 313e4e5..6ae7c64 100644 --- a/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java +++ b/tapestry-test/src/main/java/org/apache/tapestry5/test/SeleniumTestCase.java @@ -13,13 +13,10 @@ package org.apache.tapestry5.test; import com.thoughtworks.selenium.CommandProcessor; -import com.thoughtworks.selenium.HttpCommandProcessor; import com.thoughtworks.selenium.Selenium; import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium; import com.thoughtworks.selenium.webdriven.WebDriverCommandProcessor; -import io.github.bonigarcia.wdm.FirefoxDriverManager; - import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; @@ -27,7 +24,6 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxProfile; -import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.internal.WrapsDriver; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.support.ui.ExpectedCondition; @@ -980,7 +976,7 @@ public abstract class SeleniumTestCase extends Assert implements Selenium @Override public boolean isElementPresent(String locator) { -return selenium.isElementPresent(locator); +return webDriver.findElement(convertLocator(locator)) != null; } @Override @@ -1353,7 +1349,12 @@ public abstract class SeleniumTestCase extends Assert implements Selenium protected void waitForCondition(ExpectedCondition condition) { - WebDriverWait wait = new WebDriverWait(webDriver, 10); + waitForCondition(condition, 10l); +} + +protected void waitForCondition(ExpectedCondition condition, long timeoutSeconds) +{ + WebDriverWait wait = new WebDriverWait(webDriver, timeoutSeconds); wait.until(condition); } @@ -1382,26 +1383,9 @@ public abstract class SeleniumTestCase extends Assert implements Selenium return; } -final long pollingStartTime = System.currentTimeMillis(); - -long sleepTime = 20; - -while (true) -{ -if (isElementPresent("css=body[data-page-initialized='true']")) -{ -return; -} - -if ((System.currentTimeMillis() - pollingStartTime) > 3) -{ -reportAndThrowAssertionError("Page did not finish initializing after 30 seconds."); -} -sleep(sleepTime); + waitForCondition(ExpectedConditions.attributeToBe(By.cssSelector("body"), "data-page-initialized", "true"), 30); -sleepTime *= 2; -} } @Override
[2/3] tapestry-5 git commit: upgrade Selenium
upgrade Selenium Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/df3f282b Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/df3f282b Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/df3f282b Branch: refs/heads/master Commit: df3f282ba31928b2cbe370ed6422aa1fa227863c Parents: be704c5 Author: Jochen Kemnade Authored: Fri Nov 3 11:00:42 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 11:00:42 2017 +0100 -- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/df3f282b/build.gradle -- diff --git a/build.gradle b/build.gradle index c898aa6..f2abc08 100755 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ project.ext.versions = [ hibernate: "5.1.0.Final", slf4j: "1.7.25", geb: "1.1.1", -selenium: "3.6.0" +selenium: "3.7.0" ] ext.continuousIntegrationBuild = Boolean.getBoolean("ci")
[3/3] tapestry-5 git commit: upgrade Geb
upgrade Geb Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/8932267e Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/8932267e Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/8932267e Branch: refs/heads/master Commit: 8932267e47d13b3043d144f520224f3107e56888 Parents: df3f282 Author: Jochen Kemnade Authored: Fri Nov 3 11:01:02 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 11:01:02 2017 +0100 -- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/8932267e/build.gradle -- diff --git a/build.gradle b/build.gradle index f2abc08..12a364b 100755 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ project.ext.versions = [ spock: "1.1-groovy-2.4", hibernate: "5.1.0.Final", slf4j: "1.7.25", -geb: "1.1.1", +geb: "2.0", selenium: "3.7.0" ]
[1/3] tapestry-5 git commit: upgrade Closure Compiler
Repository: tapestry-5 Updated Branches: refs/heads/master 127f62edf -> 8932267e4 upgrade Closure Compiler Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/be704c55 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/be704c55 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/be704c55 Branch: refs/heads/master Commit: be704c55d29a00a3707407c945b15191c1a7d39e Parents: 127f62e Author: Jochen Kemnade Authored: Fri Nov 3 11:00:32 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 11:00:32 2017 +0100 -- tapestry-webresources/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/be704c55/tapestry-webresources/build.gradle -- diff --git a/tapestry-webresources/build.gradle b/tapestry-webresources/build.gradle index cdc1751..874cfef 100644 --- a/tapestry-webresources/build.gradle +++ b/tapestry-webresources/build.gradle @@ -3,7 +3,7 @@ description = "Integration with WRO4J to perform runtime CoffeeScript compilatio dependencies { compile project(":tapestry-core") compile "com.github.sommeri:less4j:1.12.0" -compile "com.google.javascript:closure-compiler-unshaded:v20170910" +compile "com.google.javascript:closure-compiler-unshaded:v20171023" compile "org.mozilla:rhino:1.7.7.2" testCompile project(":tapestry-runner")
[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
[ https://issues.apache.org/jira/browse/TAP5-1493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16237379#comment-16237379 ] Hudson commented on TAP5-1493: -- 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 > 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 >Assignee: Thiago H. de Paula Figueiredo >Priority: Critical > Labels: month-of-tapestry > Fix For: 5.4 > > > 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.4.14#64029)
[jira] [Commented] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type
[ https://issues.apache.org/jira/browse/TAP5-2032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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-2449) PropertyConduitSource can't see Java 8 default methods
[ https://issues.apache.org/jira/browse/TAP5-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16237378#comment-16237378 ] Hudson commented on TAP5-2449: -- 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 > PropertyConduitSource can't see Java 8 default methods > -- > > Key: TAP5-2449 > URL: https://issues.apache.org/jira/browse/TAP5-2449 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.4 >Reporter: quurks >Priority: Major > Labels: desired_for_5.5 > Fix For: 5.5.0 > > > *Stets to reproduce:* > Class with > {code} > public class TestDefaultMethod { > @Property private TestData testData = new TestData(); > public static interface TestInterface { > public default String getTestString() { > return "Alpha"; > } > } > public static class TestData implements TestInterface { > } > } > {code} > Template with > {code} > ${testData.testString} > {code} > *Expected*: > "Alpha" is put in the website > *Actual*: >Exception type: org.apache.tapestry5.ioc.util.UnknownValueException > Message: Class com.example.pages.TestDefaultMethod$TestData does > not contain a property (or public field) named 'testString'. > availableValues: AvailableValues\[Properties (and public fields): class] > It works with > {code} > ${testData.getTestString()} > {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
[ https://issues.apache.org/jira/browse/TAP5-2032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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] [Comment Edited] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type
[ https://issues.apache.org/jira/browse/TAP5-2032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16237295#comment-16237295 ] Jochen Kemnade edited comment on TAP5-2032 at 11/3/17 8:47 AM: --- I think I fixed this issue, but we might want to add some argument checks to the {{GenericsUtils}} methods and throw an {{IllegalArgumentException}} early if the parameters don't make sense. was (Author: jkemnade): 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-2449) PropertyConduitSource can't see Java 8 default methods
[ https://issues.apache.org/jira/browse/TAP5-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16237291#comment-16237291 ] ASF subversion and git services commented on TAP5-2449: --- 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 > PropertyConduitSource can't see Java 8 default methods > -- > > Key: TAP5-2449 > URL: https://issues.apache.org/jira/browse/TAP5-2449 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.4 >Reporter: quurks >Priority: Major > Labels: desired_for_5.5 > Fix For: 5.5.0 > > > *Stets to reproduce:* > Class with > {code} > public class TestDefaultMethod { > @Property private TestData testData = new TestData(); > public static interface TestInterface { > public default String getTestString() { > return "Alpha"; > } > } > public static class TestData implements TestInterface { > } > } > {code} > Template with > {code} > ${testData.testString} > {code} > *Expected*: > "Alpha" is put in the website > *Actual*: >Exception type: org.apache.tapestry5.ioc.util.UnknownValueException > Message: Class com.example.pages.TestDefaultMethod$TestData does > not contain a property (or public field) named 'testString'. > availableValues: AvailableValues\[Properties (and public fields): class] > It works with > {code} > ${testData.getTestString()} > {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
[ https://issues.apache.org/jira/browse/TAP5-2032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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-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:comment-tabpanel&focusedCommentId=16237292#comment-16237292 ] ASF subversion and git services commented on TAP5-1493: --- 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 > 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 >Assignee: Thiago H. de Paula Figueiredo >Priority: Critical > Labels: month-of-tapestry > Fix For: 5.4 > > > 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.4.14#64029)
tapestry-5 git commit: TAP5-2032, TAP5-2449, TAP5-1493: consider overridden methods first so we don't end up resolving types on the wrong classes
Repository: tapestry-5 Updated Branches: refs/heads/master 3fbcb2602 -> 127f62edf TAP5-2032, TAP5-2449, TAP5-1493: consider overridden methods first so we don't end up resolving types on the wrong classes Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/127f62ed Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/127f62ed Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/127f62ed Branch: refs/heads/master Commit: 127f62edf90b2a838896626143f2ca9e6a718a76 Parents: 3fbcb26 Author: Jochen Kemnade Authored: Fri Nov 3 09:41:29 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 09:45:08 2017 +0100 -- .../services/ClassPropertyAdapterImpl.java | 31 .../internal/services/PropertyAccessImpl.java | 3 +- .../ioc/specs/PropertyAccessImplSpec.groovy | 23 +++ 3 files changed, 44 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/127f62ed/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java -- diff --git a/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java b/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java index 9c5f36c4..8164ec7 100644 --- a/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java +++ b/beanmodel/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassPropertyAdapterImpl.java @@ -41,19 +41,26 @@ public class ClassPropertyAdapterImpl implements ClassPropertyAdapter // lazy init Map> nonBridgeMethods = null; - + for (PropertyDescriptor pd : descriptors) { // Indexed properties will have a null propertyType (and a non-null // indexedPropertyType). We ignore indexed properties. +String name = pd.getName(); + +if (adapters.containsKey(name)) +{ +continue; +} + final Class thisPropertyType = pd.getPropertyType(); if (thisPropertyType == null) continue; Method readMethod = pd.getReadMethod(); Method writeMethod = pd.getWriteMethod(); - + // TAP5-1493 if (readMethod != null && readMethod.isBridge()) { @@ -61,15 +68,15 @@ public class ClassPropertyAdapterImpl implements ClassPropertyAdapter { nonBridgeMethods = groupNonBridgeMethodsByName(beanType); } -readMethod = findMethodWithSameNameAndParamCount(readMethod, nonBridgeMethods); +readMethod = findMethodWithSameNameAndParamCount(readMethod, nonBridgeMethods); } - + // TAP5-1548, TAP5-1885: trying to find a getter which Introspector missed if (readMethod == null) { final String prefix = thisPropertyType != boolean.class ? "get" : "is"; try { -Method method = beanType.getMethod(prefix + capitalize(pd.getName())); +Method method = beanType.getMethod(prefix + capitalize(name)); final Class returnType = method.getReturnType(); if (returnType.equals(thisPropertyType) || returnType.isInstance(thisPropertyType)) { readMethod = method; @@ -83,7 +90,7 @@ public class ClassPropertyAdapterImpl implements ClassPropertyAdapter // getter doesn't exist. } } - + if (writeMethod != null && writeMethod.isBridge()) { if (nonBridgeMethods == null) @@ -92,12 +99,12 @@ public class ClassPropertyAdapterImpl implements ClassPropertyAdapter } writeMethod = findMethodWithSameNameAndParamCount(writeMethod, nonBridgeMethods); } - + // TAP5-1548, TAP5-1885: trying to find a setter which Introspector missed if (writeMethod == null) { try { -Method method = beanType.getMethod("set" + capitalize(pd.getName()), pd.getPropertyType()); +Method method = beanType.getMethod("set" + capitalize(name), pd.getPropertyType()); final Class returnType = method.getReturnType(); if (returnType.equals(void.class)) { writeMethod = method; @@ -115,7 +122,7 @@ public class ClassPropertyAdapterImpl implements ClassPropertyAdapter
tapestry-5 git commit: produce more output so that builds don't stall on Travis
Repository: tapestry-5 Updated Branches: refs/heads/master 2433746b6 -> 3fbcb2602 produce more output so that builds don't stall on Travis Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/3fbcb260 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/3fbcb260 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/3fbcb260 Branch: refs/heads/master Commit: 3fbcb2602cfa3578cd6b2bd6be1e76812223cf8d Parents: 2433746 Author: Jochen Kemnade Authored: Fri Nov 3 08:57:07 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 08:57:07 2017 +0100 -- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/3fbcb260/build.gradle -- diff --git a/build.gradle b/build.gradle index 898ab92..c898aa6 100755 --- a/build.gradle +++ b/build.gradle @@ -209,7 +209,7 @@ subprojects { def numberOfTestsExecuted = 0 afterTest { descriptor, result-> numberOfTestsExecuted++ -if (numberOfTestsExecuted % 50 == 0){ +if (numberOfTestsExecuted % 25 == 0){ logger.lifecycle "$numberOfTestsExecuted tests executed" } }
[jira] [Comment Edited] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type
[ https://issues.apache.org/jira/browse/TAP5-2032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16211078#comment-16211078 ] Jochen Kemnade edited comment on TAP5-2032 at 11/3/17 7:52 AM: --- I can actually reproduce a variation of this in the 5.5.0 alphas (thanks [~mihasik] for spotting it in the first place). {code:java} public interface IdentifiableEnum, ID extends Number> { ID getId(); } public enum ById implements IdentifiableEnum { ; public Byte getId() { return null; } } new PropertyAccessImpl().getAdapter(ById.class); {code} produces {noformat} ... Caused by: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 1 at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:116) at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.getAdapter(PropertyAccessImpl.java:80) at ioc.specs.PropertyAccessImplSpec.Build adapter for enum implementing generic interface(PropertyAccessImplSpec.groovy:827) Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:386) at org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:126) at org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractGenericReturnType(GenericsUtils.java:39) at org.apache.tapestry5.ioc.internal.services.ClassPropertyAdapterImpl.(ClassPropertyAdapterImpl.java:115) at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:112) ... 2 more {noformat} was (Author: jkemnade): I can actually reproduce a variation of this in the 5.5.0 alphas (thanks [~mihasik] for spotting it in the first place). {code:java} public interface IdentifiableEnum, ID extends Number> { ID getId(); } public enum ById implements IdentifiableEnum { public Byte getId() { return null; } } new PropertyAccessImpl().getAdapter(ById.class) {code} produces {noformat} ... Caused by: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 1 at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:116) at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.getAdapter(PropertyAccessImpl.java:80) at ioc.specs.PropertyAccessImplSpec.Build adapter for enum implementing generic interface(PropertyAccessImplSpec.groovy:827) Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:386) at org.apache.tapestry5.ioc.internal.util.GenericsUtils.resolve(GenericsUtils.java:126) at org.apache.tapestry5.ioc.internal.util.GenericsUtils.extractGenericReturnType(GenericsUtils.java:39) at org.apache.tapestry5.ioc.internal.services.ClassPropertyAdapterImpl.(ClassPropertyAdapterImpl.java:115) at org.apache.tapestry5.ioc.internal.services.PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:112) ... 2 more {noformat} > 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] >
[jira] [Updated] (TAP5-2032) GenericsUtils does not handle generics properly when extracting the actual type
[ https://issues.apache.org/jira/browse/TAP5-2032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jochen Kemnade updated TAP5-2032: - Affects Version/s: 5.4.3 > 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)
tapestry-5 git commit: and another fix
Repository: tapestry-5 Updated Branches: refs/heads/master 3293db657 -> 2433746b6 and another fix Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/2433746b Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/2433746b Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/2433746b Branch: refs/heads/master Commit: 2433746b6e4bc25aeafdec912772238cdca0afec Parents: 3293db6 Author: Jochen Kemnade Authored: Fri Nov 3 08:35:40 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 08:35:40 2017 +0100 -- .../java/org/apache/tapestry5/integration/app1/FormTests.java| 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2433746b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java -- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java index c4044b4..fa792b6 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java @@ -469,7 +469,9 @@ public class FormTests extends App1TestCase assertTextPresent("Selected position: TEMP"); - webDriver.findElements(By.cssSelector("label")).stream().filter(element-> element.getText().contains("Lifer")).findFirst().get().click(); +WebElement lifer = webDriver.findElements(By.cssSelector("label")).stream().filter(element-> element.getText().contains("Lifer")).findFirst().get(); +scrollIntoView(lifer); +lifer.click(); clickAndWait(update);
tapestry-5 git commit: still working on test failures
Repository: tapestry-5 Updated Branches: refs/heads/master 012789962 -> 3293db657 still working on test failures Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/3293db65 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/3293db65 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/3293db65 Branch: refs/heads/master Commit: 3293db657ad8d935a331e4ba64af11ec6183af44 Parents: 0127899 Author: Jochen Kemnade Authored: Fri Nov 3 08:12:30 2017 +0100 Committer: Jochen Kemnade Committed: Fri Nov 3 08:12:30 2017 +0100 -- .../java/org/apache/tapestry5/integration/app1/FormTests.java| 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/3293db65/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java -- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java index 54d96a2..c4044b4 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java @@ -461,7 +461,9 @@ public class FormTests extends App1TestCase assertTextPresent("Selected department: SALES_AND_MARKETING"); // not in a loop ... - webDriver.findElements(By.cssSelector("label")).stream().filter(element-> element.getText().contains("Temp")).findFirst().get().click(); +WebElement temp = webDriver.findElements(By.cssSelector("label")).stream().filter(element-> element.getText().contains("Temp")).findFirst().get(); +scrollIntoView(temp); +temp.click(); clickAndWait(update);