Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
OpenCMIS 1.1.0
-
None
Description
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl, the provided implementation of the MutableProperties Interface in Commons API is backed by a List and Map to provide these two different views via getPropertyList and_ getProperties_.
If a Property with the same ID is added twice via addProperty the Map replaces the old property while the List appends the new one.
Junit Test:
@Test public void testProperties_OpenCMISImpl() throws Exception { MutableProperties properties = new PropertiesImpl(); PropertyData<String> propertyOne = new PropertyStringImpl("my:test", "testOne"); PropertyData<String> propertyTwo = new PropertyStringImpl("my:test", "testTwo"); properties.addProperty(propertyOne); Assert.assertEquals(1, properties.getProperties().size()); Assert.assertEquals(1, properties.getPropertyList().size()); properties.addProperty(propertyTwo); // map replaces old property by new one, so only one entry here Assert.assertEquals(1, properties.getProperties().size()); // list appends at the end, so two entries here Assert.assertEquals(2, properties.getPropertyList().size()); }
Attachments
Issue Links
- is related to
-
CMIS-1056 CMIS Exception: connection. Parsing exception! Cause: IllegalArgumentException. Property 'cmis:objectId' already added
- Resolved