You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2008/03/01 03:49:52 UTC

[jira] Commented: (TAPESTRY-2123) ClassCastException in CoercingPropertyConduitWrapper

    [ https://issues.apache.org/jira/browse/TAPESTRY-2123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574054#action_12574054 ] 

Howard M. Lewis Ship commented on TAPESTRY-2123:
------------------------------------------------

I suspect that TAPESTRY-2022 may have incidentally fixed this bug.  Any chance you can verify against latest snapshots (after the next nightly build).

> ClassCastException in CoercingPropertyConduitWrapper
> ----------------------------------------------------
>
>                 Key: TAPESTRY-2123
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2123
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core Components
>    Affects Versions: 5.0.9
>         Environment: Jetty & MacOS X 
>            Reporter: Moritz Gmelin
>
> When a bean editor receives beans from differenct classes (superclass & subclass) sometimes the wrong fields are displayed and other times a ClassCastException is throws in the CoercingPropertyConduitWrapper.
> This happens only, when bean editing is finished by the onSubmit method.
> TestCase: 
> TT1 is the superclasss of TT2
> TT1.java
> -------------------
> public class TT1 {
> 	private String name;
> 	
> 	public String getName() {
> 		return name;
> 	}
> 	
> 	public void setName(String name) {
> 		this.name = name;
> 	}
> }
> TT2.java
> ----------------------------
> public class TT2 extends TT1 {
> 	private String v2;
> 	public String getV2() {
> 		return v2;
> 	}
> 	public void setV2(String v2) {
> 		this.v2 = v2;
> 	}
> }
> CoercTest.java
> -----------------------
> public class CoercTest {
> 	@Persist
> 	private TT1 testObject;
> 	
> 	
> 	@OnEvent(component="typeTO1")
> 	public void onTypeTO1() {
> 		setTestObject(new TT1());
> 	}
> 	
> 	@OnEvent(component="typeTO2")
> 	public void onTypeTO2() {
> 		setTestObject(new TT2());		
> 	}
> 	public TT1 getTestObject() {
> 		return testObject;
> 	}
> 	public void setTestObject(TT1 testObject) {
> 		this.testObject = testObject;
> 	}
> 	
> 	public void onSubmit() {
> 		testObject = null;
> 	}
> 	
> 	public boolean isTestObjectNotNull() {
> 		return testObject != null;
> 	}
> 	
> }
> CoercTest.tml
> <html  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <body>
> <t:ActionLink t:id="typeTO1">TT1</t:ActionLink><br/>
> <t:ActionLink t:id="typeTO2">TT2</t:ActionLink><br/>
> <t:If test="testObjectNotNull">
> <t:BeanEditForm object="testObject"/>
> </t:If>
> </body>
> </html>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org