sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1724420 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/factory/ main/java/org/apache/sis/referencing/factory/sql/ test/java/org/apache/sis/referencing/factory/
Date Wed, 13 Jan 2016 13:12:39 GMT
Author: desruisseaux
Date: Wed Jan 13 13:12:39 2016
New Revision: 1724420

URL: http://svn.apache.org/viewvc?rev=1724420&view=rev
Log:
Do not use NameFactory anymore for parsing the "AUTHORITY:CODE" value,
in order to avoid the synchronization and cache cost of the factory.
This also make the API more consistent.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/IdentifiedObjectFinderTest.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java?rev=1724420&r1=1724419&r2=1724420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java
[UTF-8] Wed Jan 13 13:12:39 2016
@@ -25,7 +25,6 @@ import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import javax.measure.unit.Unit;
 import javax.measure.quantity.Length;
-import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
@@ -44,8 +43,6 @@ import org.opengis.referencing.cs.Cartes
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.datum.DatumFactory;
 import org.opengis.referencing.datum.EngineeringDatum;
-import org.opengis.util.GenericName;
-import org.opengis.util.ScopedName;
 import org.apache.sis.internal.referencing.GeodeticObjectBuilder;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.internal.system.DefaultFactories;
@@ -247,11 +244,8 @@ public class CommonAuthorityFactory exte
 
     /**
      * Constructs a default factory for the {@code CRS} authority.
-     *
-     * @param nameFactory The factory to use for {@linkplain NameFactory#parseGenericName
parsing} authority codes.
      */
