You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Steve Eynon (Commented) (JIRA)" <ji...@apache.org> on 2012/04/12 05:44:43 UTC

[jira] [Commented] (TAP5-1860) problems with protected component fields

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

Steve Eynon commented on TAP5-1860:
-----------------------------------

I believe there *is* a problem with the introduction of protected instance fields, but that it's different to the one stated.

Protected fields work just fine (and why wouldn't they, it's just Java!) however, T5 annotated fields are only instrumented within the same class. Meaning if you access an instrumented protected field from a subclass, it doesn't work.

The problem (as I see it) is that T5 doesn't complain when it instruments a field marked as protected. I would also like to see the documentation updated to explain this.

We've come a cropper with this a couple of times in work. The nasty gotcha being, if you access the field in DevMode the field is shadowed, so future protected access works - but fails spectacularly with NPEs in ProdMode!
                
> problems with protected component fields
> ----------------------------------------
>
>                 Key: TAP5-1860
>                 URL: https://issues.apache.org/jira/browse/TAP5-1860
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3.2
>            Reporter: Olaf Tomczak
>         Attachments: testapp.tgz
>
>
> There seems to be a problem with the new feature introduced in 5.3.2 - https://issues.apache.org/jira/browse/TAP5-1801
> When I create a protected field in by base page class, setting the field in a subclass' event handling method seems to have no effect.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira