You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Paul Nicolucci (JIRA)" <de...@myfaces.apache.org> on 2013/08/06 05:05:48 UTC

[jira] [Commented] (MYFACES-3745) org.apache.myfaces.view.facelets.impl.DefaultFaceletContext constructors are inconsistent

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

Paul Nicolucci commented on MYFACES-3745:
-----------------------------------------

Let me know if I over looked something when looking into this.  But I think it is valid to remove the FACELET_CONTEXT_KEY from the constructor as it was removed from the other constructor.

Thanks!
                
> org.apache.myfaces.view.facelets.impl.DefaultFaceletContext constructors are inconsistent
> -----------------------------------------------------------------------------------------
>
>                 Key: MYFACES-3745
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3745
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.18, 2.1.12
>            Reporter: Paul Nicolucci
>            Priority: Minor
>         Attachments: MyFaces-3745.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> In MYFACES-3246 the following constructor was updated:
> DefaultFaceletContext(FacesContext faces, AbstractFacelet facelet, FaceletCompositionContext mctx)
> It no longer does the following:
>        //Set FACELET_CONTEXT_KEY on FacesContext attribute map, to 
>        //reflect the current facelet context instance
>        faces.getAttributes().put(FaceletContext.FACELET_CONTEXT_KEY, this);
> Setting the FACELET_CONTEXT_KEY is now done where ever the DefaultFaceletContext is created for instance in DefaultFacelet.
> DefaultFaceletContext ctxWrapper = new DefaultFaceletContext((DefaultFaceletContext)ctx, this, false);
> ctx.getFacesContext().getAttributes().put(FaceletContext.FACELET_CONTEXT_KEY, ctxWrapper);
> However, the other constructor which is actually being called above still sets the FACELET_CONTEXT_KEY and so it is set in the constructor and then set again directly after creation.
>  //Update FACELET_CONTEXT_KEY on FacesContext attribute map, to
> //reflect the current facelet context instance
> ctx.getFacesContext().getAttributes().put(FaceletContext.FACELET_CONTEXT_KEY, this);
> I think this was just an oversight when fixing this bug.  But I think we should clean this up and I'll provide the trivial patch that can be applied.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira