jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1814555 - /jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/util/RepositoryProvider.java
Date Wed, 08 Nov 2017 04:47:21 GMT
Author: tripod
Date: Wed Nov  8 04:47:21 2017
New Revision: 1814555

URL: http://svn.apache.org/viewvc?rev=1814555&view=rev
Log:
JCRVLT-226 vlt doesn't work with java 9

Modified:
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/util/RepositoryProvider.java

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/util/RepositoryProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/util/RepositoryProvider.java?rev=1814555&r1=1814554&r2=1814555&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/util/RepositoryProvider.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/util/RepositoryProvider.java
Wed Nov  8 04:47:21 2017
@@ -23,9 +23,9 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
+import java.util.ServiceLoader;
 import java.util.Set;
 
-import javax.imageio.spi.ServiceRegistry;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 
@@ -42,8 +42,7 @@ public class RepositoryProvider {
 
     protected static Logger log = LoggerFactory.getLogger(RepositoryProvider.class);
 
-    private Map<RepositoryAddress, Repository> repos
-            = new HashMap<RepositoryAddress, Repository>();
+    private Map<RepositoryAddress, Repository> repos = new HashMap<RepositoryAddress,
Repository>();
 
     public Repository getRepository(RepositoryAddress address)
             throws RepositoryException {
@@ -57,7 +56,8 @@ public class RepositoryProvider {
 
     private Repository createRepository(RepositoryAddress address)
             throws RepositoryException {
-        Iterator<RepositoryFactory> iter = ServiceRegistry.lookupProviders(RepositoryFactory.class);
+        ServiceLoader<RepositoryFactory> loader = ServiceLoader.load(RepositoryFactory.class);
+        Iterator<RepositoryFactory> iter = loader.iterator();
         Set<String> supported = new HashSet<String>();
         while (iter.hasNext()) {
             RepositoryFactory fac = iter.next();



Mime
View raw message