Michael Dürig created OAK-2900:
----------------------------------

             Summary: 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)

Reply via email to