-    public CommonAuthorityFactory(final NameFactory nameFactory) {
-        super(nameFactory);
+    public CommonAuthorityFactory() {
         codes = new LinkedHashMap<>();
     }
 
@@ -293,13 +287,15 @@ public class CommonAuthorityFactory exte
      * other authority, throw an exception. Otherwise if the code has no authority, returns
the code as-is.
      */
     private String trimAuthority(String code) throws NoSuchAuthorityCodeException {
-        final GenericName name = nameFactory.parseGenericName(null, code);
-        if (name instanceof ScopedName) {
-            final GenericName scope = ((ScopedName) name).path();
-            if (!isCodeSpace(CharSequences.trimWhitespaces(scope.toString()))) {
+        int s = code.indexOf(DefaultNameSpace.DEFAULT_SEPARATOR);
+        if (s >= 0) {
+            final String scope = code.substring(0, s);
+            if (!isCodeSpace(CharSequences.trimWhitespaces(scope))) {
                 throw new NoSuchAuthorityCodeException(Errors.format(Errors.Keys.UnknownAuthority_1,
scope), Constants.OGC, code);
             }
-            code = name.tip().toString();
+            final int length = code.length();
+            s = CharSequences.skipLeadingWhitespaces(code, s+1, length);
+            code = code.substring(s, CharSequences.skipTrailingWhitespaces(code, s, length));
         }
         /*
          * Above code removed the "CRS" part when it is used as a namespace, as in "CRS:84".

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java?rev=1724420&r1=1724419&r2=1724420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
[UTF-8] Wed Jan 13 13:12:39 2016
@@ -39,7 +39,6 @@ import org.opengis.referencing.datum.*;
 import org.opengis.referencing.operation.*;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.NoSuchAuthorityCodeException;
-import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.extent.Extent;
@@ -246,10 +245,9 @@ public abstract class ConcurrentAuthorit
      * on experience gained.
      *
      * @param dataAccessClass The class of Data Access Object (DAO) created by {@link #newDataAccess()}.
-     * @param nameFactory The factory to use for {@linkplain NameFactory#parseGenericName
parsing} authority codes.
      */
-    protected ConcurrentAuthorityFactory(Class<DAO> dataAccessClass, NameFactory nameFactory)
{
-        this(dataAccessClass, nameFactory, 100, 8);
+    protected ConcurrentAuthorityFactory(Class<DAO> dataAccessClass) {
+        this(dataAccessClass, 100, 8);
         /*
          * NOTE: if the default maximum number of Data Access Objects (currently 8) is augmented,
          * make sure to augment the number of runner threads in the "StressTest" class to
a greater amount.
@@ -259,19 +257,17 @@ public abstract class ConcurrentAuthorit
     /**
      * Constructs an instance with the specified number of entries to keep by strong references.
      * If a number of object greater than {@code maxStrongReferences} are created, then the
strong references
-     * for the eldest ones will be replaced by weak references.
+     * for the eldest objects will be replaced by weak references.
      *
      * @param dataAccessClass The class of Data Access Object (DAO) created by {@link #newDataAccess()}.
-     * @param nameFactory The factory to use for {@linkplain NameFactory#parseGenericName
parsing} authority codes.
      * @param maxStrongReferences The maximum number of objects to keep by strong reference.
      * @param maxConcurrentQueries The maximal amount of Data Access Objects to use concurrently.
      *        If more than this amount of threads are querying this {@code ConcurrentAuthorityFactory}
concurrently,
      *        additional threads will be blocked until a Data Access Object become available.
      */
     protected ConcurrentAuthorityFactory(final Class<DAO> dataAccessClass,
-            final NameFactory nameFactory, final int maxStrongReferences, final int maxConcurrentQueries)
+            final int maxStrongReferences, final int maxConcurrentQueries)
     {
-        super(nameFactory);
         ArgumentChecks.ensureNonNull("dataAccessClass", dataAccessClass);
         ArgumentChecks.ensurePositive("maxStrongReferences", maxStrongReferences);
         ArgumentChecks.ensureStrictlyPositive("maxConcurrentQueries", maxConcurrentQueries);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java?rev=1724420&r1=1724419&r2=1724420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
[UTF-8] Wed Jan 13 13:12:39 2016
@@ -28,18 +28,14 @@ import org.opengis.metadata.Identifier;
 import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.parameter.ParameterDescriptor;
-import org.opengis.util.ScopedName;
-import org.opengis.util.GenericName;
-import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
 import org.opengis.util.InternationalString;
 import org.apache.sis.internal.util.Citations;
 import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.util.iso.SimpleInternationalString;
+import org.apache.sis.util.iso.DefaultNameSpace;
 import org.apache.sis.util.iso.AbstractFactory;
-import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.util.resources.Errors;
-import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.Debug;
@@ -69,47 +65,9 @@ import org.apache.sis.util.Debug;
  */
 public abstract class GeodeticAuthorityFactory extends AbstractFactory implements AuthorityFactory
{
     /**
-     * The factory to use for parsing authority codes as {@link GenericName} instances.
-     *
-     * <div class="note"><b>Example:</b>
-     * This factory can be used as below:
-     *
-     * {@preformat java
-     *     public Foo createFoo(String code) {
-     *         GenericName name = nameFactory.parseGenericName(null, code);
-     *         if (name instanceof ScopedName) {
-     *             GenericName scope = ((ScopedName) name).path();
-     *             if (!MY_AUTHORITY.equals(scope.toString())) {
-     *                 throw new NoSuchAuthorityCodeException("Not a code managed by MyAuthority.",
"MyAuthority", code);
-     *             }
-     *         }
-     *         code = name.tip().toString();
-     *         // From this point, the code is local to this factory namespace.
-     *     }
-     * }</div>
-     *
-     * Subclasses may also use this factory for creating {@linkplain AbstractIdentifiedObject#getAlias()
aliases}.
-     */
-    protected final NameFactory nameFactory;
-
-    /**
      * Creates a new authority factory for geodetic objects.
-     *
-     * @param nameFactory The factory to use for {@linkplain NameFactory#parseGenericName
parsing} authority codes.
      */
-    protected GeodeticAuthorityFactory(final NameFactory nameFactory) {
-        ArgumentChecks.ensureNonNull("nameFactory", nameFactory);
-        this.nameFactory = nameFactory;
-    }
-
-    /**
-     * Creates a new authority factory with the same configuration than the given factory.
-     *
-     * @param parent The factory from which to copy the configuration.
-     */
-    protected GeodeticAuthorityFactory(final GeodeticAuthorityFactory parent) {
-        ArgumentChecks.ensureNonNull("parent", parent);
-        nameFactory = parent.nameFactory;
+    protected GeodeticAuthorityFactory() {
     }
 
     /**
@@ -1167,44 +1125,39 @@ public abstract class GeodeticAuthorityF
     }
 
     /**
-     * Trims the authority scope, if presents. For example if this factory is an EPSG authority
factory
+     * Trims the authority scope, if present. For example if this factory is an EPSG authority
factory
      * and the specified code start with the {@code "EPSG:"} prefix, then the prefix is removed.
      * Otherwise, the string is returned unchanged (except for leading and trailing spaces).
      *
      * @param  code The code to trim.
-     * @return The code without the authority scope.
+     * @param  authority The authority factory, or {@code null} for {@link #getAuthority()}.
+     * @return The code with the authority part removed if that part matched the expected
authority.
      */
-    final String trimAuthority(String code, Citation authority) {
-        final GenericName name = nameFactory.parseGenericName(null, code);
-        if (name instanceof ScopedName) {
-            final GenericName scope = ((ScopedName) name).path();
+    final String trimAuthority(final String code, Citation authority) {
+        int s = code.indexOf(DefaultNameSpace.DEFAULT_SEPARATOR);
+        if (s >= 0) {
             if (authority == null) {
                 authority = getAuthority();     // Costly operation for EPSGDataAccess.
             }
-            if (Citations.identifierMatches(authority, null, scope.toString())) {    // Comparison
ignores spaces.
-                code = name.tip().toString();
+            if (Citations.identifierMatches(authority, null, code.substring(0, s))) {   
// Comparison ignores spaces.
+                final int n = code.indexOf(DefaultNameSpace.DEFAULT_SEPARATOR, s + 1);
+                if (n >= 0) {
+                    /*
+                     * The separator sometime appears twice, as in "EPSG::4326" or "EPSG:8.8:4326".
+                     * The part between the two separators is the verion number, which we
ignore in
+                     * this simple version.
+                     */
+                    s = n;
+                }
+                final int length = code.length();
+                s = CharSequences.skipLeadingWhitespaces(code, s+1, length);
+                return code.substring(s, CharSequences.skipTrailingWhitespaces(code, s, length));
             }
         }
         return CharSequences.trimWhitespaces(code);
     }
 
     /**
-     * Creates an exception for an unknown authority code.
-     * This convenience method is provided for implementation of {@code createFoo(String)}
methods in subclasses.
-     *
-     * @param  type  The GeoAPI interface of the requested object (e.g. {@code CoordinateReferenceSystem.class}).
-     * @param  code  The unknown authority code.
-     * @return An exception initialized with an error message built from the specified informations.
-     */
-    final NoSuchAuthorityCodeException noSuchAuthorityCode(final Class<?> type, final
String code) {
-        final Citation authority = getAuthority();
-        final String name = Citations.getIdentifier(authority, false);
-        return new NoSuchAuthorityCodeException(Errors.format(Errors.Keys.NoSuchAuthorityCode_3,
-                   (name != null) ? name : Vocabulary.formatInternational(Vocabulary.Keys.Untitled),
-                   type, code), name, trimAuthority(code, authority), code);
-    }
-
-    /**
      * Casts the given object to the given type, or throws an exception if the object can
not be casted.
      * This convenience method is provided for implementation of {@code createXXX} methods.
      *

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java?rev=1724420&r1=1724419&r2=1724420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
[UTF-8] Wed Jan 13 13:12:39 2016
@@ -155,8 +155,9 @@ public class EPSGDataAccess extends Geod
 {
     /**
      * The namespace of EPSG names and codes. This namespace is needed by all {@code createFoo(String)}
methods.
-     * The {@code EPSGDataAccess} constructor relies on the {@link #nameFactory} caching
mechanism for giving us
-     * the same {@code NameSpace} instance than the one used by previous {@code EPSGDataAccess}
instances, if any.
+     * The {@code EPSGDataAccess} constructor relies on the {@link EPSGFactory#nameFactory}
caching mechanism
+     * for giving us the same {@code NameSpace} instance than the one used by previous {@code
EPSGDataAccess}
+     * instances, if any.
      */
     private final NameSpace namespace;
 
@@ -301,13 +302,13 @@ public class EPSGDataAccess extends Geod
      * @see EPSGFactory#newDataAccess(Connection, SQLTranslator)
      */
     protected EPSGDataAccess(final EPSGFactory parent, final Connection connection, final
SQLTranslator translator) {
-        super(parent);
         ArgumentChecks.ensureNonNull("connection", connection);
         ArgumentChecks.ensureNonNull("translator", translator);
         this.parent     = parent;
         this.connection = connection;
         this.translator = translator;
-        this.namespace  = nameFactory.createNameSpace(nameFactory.createLocalName(null, Constants.IOGP),
null);
+        this.namespace  = parent.nameFactory.createNameSpace(
+                          parent.nameFactory.createLocalName(null, Constants.IOGP), null);
     }
 
     /**
@@ -983,7 +984,7 @@ addURIs:    for (int i=0; ; i++) {
         final InternationalString edition = authority.getEdition();
         final String version = (edition != null) ? edition.toString() : null;
         if (name != null) {
-            gn = nameFactory.createGenericName(namespace, Constants.EPSG, name);
+            gn = parent.nameFactory.createGenericName(namespace, Constants.EPSG, name);
             properties.put("name", gn);
             properties.put(NamedIdentifier.CODE_KEY,      name);
             properties.put(NamedIdentifier.VERSION_KEY,   version);
@@ -1025,11 +1026,12 @@ addURIs:    for (int i=0; ; i++) {
                     if (naming != null) {
                         ns = namingSystems.get(naming);
                         if (ns == null) {
-                            ns = nameFactory.createNameSpace(nameFactory.createLocalName(null,
naming), null);
+                            ns = parent.nameFactory.createNameSpace(
+                                 parent.nameFactory.createLocalName(null, naming), null);
                             namingSystems.put(naming, ns);
                         }
                     }
-                    aliases.add(nameFactory.createLocalName(ns, alias));
+                    aliases.add(parent.nameFactory.createLocalName(ns, alias));
                 }
             }
         }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java?rev=1724420&r1=1724419&r2=1724420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
[UTF-8] Wed Jan 13 13:12:39 2016
@@ -64,6 +64,11 @@ public class EPSGFactory extends Concurr
     protected final DataSource dataSource;
 
     /**
+     * The factory to use for creating {@link org.opengis.util.GenericName} instances.
+     */
+    protected final NameFactory nameFactory;
+
+    /**
      * The factory to use for creating {@link org.opengis.referencing.datum.Datum} instances
      * from the properties read in the database.
      */
@@ -124,7 +129,7 @@ public class EPSGFactory extends Concurr
      * Those default values are implementation-specific and may change in any future SIS
version.
      *
      * @param dataSource    The factory to use for creating {@link Connection}s to the EPSG
database.
-     * @param nameFactory   The factory to use for creating authority codes as {@link GenericName}
instances.
+     * @param nameFactory   The factory to use for creating {@link org.opengis.util.GenericName}
instances.
      * @param datumFactory  The factory to use for creating {@link Datum} instances.
      * @param csFactory     The factory to use for creating {@link CoordinateSystem} instances.
      * @param crsFactory    The factory to use for creating {@link CoordinateReferenceSystem}
instances.
@@ -144,7 +149,7 @@ public class EPSGFactory extends Concurr
                        final SQLTranslator              translator)
             throws FactoryException
     {
-        super(EPSGDataAccess.class, factory(NameFactory.class, nameFactory));
+        super(EPSGDataAccess.class);
         if (dataSource != null) {
             this.dataSource = dataSource;
         } else try {
@@ -155,6 +160,7 @@ public class EPSGFactory extends Concurr
         } catch (Exception e) {
             throw new UnavailableFactoryException(e.getLocalizedMessage(), e);
         }
+        this.nameFactory  = factory(NameFactory.class, nameFactory);
         this.datumFactory = factory(DatumFactory.class, datumFactory);
         this.csFactory    = factory(CSFactory.class, csFactory);
         this.crsFactory   = factory(CRSFactory.class, crsFactory);

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java?rev=1724420&r1=1724419&r2=1724420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java
[UTF-8] Wed Jan 13 13:12:39 2016
@@ -16,13 +16,11 @@
  */
 package org.apache.sis.referencing.factory;
 
-import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.AuthorityFactory;
 import org.opengis.referencing.datum.GeodeticDatum;
 import org.opengis.referencing.crs.*;
-import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.referencing.datum.DefaultGeodeticDatum;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
 import org.apache.sis.referencing.crs.DefaultProjectedCRS;
@@ -80,7 +78,7 @@ public final strictfp class AuthorityFac
      */
     @Test
     public void testCreateFromAPI() throws FactoryException {
-        final CRSAuthorityFactory factory = new CommonAuthorityFactory(DefaultFactories.forBuildin(NameFactory.class));
+        final CRSAuthorityFactory factory = new CommonAuthorityFactory();
         final CoordinateReferenceSystem expected = factory.createCoordinateReferenceSystem("83");
         AuthorityFactoryProxy<?> proxy;
         /*

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java?rev=1724420&r1=1724419&r2=1724420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
[UTF-8] Wed Jan 13 13:12:39 2016
@@ -19,7 +19,6 @@ package org.apache.sis.referencing.facto
 import java.util.Arrays;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
-import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.parameter.ParameterValueGroup;
@@ -32,7 +31,6 @@ import org.opengis.referencing.crs.Verti
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.datum.Datum;
 import org.apache.sis.internal.util.Constants;
-import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.referencing.provider.TransverseMercator;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.referencing.CommonCRS;
@@ -66,7 +64,7 @@ public final strictfp class CommonAuthor
      * Initializes the factory to test.
      */
     public CommonAuthorityFactoryTest() {
-        factory = new CommonAuthorityFactory(DefaultFactories.forBuildin(NameFactory.class));
+        factory = new CommonAuthorityFactory();
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/IdentifiedObjectFinderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/IdentifiedObjectFinderTest.java?rev=1724420&r1=1724419&r2=1724420&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/IdentifiedObjectFinderTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/IdentifiedObjectFinderTest.java
[UTF-8] Wed Jan 13 13:12:39 2016
@@ -17,13 +17,11 @@
 package org.apache.sis.referencing.factory;
 
 import java.util.Collections;
-import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.crs.CRSAuthorityFactory;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.referencing.crs.GeographicCRS;
-import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
 
 // Test imports
@@ -55,7 +53,7 @@ public final strictfp class IdentifiedOb
      * Initializes the factory to test.
      */
     public IdentifiedObjectFinderTest() {
-        factory = new CommonAuthorityFactory(DefaultFactories.forBuildin(NameFactory.class));
+        factory = new CommonAuthorityFactory();
     }
 
     /**
@@ -117,7 +115,7 @@ public final strictfp class IdentifiedOb
         private final GeodeticAuthorityFactory factory;
 
         public Cached(final GeodeticAuthorityFactory factory) {
-            super(GeodeticAuthorityFactory.class, factory.nameFactory);
+            super(GeodeticAuthorityFactory.class);
             this.factory = factory;
         }
 



Mime
View raw message