You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2010/10/01 12:24:17 UTC

svn commit: r1003464 - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/ chemistry-opencmis-server/chemistry-opencmis-server-bindings...

Author: fmui
Date: Fri Oct  1 10:24:16 2010
New Revision: 1003464

URL: http://svn.apache.org/viewvc?rev=1003464&view=rev
Log:
fixed a bug with adding/replacing properties

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java?rev=1003464&r1=1003463&r2=1003464&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/dataobjects/PropertiesImpl.java Fri Oct  1 10:24:16 2010
@@ -72,6 +72,21 @@ public class PropertiesImpl extends Abst
      *            the property
      */
     public void addProperty(PropertyData<?> property) {
+        if (property == null) {
+            return;
+        }
+
+        propertyList.add(property);
+        properties.put(property.getId(), property);
+    }
+
+    /**
+     * Replaces a property.
+     * 
+     * @param property
+     *            the property
+     */
+    public void replaceProperty(PropertyData<?> property) {
         if ((property == null) || (property.getId() == null)) {
             return;
         }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java?rev=1003464&r1=1003463&r2=1003464&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java Fri Oct  1 10:24:16 2010
@@ -228,7 +228,7 @@ public class AtomEntryParser {
         // overwrite cmis:name with Atom title
         if ((fObject != null) && (fObject.getProperties() != null) && (atomTitle != null) && (atomTitle.length() > 0)) {
             PropertyString nameProperty = new PropertyStringImpl(PropertyIds.NAME, atomTitle);
-            ((PropertiesImpl) fObject.getProperties()).addProperty(nameProperty);
+            ((PropertiesImpl) fObject.getProperties()).replaceProperty(nameProperty);
         }
     }