You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2010/05/17 16:04:29 UTC

svn commit: r945166 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java

Author: stefan
Date: Mon May 17 14:04:28 2010
New Revision: 945166

URL: http://svn.apache.org/viewvc?rev=945166&view=rev
Log:
make private inner-class static

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java?rev=945166&r1=945165&r2=945166&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/PropertyState.java Mon May 17 14:04:28 2010
@@ -210,10 +210,10 @@ public class PropertyState extends ItemS
     public QPropertyDefinition getDefinition() throws RepositoryException {
         if (definition == null) {
             /*
-            Don't pass 'all-nodetypes from parent':
+            Don't pass 'all-node types from parent':
             for NEW-states the definition is always set upon creation.
             for all other states the definition must be retrieved only taking
-            the effective nodetypes present on the parent into account
+            the effective node types present on the parent into account
             any kind of transiently added mixins must not have an effect
             on the definition retrieved for an state that has been persisted
             before. The effective NT must be evaluated as if it had been
@@ -260,15 +260,15 @@ public class PropertyState extends ItemS
     void setValues(QValue[] values, int type) throws RepositoryException {
         if (getStatus() == Status.NEW) {
             if (data == null) {
-                data = new PropertyData(type, values);
+                data = new PropertyData(type, values, getDefinition());
             } else {
-                data.setValues(type, values);
+                data.setValues(type, values, getDefinition());
             }
         } else {
             if (transientData == null) {
-                transientData = new PropertyData(type, values);
+                transientData = new PropertyData(type, values, getDefinition());
             } else {
-                transientData.setValues(type, values);
+                transientData.setValues(type, values, getDefinition());
             }
             markModified();
         }
@@ -343,9 +343,9 @@ public class PropertyState extends ItemS
 
     //--------------------------------------------------------< inner class >---
     /**
-     * Inner class storing property values an their type.
+     * Inner class storing property values and their type.
      */
-    private class PropertyData {
+    private static class PropertyData {
         private int type;
         private QValue[] values;
         private boolean discarded;
@@ -355,14 +355,14 @@ public class PropertyState extends ItemS
             this.values = pInfo.getValues();
         }
 
-        private PropertyData(int type, QValue[] values) throws ConstraintViolationException, RepositoryException {
-            setValues(type, values);
+        private PropertyData(int type, QValue[] values, QPropertyDefinition definition) throws ConstraintViolationException, RepositoryException {
+            setValues(type, values, definition);
         }
 
-        private void setValues(int type, QValue[] values) throws ConstraintViolationException, RepositoryException {
+        private void setValues(int type, QValue[] values, QPropertyDefinition definition) throws ConstraintViolationException, RepositoryException {
             // make sure the arguments are consistent and do not violate the
             // given property definition.
-            validate(values, type, getDefinition());
+            validate(values, type, definition);
             // free old values if existing
             discardValues();
 
@@ -387,7 +387,7 @@ public class PropertyState extends ItemS
     /**
      * Helper class for delayed determination of property differences.
      */
-    private class PropertyDiffer implements MergeResult {
+    private static class PropertyDiffer implements MergeResult {
 
         private final PropertyData oldData;
         private final PropertyData newData;