jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject svn commit: r1807321 - in /jackrabbit/trunk: jackrabbit-jcr-client/src/test/java/org/apache/jackrabbit/client/ jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/ jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/...
Date Tue, 05 Sep 2017 08:41:23 GMT
Author: rombert
Date: Tue Sep  5 08:41:23 2017
New Revision: 1807321

URL: http://svn.apache.org/viewvc?rev=1807321&view=rev
Log:
JCR-4179 - Test failures with Java 9 when using javax.imageio.spi.ServiceRegistry

Switched from javax.imageio.spi.ServiceRegistry to java.util.ServiceLoader

Modified:
    jackrabbit/trunk/jackrabbit-jcr-client/src/test/java/org/apache/jackrabbit/client/RepositoryFactoryTest.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilderRegistry.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilderRegistry.java

Modified: jackrabbit/trunk/jackrabbit-jcr-client/src/test/java/org/apache/jackrabbit/client/RepositoryFactoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-client/src/test/java/org/apache/jackrabbit/client/RepositoryFactoryTest.java?rev=1807321&r1=1807320&r2=1807321&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-client/src/test/java/org/apache/jackrabbit/client/RepositoryFactoryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-client/src/test/java/org/apache/jackrabbit/client/RepositoryFactoryTest.java
Tue Sep  5 08:41:23 2017
@@ -21,9 +21,9 @@ import org.slf4j.LoggerFactory;
 import junit.framework.TestCase;
 
 import java.util.Iterator;
+import java.util.ServiceLoader;
 
 import javax.jcr.RepositoryFactory;
-import javax.imageio.spi.ServiceRegistry;
 
 /**
  * <code>RepositoryFactoryTest</code>...
@@ -36,7 +36,7 @@ public class RepositoryFactoryTest exten
     private static final Logger log = LoggerFactory.getLogger(RepositoryFactoryTest.class);
 
     public void testGetFactory() {
-        Iterator it = ServiceRegistry.lookupProviders(RepositoryFactory.class);
+        Iterator<RepositoryFactory> it = ServiceLoader.load(RepositoryFactory.class).iterator();
         if (it.hasNext()) {
             RepositoryFactory rf = (RepositoryFactory) it.next();
             assertTrue(rf instanceof RepositoryFactoryImpl);

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java?rev=1807321&r1=1807320&r2=1807321&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/JcrUtils.java
Tue Sep  5 08:41:23 2017
@@ -32,9 +32,9 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.ServiceLoader;
 import java.util.StringTokenizer;
 
-import javax.imageio.spi.ServiceRegistry;
 import javax.jcr.Binary;
 import javax.jcr.Item;
 import javax.jcr.Node;
@@ -187,7 +187,7 @@ public class JcrUtils {
         log.append(newline);
         log.append("The following RepositoryFactory classes were consulted:");
         Iterator<RepositoryFactory> iterator =
-                ServiceRegistry.lookupProviders(RepositoryFactory.class);
+                ServiceLoader.load(RepositoryFactory.class).iterator();
         while (iterator.hasNext()) {
             RepositoryFactory factory = iterator.next();
             log.append(newline);

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilderRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilderRegistry.java?rev=1807321&r1=1807320&r2=1807321&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilderRegistry.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/query/QueryObjectModelBuilderRegistry.java
Tue Sep  5 08:41:23 2017
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.commons.query;
 
 import java.util.List;
+import java.util.ServiceLoader;
 import java.util.ArrayList;
 import java.util.Set;
 import java.util.HashSet;
@@ -24,7 +25,6 @@ import java.util.Iterator;
 import java.util.Arrays;
 import java.util.Collections;
 
-import javax.imageio.spi.ServiceRegistry;
 import javax.jcr.query.InvalidQueryException;
 
 /**
@@ -44,8 +44,8 @@ public class QueryObjectModelBuilderRegi
 
     static {
         Set<String> languages = new HashSet<String>();
-        Iterator<QueryObjectModelBuilder> it = ServiceRegistry.lookupProviders(QueryObjectModelBuilder.class,
-                QueryObjectModelBuilder.class.getClassLoader());
+        Iterator<QueryObjectModelBuilder> it = ServiceLoader.load(QueryObjectModelBuilder.class,
+                QueryObjectModelBuilder.class.getClassLoader()).iterator();
         while (it.hasNext()) {
             QueryObjectModelBuilder builder = it.next();
             BUILDERS.add(builder);

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilderRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilderRegistry.java?rev=1807321&r1=1807320&r2=1807321&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilderRegistry.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/QueryTreeBuilderRegistry.java
Tue Sep  5 08:41:23 2017
@@ -19,13 +19,13 @@ package org.apache.jackrabbit.spi.common
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.imageio.spi.ServiceRegistry;
 import javax.jcr.query.InvalidQueryException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.ServiceLoader;
 import java.util.Iterator;
 import java.util.Set;
 
@@ -52,8 +52,8 @@ public class QueryTreeBuilderRegistry {
     static {
         Set languages = new HashSet();
         try {
-            Iterator it = ServiceRegistry.lookupProviders(QueryTreeBuilder.class,
-                    QueryTreeBuilderRegistry.class.getClassLoader());
+            Iterator it = ServiceLoader.load(QueryTreeBuilder.class,
+                    QueryTreeBuilderRegistry.class.getClassLoader()).iterator();
             while (it.hasNext()) {
                 QueryTreeBuilder qtb = (QueryTreeBuilder) it.next();
                 BUILDERS.add(qtb);



Mime
View raw message