sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1727005 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/metadata/iso/ sis-referencing/src/main/java/org/apache/sis/referencing/ sis-referencing/src/main/java/org/apache/sis/referencing/factory/ sis-referencing/src/t...
Date Wed, 27 Jan 2016 11:43:15 GMT
Author: desruisseaux
Date: Wed Jan 27 11:43:15 2016
New Revision: 1727005

URL: http://svn.apache.org/viewvc?rev=1727005&view=rev
Log:
Add an optional 'authority' parameter to CRS.getAuthorityFactory and IdentifiedObjects.newFinder.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.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/MultiAuthoritiesFactory.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java?rev=1727005&r1=1727004&r2=1727005&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
[UTF-8] Wed Jan 27 11:43:15 2016
@@ -81,6 +81,7 @@ import org.apache.sis.internal.util.Cita
  * @module
  *
  * @see ImmutableIdentifier
+ * @see org.apache.sis.referencing.IdentifiedObjects#toURN(Class, Identifier)
  */
 @XmlType(name = "MD_Identifier_Type", propOrder = {
     "authority",

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1727005&r1=1727004&r2=1727005&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
[UTF-8] Wed Jan 27 11:43:15 2016
@@ -126,6 +126,7 @@ import java.util.Objects;
  * @module
  *
  * @see DefaultIdentifier
+ * @see org.apache.sis.referencing.IdentifiedObjects#toURN(Class, Identifier)
  */
 @XmlType(name = "RS_Identifier_Type", propOrder = {
     "authority",

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java?rev=1727005&r1=1727004&r2=1727005&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
[UTF-8] Wed Jan 27 11:43:15 2016
@@ -131,15 +131,15 @@ public final class CRS extends Static {
      *   <li>{@code "http://www.opengis.net/gml/srs/epsg.xml#4326"}</li>
      * </ul>
      *
-     * The {@link IdentifiedObjects#lookupURN(IdentifiedObject, Citation)} method can be
seen
-     * as a converse of this method.
+     * Note that the {@link IdentifiedObjects#lookupURN(IdentifiedObject, Citation)}
+     * method can be seen as a converse of this method.
      *
      * @param  code The authority code.
      * @return The Coordinate Reference System for the given authority code.
      * @throws NoSuchAuthorityCodeException If there is no known CRS associated to the given
code.
      * @throws FactoryException if the CRS creation failed for an other reason.
      *
-     * @see #getAuthorityFactory()
+     * @see #getAuthorityFactory(String)
      * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory
      *
      * @category factory
@@ -552,31 +552,39 @@ check:  while (lower != 0 || upper != di
 
     /**
      * Returns the system-wide authority factory used by {@link #forCode(String)} and other
SIS methods.
-     * By default, this method returns an instance of {@link org.apache.sis.referencing.factory.MultiAuthoritiesFactory}
-     * capable to process at least some EPSG and WMS codes. The set of EPSG codes that are
guaranteed to be supported
-     * is listed in the {@link #forCode(String)} method javadoc.
-     * Other authorities may also be supported if their factories are declared in the following
file:
+     * If the given authority is non-null, then this method returns a factory specifically
for that authority.
+     * Otherwise, this method returns the {@link org.apache.sis.referencing.factory.MultiAuthoritiesFactory}
+     * instance that manages all other factories.
+     *
+     * <p>The {@code authority} argument can be {@code "EPSG"}, {@code "WMS"} or any
other authority found
+     * on the classpath. In the {@code "EPSG"} case, whether the full set of EPSG codes is
supported or not
+     * depends on whether a {@linkplain org.apache.sis.referencing.factory.sql connection
to the database}
+     * can be established. If no connection can be established, then this method returns
a small embedded
+     * EPSG factory containing at least the CRS defined in the {@link #forCode(String)} method
javadoc.</p>
+     *
+     * <p>User-defined authorities can be added to the SIS environment by creating
a {@code CRSAuthorityFactory}
+     * implementation with a public no-argument constructor, and declaring the fully-qualified
name of that class
+     * in a file at the following location:</p>
      *
      * {@preformat text
      *     META-INF/services/org.opengis.referencing.crs.CRSAuthorityFactory
      * }
      *
-     * <div class="section">Factories of other kinds</div>
-     * By default the returned factory can also be used as
-     * {@link org.opengis.referencing.cs.CSAuthorityFactory},
-     * {@link org.opengis.referencing.datum.DatumAuthorityFactory} or
-     * {@link org.opengis.referencing.operation.CoordinateOperationAuthorityFactory}.
-     * However callers are encouraged to verify the type before to cast
-     * since a future SIS version may allow users to set a custom factory.
-     *
-     * @return The system-wide authority factory used by SIS.
+     * @param  authority The authority of the desired factory (typically {@code "EPSG"} or
{@code "WMS"}),
+     *         or {@code null} for the {@link org.apache.sis.referencing.factory.MultiAuthoritiesFactory}
+     *         instance that manage all factories.
+     * @return The system-wide authority factory used by SIS for the given authority.
+     * @throws FactoryException if no factory can be returned for the given authority.
      *
      * @see #forCode(String)
      * @see org.apache.sis.referencing.factory.MultiAuthoritiesFactory
      *
      * @since 0.7
      */
-    public static CRSAuthorityFactory getAuthorityFactory() {
-        return AuthorityFactories.ALL;
+    public static CRSAuthorityFactory getAuthorityFactory(final String authority) throws
FactoryException {
+        if (authority == null) {
+            return AuthorityFactories.ALL;
+        }
+        return AuthorityFactories.ALL.getAuthorityFactory(CRSAuthorityFactory.class, authority,
null);
     }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java?rev=1727005&r1=1727004&r2=1727005&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
[UTF-8] Wed Jan 27 11:43:15 2016
@@ -35,11 +35,13 @@ import org.apache.sis.util.CharSequences
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.iso.DefaultNameSpace;
+import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.internal.metadata.NameMeaning;
 import org.apache.sis.internal.metadata.NameToIdentifier;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.referencing.factory.IdentifiedObjectFinder;
+import org.apache.sis.referencing.factory.GeodeticAuthorityFactory;
 
 import static org.apache.sis.internal.util.Citations.iterator;
 import static org.apache.sis.internal.util.Citations.identifierMatches;
@@ -381,8 +383,8 @@ public final class IdentifiedObjects ext
      * If the given object declares explicitly an identifier, then this method will instantiate
an object from the
      * authority factory using that identifier and compare it with the given object. If the
comparison fails, then
      * this method returns {@code null}. Consequently this method may return {@code null}
even if the given object
-     * declares explicitly its identifier. If the declared identifier is wanted unconditionally,
use the following
-     * pattern instead:
+     * declares explicitly its identifier. If the declared identifier is wanted unconditionally,
+     * one can use the following pattern instead:
      *
      * {@preformat java
      *     String urn = toURN(object.getClass(), getIdentifier(object, authority));
@@ -397,7 +399,7 @@ public final class IdentifiedObjects ext
      * @return The identifier, or {@code null} if none was found without ambiguity or if
the given object was null.
      * @throws FactoryException if an error occurred during the search.
      *
-     * @see #newFinder()
+     * @see #newFinder(String)
      * @see #toURN(Class, Identifier)
      *
      * @since 0.7
@@ -405,7 +407,7 @@ public final class IdentifiedObjects ext
     public static String lookupURN(final IdentifiedObject object, final Citation authority)
throws FactoryException {
         String urn = null;
         if (object != null) {
-            for (final IdentifiedObject candidate : newFinder().find(object)) {
+            for (final IdentifiedObject candidate : newFinder(null).find(object)) {
                 final String c = toURN(candidate.getClass(), getIdentifier(candidate, authority));
                 if (c != null) {
                     if (urn != null && !urn.equals(c)) {
@@ -428,8 +430,8 @@ public final class IdentifiedObjects ext
      * If the given object declares explicitly an identifier, then this method will instantiate
an object from the
      * EPSG factory using that identifier and compare it with the given object. If the comparison
fails, then this
      * method returns {@code null}. Consequently this method may return {@code null} even
if the given object
-     * declares explicitly its identifier. If the declared identifier is wanted unconditionally,
use the following
-     * pattern instead:
+     * declares explicitly its identifier. If the declared identifier is wanted unconditionally,
+     * one can use the following pattern instead:
      *
      * {@preformat java
      *     String code = toString(getIdentifier(object, Citations.EPSG));
@@ -442,14 +444,14 @@ public final class IdentifiedObjects ext
      * @return The EPSG code, or {@code null} if none was found without ambiguity or if the
given object was null.
      * @throws FactoryException if an error occurred during the search.
      *
-     * @see #newFinder()
+     * @see #newFinder(String)
      *
      * @since 0.7
      */
     public static Integer lookupEPSG(final IdentifiedObject object) throws FactoryException
{
         Integer code = null;
         if (object != null) {
-            for (final IdentifiedObject candidate : newFinder().find(object)) {
+            for (final IdentifiedObject candidate : newFinder(Constants.EPSG).find(object))
{
                 final Identifier id = getIdentifier(candidate, Citations.EPSG);
                 if (id != null) try {
                     Integer previous = code;
@@ -471,39 +473,45 @@ public final class IdentifiedObjects ext
      *
      * <div class="note"><b>Example 1: be lenient regarding axis order</b><br>
      * By default, {@code lookup(…)} methods require that objects in the dataset have their
axes in the
-     * same order than the given object. For relaxing this condition, one can use the following
Java code:
+     * same order than the given object. For relaxing this condition, one can use the following
Java code.
+     * This example assumes that at most one object from the dataset will match the given
object.
+     * If more than one object may match, then the call to {@code findSingleton(…)} should
be replaced
+     * by {@code find(…)}.
      *
      * {@preformat java
-     *     IdentifiedObjectFinder finder = IdentifiedObjects.newFinder();
+     *     IdentifiedObjectFinder finder = IdentifiedObjects.newFinder(null);
      *     finder.setIgnoringAxes(true);
      *     IdentifiedObject found = finder.findSingleton(object);
-     * }
-     *
-     * This example assumes that at most one object from the dataset will match the given
object.
-     * If more than one object may match, then the call to {@code findSingleton(…)} should
be replaced
-     * by {@code find(…)}.</div>
+     * }</div>
      *
      * <div class="note"><b>Example 2: extend the search to deprecated definitions</b><br>
      * By default, {@code lookup(…)} methods exclude deprecated objects from the search.
      * To search also among deprecated objects, one can use the following Java code:
+     * This example does not use the {@code findSingleton(…)} convenience method on the
assumption
+     * that the search may find both deprecated and non-deprecated objects.
      *
      * {@preformat java
-     *     IdentifiedObjectFinder finder = IdentifiedObjects.newFinder();
+     *     IdentifiedObjectFinder finder = IdentifiedObjects.newFinder(null);
      *     finder.setSearchDomain(IdentifiedObjectFinder.Domain.ALL_DATASET);
      *     Set<IdentifiedObject> found = finder.find(object);
-     * }
-     *
-     * This example does not use the {@code findSingleton(…)} convenience method on the
assumption
-     * that the search may find both deprecated and non-deprecated objects.</div>
+     * }</div>
      *
+     * @param  authority The authority of the objects to search (typically {@code "EPSG"}
or {@code "WMS"}),
+     *         or {@code null} for searching among the objects created by all authorities.
      * @return A finder to use for looking up unidentified objects.
      * @throws FactoryException if the finder can not be created.
      *
      * @see org.apache.sis.referencing.factory.GeodeticAuthorityFactory#newIdentifiedObjectFinder()
      * @see IdentifiedObjectFinder#find(IdentifiedObject)
      */
-    public static IdentifiedObjectFinder newFinder() throws FactoryException {
-        return AuthorityFactories.ALL.newIdentifiedObjectFinder();
+    public static IdentifiedObjectFinder newFinder(final String authority) throws FactoryException
{
+        final GeodeticAuthorityFactory factory;
+        if (authority == null) {
+            factory = AuthorityFactories.ALL;
+        } else {
+            factory = AuthorityFactories.ALL.getAuthorityFactory(GeodeticAuthorityFactory.class,
authority, null);
+        }
+        return factory.newIdentifiedObjectFinder();
     }
 
     /**
@@ -552,40 +560,52 @@ public final class IdentifiedObjects ext
 
     /**
      * Returns the URN of the given identifier, or {@code null} if no valid URN can be formed.
-     * The given type should be assignable to one of the given types:
+     * This method builds a URN from the {@linkplain NamedIdentifier#getCodeSpace() codespace},
+     * {@linkplain NamedIdentifier#getVersion() version} and {@linkplain NamedIdentifier#getCode()
code}
+     * of the given identifier, completed by the given {@link Class} argument.
+     *
+     * <p>First, this method starts the URN with {@code "urn:"} followed by a namespace
determined
+     * from the identifier {@linkplain NamedIdentifier#getCodeSpace() codespace} (which is
usually
+     * an abbreviation of the identifier {@linkplain NamedIdentifier#getAuthority() authority}).
+     * The recognized namespaces are listed in the following table
+     * (note that the list of authorities than can be used in the {@code "urn:ogc:def"} namespace
+     * is specified by the <a href="http://www.opengeospatial.org/ogcna">OGC Naming
Authority</a>).
+     * If this method can not determine a namespace for the given identifier, it returns
{@code null}.</p>
      *
      * <table class="sis">
-     *   <caption>Recognized object types in URN</caption>
-     *   <tr><th>Interface</th>                                       
             <th>Type in URN</th>         <th>Meaning</th></tr>
-     *   <tr><td>{@link org.opengis.referencing.cs.CoordinateSystemAxis}</td>
      <td>axis</td>                <td>Coordinate system axe definition</td></tr>
-     *   <tr><td>{@link org.opengis.referencing.operation.CoordinateOperation}</td>
<td>coordinateOperation</td> <td>Coordinate operation definition</td></tr>
-     *   <tr><td>{@link org.opengis.referencing.crs.CoordinateReferenceSystem}</td>
<td>crs</td>                 <td>Coordinate reference system definition</td></tr>
-     *   <tr><td>{@link org.opengis.referencing.cs.CoordinateSystem}</td>
          <td>cs</td>                  <td>Coordinate system definition</td></tr>
-     *   <tr><td>{@link org.opengis.referencing.datum.Datum}</td>     
             <td>datum</td>               <td>Datum definition</td></tr>
-     *   <tr><td>{@link org.opengis.referencing.datum.Ellipsoid}</td> 
             <td>ellipsoid</td>           <td>Ellipsoid definition</td></tr>
-     *   <tr><td>{@link org.opengis.referencing.datum.PrimeMeridian}</td>
          <td>meridian</td>            <td>Prime meridian definition</td></tr>
-     *   <tr><td>{@link org.opengis.referencing.operation.OperationMethod}</td>
    <td>method</td>              <td>Operation method definition</td></tr>
-     *   <tr><td>{@link org.opengis.parameter.ParameterDescriptor}</td>
            <td>parameter</td>           <td>Operation parameter definition</td></tr>
-     *   <tr><td>{@link org.opengis.referencing.ReferenceSystem}</td> 
             <td>referenceSystem</td>     <td>Value reference system definition</td></tr>
-     *   <tr><td>{@link javax.measure.unit.Unit}</td>                 
             <td>uom</td>                 <td>Unit of measure definition</td></tr>
+     *   <caption>Valid values for the authority component in URN</caption>
+     *   <tr><th>Namespace</th>           <th>Authority in URN</th>
<th>Description</th></tr>
+     *   <tr><td>{@code urn:ogc:def}</td> <td>{@code EPSG}</td>
    <td>EPSG dataset</td></tr>
+     *   <tr><td>{@code urn:ogc:def}</td> <td>{@code OGC}</td>
     <td>Open Geospatial Consortium</td></tr>
+     *   <tr><td>{@code urn:ogc:def}</td> <td>{@code OGC-WFS}</td>
 <td>OGC Web Feature Service</td></tr>
+     *   <tr><td>{@code urn:ogc:def}</td> <td>{@code SI}</td>
      <td>Système International d'Unités</td></tr>
+     *   <tr><td>{@code urn:ogc:def}</td> <td>{@code UCUM}</td>
    <td>Unified Code for Units of Measure</td></tr>
+     *   <tr><td>{@code urn:ogc:def}</td> <td>{@code UNSD}</td>
    <td>United Nations Statistics Division</td></tr>
+     *   <tr><td>{@code urn:ogc:def}</td> <td>{@code USNO}</td>
    <td>United States Naval Observatory</td></tr>
      * </table>
      *
-     * In addition, the identifier codespace shall be one of the following authorities:
+     * The namespace is followed by the authority, then by a type determined from the given
{@link Class} argument.
+     * That class is usually determined simply by {@code IdentifiedObject.getClass()}.
+     * The given class shall be assignable to one of the following types, otherwise this
method returns {@code null}:
      *
      * <table class="sis">
-     *   <caption>Recognized authorities in URN</caption>
-     *   <tr><th>Namespace</th> <th>Authority</th>        
<th>Description</th></tr>
-     *   <tr><td>OGC</td>       <td>{@code "EPSG"}</td>   
<td>EPSG dataset</td></tr>
-     *   <tr><td>OGC</td>       <td>{@code "OGC"}</td>    
<td>Open Geospatial Consortium</td></tr>
-     *   <tr><td>OGC</td>       <td>{@code "OGC-WFS"}</td>
<td>OGC Web Feature Service</td></tr>
-     *   <tr><td>OGC</td>       <td>{@code "SI"}</td>     
<td>Système International d'Unités</td></tr>
-     *   <tr><td>OGC</td>       <td>{@code "UCUM"}</td>   
<td>Unified Code for Units of Measure</td></tr>
-     *   <tr><td>OGC</td>       <td>{@code "UNSD"}</td>   
<td>United Nations Statistics Division</td></tr>
-     *   <tr><td>OGC</td>       <td>{@code "USNO"}</td>   
<td>United States Naval Observatory</td></tr>
+     *   <caption>Valid values for the type component in URN</caption>
+     *   <tr><th>Interface</th>                                       
             <th>Type in URN</th>                 <th>Description</th></tr>
+     *   <tr><td>{@link org.opengis.referencing.cs.CoordinateSystemAxis}</td>
      <td>{@code axis}</td>                <td>Coordinate system axe definition</td></tr>
+     *   <tr><td>{@link org.opengis.referencing.operation.CoordinateOperation}</td>
<td>{@code coordinateOperation}</td> <td>Coordinate operation definition</td></tr>
+     *   <tr><td>{@link org.opengis.referencing.crs.CoordinateReferenceSystem}</td>
<td>{@code crs}</td>                 <td>Coordinate reference system definition</td></tr>
+     *   <tr><td>{@link org.opengis.referencing.cs.CoordinateSystem}</td>
          <td>{@code cs}</td>                  <td>Coordinate system definition</td></tr>
+     *   <tr><td>{@link org.opengis.referencing.datum.Datum}</td>     
             <td>{@code datum}</td>               <td>Datum definition</td></tr>
+     *   <tr><td>{@link org.opengis.referencing.datum.Ellipsoid}</td> 
             <td>{@code ellipsoid}</td>           <td>Ellipsoid definition</td></tr>
+     *   <tr><td>{@link org.opengis.referencing.datum.PrimeMeridian}</td>
          <td>{@code meridian}</td>            <td>Prime meridian definition</td></tr>
+     *   <tr><td>{@link org.opengis.referencing.operation.OperationMethod}</td>
    <td>{@code method}</td>              <td>Operation method definition</td></tr>
+     *   <tr><td>{@link org.opengis.parameter.ParameterDescriptor}</td>
            <td>{@code parameter}</td>           <td>Operation parameter
definition</td></tr>
+     *   <tr><td>{@link org.opengis.referencing.ReferenceSystem}</td> 
             <td>{@code referenceSystem}</td>     <td>Value reference system
definition</td></tr>
+     *   <tr><td>{@link javax.measure.unit.Unit}</td>                 
             <td>{@code uom}</td>                 <td>Unit of measure definition</td></tr>
      * </table>
      *
-     * The reason why the authorities are restricted to the above white list is because this
method formats a URN
-     * in the OGC namespace. Consequently the URN should use only components recognized by
the OGC Naming Authority.
+     * The type is followed by the {@linkplain NamedIdentifier#getVersion() codespace version}
if available,
+     * and finally by the {@linkplain NamedIdentifier#getCode() code} value.
      *
      * <p>The above tables may be expanded in any future SIS version.</p>
      *

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=1727005&r1=1727004&r2=1727005&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 27 11:43:15 2016
@@ -1156,6 +1156,8 @@ public abstract class GeodeticAuthorityF
      *
      * @return A finder to use for looking up unidentified objects.
      * @throws FactoryException if the finder can not be created.
+     *
+     * @see org.apache.sis.referencing.IdentifiedObjects#newFinder(String)
      */
     public IdentifiedObjectFinder newIdentifiedObjectFinder() throws FactoryException {
         return new IdentifiedObjectFinder(this);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java?rev=1727005&r1=1727004&r2=1727005&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
[UTF-8] Wed Jan 27 11:43:15 2016
@@ -121,6 +121,8 @@ import org.apache.sis.util.collection.Ba
  * @since   0.7
  * @version 0.7
  * @module
+ *
+ * @see org.apache.sis.referencing.CRS#getAuthorityFactory(String)
  */
 public class MultiAuthoritiesFactory extends GeodeticAuthorityFactory implements CRSAuthorityFactory,
         CSAuthorityFactory, DatumAuthorityFactory, CoordinateOperationAuthorityFactory
@@ -660,12 +662,12 @@ public class MultiAuthoritiesFactory ext
                 }
             } else if (type >= AuthorityFactoryIdentifier.GEODETIC) {
                 /*
-                 * Special cases: if the requested factory is ANY, take the first factory
that we can found
+                 * Special cases: if the requested factory is ANY, take the first factory
that we can find
                  * regardless of its type. We will try CRS, CS, DATUM and OPERATION factories
in that order.
                  * The GEODETIC type is like ANY except for the additional restriction that
the factory shall
                  * be an instance of the SIS-specific GeodeticAuthorityFactory class.
                  */
-                assert providers.length < Math.min(type, Byte.MAX_VALUE) : type;
+                assert providers.length <= Math.min(type, Byte.MAX_VALUE) : type;
                 for (byte i=0; i < providers.length; i++) {
                     factory = getAuthorityFactory(request.newType(i));
                     switch (type) {

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java?rev=1727005&r1=1727004&r2=1727005&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java
[UTF-8] Wed Jan 27 11:43:15 2016
@@ -325,10 +325,7 @@ public final strictfp class EPSGFactoryT
         assertEpsgNameAndIdentifierEqual("Transverse Mercator", 9807, variant.getConversionFromBase().getMethod());
         assertEpsgNameAndIdentifierEqual("UTM zone 10N", 16010, variant.getConversionFromBase());
         verifyTransverseMercatorParmeters(crs.getConversionFromBase().getParameterValues(),
-123);
-        assertEquals("Operation method", crs.getConversionFromBase().getMethod(),
-                                     variant.getConversionFromBase().getMethod());
-        assertEquals("Coordinate system", crs.getCoordinateSystem(),
-                                      variant.getCoordinateSystem());
+
         assertSame("Operation method", crs.getConversionFromBase().getMethod(),
                                    variant.getConversionFromBase().getMethod());
         assertSame("Coordinate system", crs.getCoordinateSystem(),



Mime
View raw message