Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
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 .
Attachments
Attachments
Issue Links
- is related to
-
OAK-8328 Bug in index definition can block indexing / cause indexing in a loop
- Closed