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 "Julian Reschke (JIRA)" <ji...@apache.org> on 2019/07/29 06:32:05 UTC

[jira] [Closed] (OAK-8455) Memory Node store implementation of PropertyState throws Exception that is not in line with the API documentation

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

Julian Reschke closed OAK-8455.
-------------------------------

> Memory Node store implementation of PropertyState throws Exception that is not in line with the API documentation
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: OAK-8455
>                 URL: https://issues.apache.org/jira/browse/OAK-8455
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: store-spi
>            Reporter: Nitin Gupta
>            Assignee: Thomas Mueller
>            Priority: Major
>              Labels: indexingPatch
>             Fix For: 1.16.0
>
>         Attachments: OAK-8455_1.patch
>
>
> As per the api doc here [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-api/src/main/java/org/apache/jackrabbit/oak/api/PropertyState.java#L67#L69] for PropertyState the getValue method should throw an IllegalStateException if the actual Property stored is multivalued and the code calling getValue(Type type) expects it to be single valued i.e type.isArray() == false .
>  
> In SegmentStore implementation , this is followed and the getValue method throws an IllegalStateException in this scenario .
>  
> However in case of MemoryNodeStore , the code here throws an IllegalArgumentException [https://github.com/apache/jackrabbit-oak/blob/trunk/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java#L151#L154] instead of IllegalStateException .
> Since MemoryNodeStore is primarily used in testing , this difference in implementation can lead to false or incomplete testing .
>  
> For example , the fix for https://issues.apache.org/jira/browse/OAK-8328 required to catch IllegalStateException in a use case where the property was configured to be multi valued in the repository but the code expected it to be single valued . Now the fix works fine on SegmentStore , but due to the difference in implementation in MemoryNodeStore , a test written with memorynode store fails .
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)