You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2015/05/22 00:00:17 UTC
[jira] [Resolved] (OAK-2900) Trying to remove a non existing
element from a map might cause NPE
[ https://issues.apache.org/jira/browse/OAK-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Dürig resolved OAK-2900.
--------------------------------
Resolution: Duplicate
Duplicate of OAK-2880
> Trying to remove a non existing element from a map might cause NPE
> ------------------------------------------------------------------
>
> Key: OAK-2900
> URL: https://issues.apache.org/jira/browse/OAK-2900
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: segmentmk
> Reporter: Michael Dürig
> Fix For: 1.3.0
>
>
> Calling {{SegmentWriter.writeMap(base, changes)}} with {{changes}} containing mappings to {{null}} (meaning to remove the respective key) can result in a {{NPE}} if {{base}} doesn't contain that key.
> I came across this while working on the {{PersistedCompactionMap}} in OAK-2862. I had to add an [extra check | https://github.com/mduerig/jackrabbit-oak/blob/OAK-2862/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/PersistedCompactionMap.java#L188] for above case as otherwise I'd occasionally hit said {{NPE}}.
> Need yet to extract a proper test case.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)