[
https://issues.apache.org/jira/browse/TAPESTRY-1774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andreas Andreou resolved TAPESTRY-1774.
---------------------------------------
Resolution: Won't Fix
This makes sense for me... so that component authors are informed of the
problem and handle it themselves.
> Why do an unbounded parameter throw an exception when calling a setter over
> it?
> -------------------------------------------------------------------------------
>
> Key: TAPESTRY-1774
> URL: https://issues.apache.org/jira/browse/TAPESTRY-1774
> Project: Tapestry
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 4.1.3
> Reporter: Martino Piccinato
> Priority: Minor
>
> Sorry to bug about this, maybe there's something I don't understand about it
> but all in all I cant' see no reasons why an optional unbounded parameter
> should throw an exception if a setter is called over it. What's the downside
> of considering it just a property in that case?
> Not that I consider this an important feature or a major fault but it would
> seem to me a more logical behaviour, see e.g. TAPESTRY-1699 and TAPESTRY-1700.
> So instead of
> {code:title=ParameterPropertyWorker.java|borderStyle=solid}
> // In the normal state, we update the binding first - and it's an
> error
> // if the parameter is not bound.
> builder.addln("if ({0} == null)", bindingFieldName);
> builder.addln(" throw new {0}(\"Parameter ''{1}'' is not bound and
> can not be updated.\");",
> ApplicationRuntimeException.class.getName(),
> parameterName);
> // Always updated the binding first (which may fail with an
> exception).
> builder.addln("{0}.setObject(($w) $1);", bindingFieldName);
> {code}
> Have something more like:
> {code:title=ParameterPropertyWorker.java|borderStyle=solid}
>
> builder.addln("if ({0} != null)", bindingFieldName);
> builder.addln("{0}.setObject(($w) $1);", bindingFieldName);
> {code}
--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]