jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r792464 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: ./ id/ persistence/bundle/ persistence/obj/ persistence/util/ persistence/xml/ query/ query/lucene/
Date Thu, 09 Jul 2009 09:07:46 GMT
Author: jukka
Date: Thu Jul  9 09:07:45 2009
New Revision: 792464

URL: http://svn.apache.org/viewvc?rev=792464&view=rev
Log:
JCR-1232: Merge UUID to NodeId

Use NodeId.toString() instead of NodeId.getUUID().toString(). The functionality is the same,
and the former avoids and extra method call and reduces the getUUID() footprint.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/FileSystemBLOBStore.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/OnWorkspaceInconsistency.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryHitsQuery.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
Thu Jul  9 09:07:45 2009
@@ -288,8 +288,8 @@
         NodeId destParentId = destParentState.getNodeId();
         if (destParentId.equals(srcId) || hierMgr.isAncestor(srcId, destParentId)) {
             String msg =
-                "Cloning Node with id " + srcId.getUUID()
-                + " to parent with id " + destParentId.getUUID()
+                "Cloning Node with id " + srcId
+                + " to parent with id " + destParentId
                 + " would create a share cycle.";
             log.debug(msg);
             throw new RepositoryException(msg);
@@ -299,7 +299,7 @@
         if (!srcState.addShare(destParentState.getNodeId())) {
             String msg =
                 "Adding a shareable node with id ("
-                + destParentState.getNodeId().getUUID()
+                + destParentState.getNodeId()
                 + ") twice to the same parent is not supported.";
             log.debug(msg);
             throw new UnsupportedRepositoryOperationException(msg);
@@ -1530,7 +1530,7 @@
             if (NameConstants.JCR_UUID.equals(name)) {
                 // jcr:uuid property
                 genValues = new InternalValue[]{InternalValue.create(
-                        parent.getNodeId().getUUID().toString())};
+                        parent.getNodeId().toString())};
             }
         } else if (NameConstants.NT_BASE.equals(declaringNT)) {
             // nt:base node type
@@ -1927,7 +1927,7 @@
             if (def.getDeclaringNodeType().equals(NameConstants.MIX_REFERENCEABLE)
                     && propName.equals(NameConstants.JCR_UUID)) {
                 // set correct value of jcr:uuid property
-                newState.setValues(new InternalValue[]{InternalValue.create(parentId.getUUID().toString())});
+                newState.setValues(new InternalValue[]{InternalValue.create(parentId.toString())});
             } else {
                 InternalValue[] newValues = new InternalValue[values.length];
                 for (int i = 0; i < values.length; i++) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Thu Jul  9 09:07:45 2009
@@ -339,7 +339,7 @@
             if (name.equals(NameConstants.JCR_UUID)) {
                 // jcr:uuid property
                 genValues = new InternalValue[]{
-                        InternalValue.create(thisState.getNodeId().getUUID().toString())
+                        InternalValue.create(thisState.getNodeId().toString())
                 };
             }
 /*

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java
Thu Jul  9 09:07:45 2009
@@ -112,7 +112,7 @@
             return true;
         }
         if (obj instanceof NodeReferencesId) {
-            return targetId.getUUID().equals(((NodeReferencesId) obj).targetId.getUUID());
+            return targetId.equals(((NodeReferencesId) obj).targetId);
         }
         return false;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
Thu Jul  9 09:07:45 2009
@@ -156,7 +156,7 @@
         if (buf == null) {
             buf = new StringBuffer();
         }
-        char[] chars = id.getUUID().toString().toCharArray();
+        char[] chars = id.toString().toCharArray();
         int cnt = 0;
         for (int i = 0; i < chars.length; i++) {
             if (chars[i] == '-') {
@@ -469,7 +469,7 @@
                 state.setType(PropertyType.STRING);
                 state.setDefinitionId(idJcrUUID);
                 state.setMultiValued(false);
-                state.setValues(new InternalValue[]{InternalValue.create(id.getParentId().getUUID().toString())});
+                state.setValues(new InternalValue[]{InternalValue.create(id.getParentId().toString())});
             } else if (id.getName().equals(NameConstants.JCR_PRIMARYTYPE)) {
                 state = createNew(id);
                 state.setType(PropertyType.NAME);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java
Thu Jul  9 09:07:45 2009
@@ -82,7 +82,7 @@
 
     private static String buildNodeFolderPath(NodeId id) {
         StringBuffer sb = new StringBuffer();
-        char[] chars = id.getUUID().toString().toCharArray();
+        char[] chars = id.toString().toCharArray();
         int cnt = 0;
         for (int i = 0; i < chars.length; i++) {
             if (chars[i] == '-') {
@@ -205,7 +205,7 @@
                 Serializer.deserialize(state, in);
                 return state;
             } catch (Exception e) {
-                String msg = "failed to read node state: " + id.getUUID();
+                String msg = "failed to read node state: " + id;
                 log.debug(msg);
                 throw new ItemStateException(msg, e);
             } finally {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/FileSystemBLOBStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/FileSystemBLOBStore.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/FileSystemBLOBStore.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/FileSystemBLOBStore.java
Thu Jul  9 09:07:45 2009
@@ -55,7 +55,7 @@
         // the blobId is an absolute file system path
         StringBuffer sb = new StringBuffer();
         sb.append(FileSystem.SEPARATOR_CHAR);
-        char[] chars = id.getParentId().getUUID().toString().toCharArray();
+        char[] chars = id.getParentId().toString().toCharArray();
         int cnt = 0;
         for (int i = 0; i < chars.length; i++) {
             if (chars[i] == '-') {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
Thu Jul  9 09:07:45 2009
@@ -169,7 +169,7 @@
      */
     private String buildNodeFolderPath(NodeId id) {
         StringBuffer sb = new StringBuffer();
-        char[] chars = id.getUUID().toString().toCharArray();
+        char[] chars = id.toString().toCharArray();
         int cnt = 0;
         for (int i = 0; i < nodePathTemplate.length(); i++) {
             char ch = nodePathTemplate.charAt(i);
@@ -224,7 +224,7 @@
             throw new ItemStateException(msg);
         }
         // check uuid
-        if (!state.getNodeId().getUUID().toString().equals(walker.getAttribute(UUID_ATTRIBUTE)))
{
+        if (!state.getNodeId().toString().equals(walker.getAttribute(UUID_ATTRIBUTE))) {
             String msg = "invalid serialized state: uuid mismatch";
             log.debug(msg);
             throw new ItemStateException(msg);
@@ -563,13 +563,13 @@
                     writer = new BufferedWriter(osw);
                 }
 
-                String parentId = (state.getParentId() == null) ? "" : state.getParentId().getUUID().toString();
+                String parentId = (state.getParentId() == null) ? "" : state.getParentId().toString();
                 String encodedNodeType = Text.encodeIllegalXMLCharacters(state.getNodeTypeName().toString());
                 writer.write("<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>\n");
                 writer.write("<" + NODE_ELEMENT + " "
-                        + UUID_ATTRIBUTE + "=\"" + id.getUUID() + "\" "
+                        + UUID_ATTRIBUTE + "=\"" + id + "\" "
                         + PARENTUUID_ATTRIBUTE + "=\"" + parentId + "\" "
-                        + DEFINITIONID_ATTRIBUTE + "=\"" + state.getDefinitionId().toString()
+ "\" "
+                        + DEFINITIONID_ATTRIBUTE + "=\"" + state.getDefinitionId() + "\"
"
                         + MODCOUNT_ATTRIBUTE + "=\"" + state.getModCount() + "\" "
                         + NODETYPE_ATTRIBUTE + "=\"" + encodedNodeType + "\">\n");
 
@@ -601,7 +601,7 @@
                     ChildNodeEntry entry = (ChildNodeEntry) iter.next();
                     writer.write("\t\t<" + NODE_ELEMENT + " "
                             + NAME_ATTRIBUTE + "=\"" + Text.encodeIllegalXMLCharacters(entry.getName().toString())
+ "\" "
-                            + UUID_ATTRIBUTE + "=\"" + entry.getId().getUUID().toString()
+ "\">\n");
+                            + UUID_ATTRIBUTE + "=\"" + entry.getId() + "\">\n");
                     writer.write("\t\t</" + NODE_ELEMENT + ">\n");
                 }
                 writer.write("\t</" + NODES_ELEMENT + ">\n");
@@ -655,7 +655,7 @@
                 writer.write("<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>\n");
                 writer.write("<" + PROPERTY_ELEMENT + " "
                         + NAME_ATTRIBUTE + "=\"" + Text.encodeIllegalXMLCharacters(state.getName().toString())
+ "\" "
-                        + PARENTUUID_ATTRIBUTE + "=\"" + state.getParentId().getUUID() +
"\" "
+                        + PARENTUUID_ATTRIBUTE + "=\"" + state.getParentId() + "\" "
                         + MULTIVALUED_ATTRIBUTE + "=\"" + Boolean.toString(state.isMultiValued())
+ "\" "
                         + DEFINITIONID_ATTRIBUTE + "=\"" + state.getDefinitionId().toString()
+ "\" "
                         + MODCOUNT_ATTRIBUTE + "=\"" + state.getModCount() + "\" "

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/OnWorkspaceInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/OnWorkspaceInconsistency.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/OnWorkspaceInconsistency.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/OnWorkspaceInconsistency.java
Thu Jul  9 09:07:45 2009
@@ -58,9 +58,9 @@
             log.error("Node {} ({}) has missing child '{}' ({})",
                     new Object[]{
                         resolver.getJCRPath(path),
-                        node.getNodeId().getUUID().toString(),
+                        node.getNodeId(),
                         resolver.getJCRName(child.getName()),
-                        child.getId().getUUID().toString()
+                        child.getId()
                     });
             throw exception;
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/AbstractExcerpt.java
Thu Jul  9 09:07:45 2009
@@ -83,7 +83,7 @@
         IndexReader reader = index.getIndexReader();
         try {
             checkRewritten(reader);
-            Term idTerm = new Term(FieldNames.UUID, id.getUUID().toString());
+            Term idTerm = new Term(FieldNames.UUID, id.toString());
             TermDocs tDocs = reader.termDocs(idTerm);
             int docNumber;
             Document doc;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ChildAxisQuery.java
Thu Jul  9 09:07:45 2009
@@ -645,7 +645,7 @@
                     }
                     while (entries.hasNext()) {
                         NodeId childId = ((ChildNodeEntry) entries.next()).getId();
-                        Term uuidTerm = new Term(FieldNames.UUID, childId.getUUID().toString());
+                        Term uuidTerm = new Term(FieldNames.UUID, childId.toString());
                         TermDocs docs = reader.termDocs(uuidTerm);
                         try {
                             if (docs.next()) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
Thu Jul  9 09:07:45 2009
@@ -846,7 +846,7 @@
                     try {
                         NodeId id = hmgr.resolveNodePath(session.getQPath(node.getStringValue()));
                         if (id != null) {
-                            query = new SimilarityQuery(id.getUUID().toString(), analyzer);
+                            query = new SimilarityQuery(id.toString(), analyzer);
                         } else {
                             query = new BooleanQuery();
                         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
Thu Jul  9 09:07:45 2009
@@ -185,7 +185,7 @@
         // special fields
         // UUID
         doc.add(new Field(
-                FieldNames.UUID, node.getNodeId().getUUID().toString(),
+                FieldNames.UUID, node.getNodeId().toString(),
                 Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS));
         try {
             // parent UUID

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryHitsQuery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryHitsQuery.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryHitsQuery.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryHitsQuery.java
Thu Jul  9 09:07:45 2009
@@ -193,7 +193,7 @@
             Set sortedDocs = new TreeSet();
             try {
                 while ((node = hits.nextScoreNode()) != null) {
-                    String uuid = node.getNodeId().getUUID().toString();
+                    String uuid = node.getNodeId().toString();
                     Term id = new Term(FieldNames.UUID, uuid);
                     TermDocs tDocs = reader.termDocs(id);
                     try {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=792464&r1=792463&r2=792464&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Thu Jul  9 09:07:45 2009
@@ -717,7 +717,7 @@
             IndexSearcher searcher = new IndexSearcher(reader);
             try {
                 Query q = new TermQuery(new Term(
-                        FieldNames.WEAK_REFS, id.getUUID().toString()));
+                        FieldNames.WEAK_REFS, id.toString()));
                 searcher.search(q, new HitCollector() {
                     public void collect(int doc, float score) {
                         docs.add(doc);



Mime
View raw message