You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jesse Kuhnert (JIRA)" <de...@tapestry.apache.org> on 2008/02/08 16:05:25 UTC

[jira] Updated: (TAPESTRY-1111) Throw an exception when trying to access an uninitialized property

     [ https://issues.apache.org/jira/browse/TAPESTRY-1111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jesse Kuhnert updated TAPESTRY-1111:
------------------------------------

    Fix Version/s:     (was: 4.1.5)
                   4.1.6

> Throw an exception when trying to access an uninitialized property
> ------------------------------------------------------------------
>
>                 Key: TAPESTRY-1111
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1111
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 4.0
>            Reporter: Peter Eastman
>            Assignee: Jesse Kuhnert
>             Fix For: 4.1.6
>
>
> If you do not specify a default value for a property (e.g. with @InitialValue), it gets initialized to a default value selected by Tapestry.  This creates lots of opportunities for confusion and bugs.  I suggest that instead, the property should be marked internally as "uninitialized".  If you attempt to get its value while it is in that state, it should throw an exception.  Looking up a property before its value has been set is almost always an error.  It is much better to immediately alert the user so they can fix the bug, rather than letting their program appear to work, but misbehave in some possibly subtle way.
> This applies to any situation where you try to access a value that is not currently available.  For example, if you try to access a persistent property inside pageAttached(), it should throw an exception rather than simply returning null.

-- 
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