[magnolia-dev] [JIRA] (MGNLUI-4203) JcrNewNodeAdapter#isNew should not return hardcoded true

"JIRA (on behalf of Federico Grilli)" <jira-O8DnXSz/[email protected]>
Newsgroups gmane.comp.cms.magnolia.devel
Message-ID <[email protected]>
Federico Grilli updated an issue

Magnolia UI / https://jira.magnolia-cms.com/browse/MGNLUI-4203 MGNLUI-4203

JcrNewNodeAdapter#isNew should not return hardcoded true

Change By:
Federico Grilli

Before saving to JCR {{JcrNewNodeAdapter#isNew}} currently returns always {{true}} (hardcoded), even after the first successful save . Saving to JCR doesn't necessarily mean that e.g. an app (or subapp) is done with the adapter, therefore, after the first save, subsequent calls to {{JcrNewNodeAdapter#isNew}} should return {{false}} in order to avoid incorrect or unexpected behaviour in code relying on that method.

To the objection that changing the behaviour of {{JcrNewNodeAdapter#isNew}} now may cause unexpected behaviour in code relying on the fact that it always returns {{true}} we one could reply by saying that we would just make the method honour its semantics as per javadoc at {{info.magnolia.ui.vaadin.integration.ItemAdapter#isNew}}
{code}@return true if it's a new Item (not already persisted).{code}
which basically is the same as {{javax.jcr.Item#isNew}}
{code}
Returns true if this is a new item, meaning that it exists
only in transient storage on the Session and has not yet been saved.
{code}

https://jira.magnolia-cms.com/browse/MGNLUI-4203#add-comment
Add Comment

This message was sent by Atlassian JIRA (v7.2.6#72008-sha1:26175bf)

----------

----------------------------------------------------------------

For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html

Alternatively, use our forums: http://forum.magnolia-cms.com/

To unsubscribe, E-mail to: <[email protected]>

----------------------------------------------------------------
(unnamed) (image/png, 425 B) - not displayed
(unnamed) (image/png, 1.1 KB) - not displayed
(unnamed) (image/png, 2.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.