jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg (Assigned) (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (JCR-3131) NPE in ItemManager when calling Session.save() with nothing to save
Date Tue, 01 Nov 2011 15:43:32 GMT

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

Stefan Guggisberg reassigned JCR-3131:
--------------------------------------

    Assignee: Stefan Guggisberg  (was: Julian Reschke)
    
> NPE in ItemManager when calling Session.save() with nothing to save
> -------------------------------------------------------------------
>
>                 Key: JCR-3131
>                 URL: https://issues.apache.org/jira/browse/JCR-3131
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.3.2
>            Reporter: Bertrand Delacretaz
>            Assignee: Stefan Guggisberg
>            Priority: Minor
>         Attachments: JCR-3131.patch
>
>
> I'm getting an NPE on the id.denoteNodes() call below, in ItemManager:
>     private ItemData retrieveItem(ItemId id) {
>         synchronized (itemCache) {
>             ItemData data = itemCache.get(id);
>             if (data == null && id.denotesNode()) {
> ...
> because the id is null after taking the second branch of this if in SessionSaveOperation.perform:
>         if (context.getSessionImpl().hasPermission("/", Session.ACTION_READ)) {
>             id = context.getRootNodeId();
>         } else {
>             id = context.getItemStateManager().getIdOfRootTransientNodeState();
>         }
> context.toString() says:
> session-author-3623:
> ItemManager (org.apache.jackrabbit.core.ItemManager@1e911ccc)
> Items in cache:
> SessionItemStateManager (org.apache.jackrabbit.core.state.SessionItemStateManager@15472b43)
> [transient]
> {}[attic]
> {}
> which I assume means there's nothing to save.
> The correct behavior is probably to do nothing in perform to avoid the NPE.

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

        

Mime
View raw message