jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1458183 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Date Tue, 19 Mar 2013 09:21:05 GMT
Author: mreutegg
Date: Tue Mar 19 09:21:04 2013
New Revision: 1458183

URL: http://svn.apache.org/r1458183
Log:
OAK-701: Optimize Session.getNamespacePrefixes()

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1458183&r1=1458182&r2=1458183&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Tue Mar 19 09:21:04 2013
@@ -484,6 +484,11 @@ public class SessionImpl extends Abstrac
 
     @Override
     public String[] getNamespacePrefixes() throws RepositoryException {
+        synchronized (namespaces) {
+            if (namespaces.isEmpty()) {
+                return getWorkspace().getNamespaceRegistry().getPrefixes();
+            }
+        }
         Set<String> uris = new HashSet<String>();
         uris.addAll(Arrays.asList(getWorkspace().getNamespaceRegistry().getURIs()));
         synchronized (namespaces) {



Mime
View raw message