jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r161308 [2/2] - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: ./ nodetype/ nodetype/xml/ state/ version/ version/persistence/ virtual/ xml/
Date Thu, 14 Apr 2005 15:39:50 GMT
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java?view=diff&r1=161307&r2=161308
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
Thu Apr 14 08:39:43 2005
@@ -88,10 +88,10 @@
         super(ntReg, new NodeId(rootId));
         this.vMgr = vMgr;
         this.parentId = parentId;
-        NDEF_VERSION = new NodeDefId(ntReg.getEffectiveNodeType(NT_VERSIONHISTORY).getApplicableChildNodeDef(JCR_ROOTVERSION,
NT_VERSION));
-        NDEF_VERSION_HISTORY = new NodeDefId(ntReg.getEffectiveNodeType(NT_UNSTRUCTURED).getApplicableChildNodeDef(JCR_ROOTVERSION,
NT_VERSIONHISTORY));
-        NDEF_VERSION_HISTORY_ROOT = new NodeDefId(ntReg.getEffectiveNodeType(REP_SYSTEM).getApplicableChildNodeDef(JCR_VERSIONSTORAGE,
REP_VERSIONSTORAGE));
-        NDEF_VERSION_LABELS = new NodeDefId(ntReg.getEffectiveNodeType(NT_VERSIONHISTORY).getApplicableChildNodeDef(JCR_VERSIONLABELS,
NT_VERSIONLABELS));
+        NDEF_VERSION = ntReg.getEffectiveNodeType(NT_VERSIONHISTORY).getApplicableChildNodeDef(JCR_ROOTVERSION,
NT_VERSION).getId();
+        NDEF_VERSION_HISTORY = ntReg.getEffectiveNodeType(NT_UNSTRUCTURED).getApplicableChildNodeDef(JCR_ROOTVERSION,
NT_VERSIONHISTORY).getId();
+        NDEF_VERSION_HISTORY_ROOT = ntReg.getEffectiveNodeType(REP_SYSTEM).getApplicableChildNodeDef(JCR_VERSIONSTORAGE,
REP_VERSIONSTORAGE).getId();
+        NDEF_VERSION_LABELS = ntReg.getEffectiveNodeType(NT_VERSIONHISTORY).getApplicableChildNodeDef(JCR_VERSIONLABELS,
NT_VERSIONLABELS).getId();
     }
 
     /**
@@ -166,7 +166,7 @@
     protected VirtualNodeState internalGetNodeState(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
 
-        VirtualNodeState state = null;
+        VirtualNodeState state;
         try {
             InternalVersionItem vi = vMgr.getItem(id.getUUID());
             if (vi instanceof InternalVersionHistory) {
@@ -193,8 +193,8 @@
                 state = new VersionNodeState(this, v, vi.getParent().getId());
                 state.setDefinitionId(NDEF_VERSION);
                 state.setPropertyValue(JCR_CREATED, InternalValue.create(v.getCreated()));
-                state.setPropertyValues(JCR_PREDECESSORS, PropertyType.REFERENCE, new InternalValue[0]);
-                state.setPropertyValues(JCR_SUCCESSORS, PropertyType.REFERENCE, new InternalValue[0]);
+                state.setPropertyValues(JCR_PREDECESSORS, PropertyType.REFERENCE, InternalValue.EMPTY);
+                state.setPropertyValues(JCR_SUCCESSORS, PropertyType.REFERENCE, InternalValue.EMPTY);
 
             } else if (vi instanceof InternalFrozenNode) {
                 InternalFrozenNode fn = (InternalFrozenNode) vi;

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java?view=diff&r1=161307&r2=161308
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/persistence/InternalVersionHistoryImpl.java
Thu Apr 14 08:39:43 2005
@@ -470,7 +470,7 @@
 
         // initialize 'created' and 'predecessors'
         vNode.setPropertyValue(JCR_CREATED, InternalValue.create(Calendar.getInstance()));
-        vNode.setPropertyValues(JCR_PREDECESSORS, PropertyType.REFERENCE, new InternalValue[0]);
+        vNode.setPropertyValues(JCR_PREDECESSORS, PropertyType.REFERENCE, InternalValue.EMPTY);
 
         // add also an empty frozen node to the root version
         InternalFrozenNodeImpl.checkin(vNode, JCR_FROZENNODE, src, true, false);

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java?view=diff&r1=161307&r2=161308
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
Thu Apr 14 08:39:43 2005
@@ -28,7 +28,6 @@
 import org.apache.jackrabbit.core.nodetype.NodeTypeConflictException;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.nodetype.PropDef;
-import org.apache.jackrabbit.core.nodetype.PropDefId;
 import org.apache.jackrabbit.core.state.ItemState;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
@@ -205,7 +204,7 @@
 
             // handle some default prop states
             if (parent instanceof VirtualNodeState) {
-                return ((VirtualNodeState) parent).hasPropertyEntry(id.getName());
+                return parent.hasPropertyEntry(id.getName());
             }
         } catch (ItemStateException e) {
             // ignore
@@ -245,7 +244,7 @@
         VirtualPropertyState prop = new VirtualPropertyState(name, parent.getUUID());
         prop.setType(type);
         prop.setMultiValued(multiValued);
-        prop.setDefinitionId(new PropDefId(def));
+        prop.setDefinitionId(def.getId());
         return prop;
     }
 
@@ -258,18 +257,18 @@
 
         NodeDefId def;
         try {
-            def = new NodeDefId(getApplicableChildNodeDef(parent, name, nodeTypeName));
+            def = getApplicableChildNodeDef(parent, name, nodeTypeName).getId();
         } catch (RepositoryException re) {
             // hack, use nt:unstructured as parent
             NodeTypeRegistry ntReg = getNodeTypeRegistry();
             EffectiveNodeType ent = ntReg.getEffectiveNodeType(NT_UNSTRUCTURED);
             NodeDef cnd = ent.getApplicableChildNodeDef(name, nodeTypeName);
-            ntReg.getNodeDef(new NodeDefId(cnd));
-            def = new NodeDefId(cnd);
+            ntReg.getNodeDef(cnd.getId());
+            def = cnd.getId();
         }
 
         // create a new node state
-        VirtualNodeState state = null;
+        VirtualNodeState state;
         if (uuid == null) {
             uuid = UUID.randomUUID().toString();	// version 4 uuid
         }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java?view=diff&r1=161307&r2=161308
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
Thu Apr 14 08:39:43 2005
@@ -31,10 +31,8 @@
 import org.apache.jackrabbit.core.WorkspaceImpl;
 import org.apache.jackrabbit.core.nodetype.NodeDef;
 import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
-import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.nodetype.PropDef;
-import org.apache.jackrabbit.core.nodetype.PropDefId;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeState;
@@ -189,7 +187,7 @@
         if (mixinNames != null && mixinNames.length > 0) {
             node.setMixinTypeNames(new HashSet(Arrays.asList(mixinNames)));
         }
-        node.setDefinitionId(new NodeDefId(def));
+        node.setDefinitionId(def.getId());
 
         // now add new child node entry to parent
         parent.addChildNodeEntry(nodeName, node.getUUID());
@@ -263,7 +261,7 @@
         // create property
         PropertyState prop = stateMgr.createNew(propName, parent.getUUID());
 
-        prop.setDefinitionId(new PropDefId(def));
+        prop.setDefinitionId(def.getId());
         if (def.getRequiredType() != PropertyType.UNDEFINED) {
             prop.setType(def.getRequiredType());
         } else if (type != PropertyType.UNDEFINED) {



Mime
View raw message