jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r628271 - in /jackrabbit/branches/1.4/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/ test/java/org/apache/jackrabbit/core/
Date Sat, 16 Feb 2008 11:52:09 GMT
Author: jukka
Date: Sat Feb 16 03:52:07 2008
New Revision: 628271

URL: http://svn.apache.org/viewvc?rev=628271&view=rev
Log:
1.4: Merged revision 627461 (JCR-1380)

Added:
    jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/CachingHierarchyManagerTest.java
      - copied unchanged from r627461, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/CachingHierarchyManagerTest.java
Modified:
    jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
    jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java?rev=628271&r1=628270&r2=628271&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/CachingHierarchyManager.java
Sat Feb 16 03:52:07 2008
@@ -193,7 +193,9 @@
         } else {
             LRUEntry entry = (LRUEntry) element.get();
             if (element.hasPath(path)) {
-                entry.touch();
+                synchronized (cacheMonitor) {
+                    entry.touch();
+                }
                 return entry.getId();
             }
             // first try to resolve node path, then property path
@@ -749,24 +751,26 @@
      * @param ps print stream to dump to
      */
     public void dump(final PrintStream ps) {
-        pathCache.traverse(new PathMap.ElementVisitor() {
-            public void elementVisited(PathMap.Element element) {
-                StringBuffer line = new StringBuffer();
-                for (int i = 0; i < element.getDepth(); i++) {
-                    line.append("--");
-                }
-                line.append(element.getName());
-                int index = element.getIndex();
-                if (index != 0 && index != 1) {
-                    line.append('[');
-                    line.append(index);
-                    line.append(']');
-                }
-                line.append("  ");
-                line.append(element.get());
-                ps.println(line.toString());
-            }
-        }, true);
+        synchronized (cacheMonitor) {
+            pathCache.traverse(new PathMap.ElementVisitor() {
+                public void elementVisited(PathMap.Element element) {
+                    StringBuffer line = new StringBuffer();
+                    for (int i = 0; i < element.getDepth(); i++) {
+                        line.append("--");
+                    }
+                    line.append(element.getName());
+                    int index = element.getIndex();
+                    if (index != 0 && index != 1) {
+                        line.append('[');
+                        line.append(index);
+                        line.append(']');
+                    }
+                    line.append("  ");
+                    line.append(element.get());
+                    ps.println(line.toString());
+                }
+            }, true);
+        }
     }
 
     /**

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java?rev=628271&r1=628270&r2=628271&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/TestAll.java
Sat Feb 16 03:52:07 2008
@@ -32,6 +32,7 @@
     public static Test suite() {
         TestSuite suite = new TestSuite("Core tests");
 
+        suite.addTestSuite(CachingHierarchyManagerTest.class);
         suite.addTestSuite(NamespaceRegistryImplTest.class);
         suite.addTestSuite(TransientRepositoryTest.class);
         suite.addTestSuite(XATest.class);



Mime
View raw message