This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/sis.git
commit 53bd65bc9417174581b0a53bda4004a3fd4c000b Merge: d162d1255b f9314a0864 Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Fri Oct 4 17:51:20 2024 +0200 Merge branch 'geoapi-3.1'. .../apache/sis/console/ResourcesDownloader.java | 9 +- .../sis/coverage/grid/TranslatedGridCoverage.java | 4 +- .../org/apache/sis/feature/AbstractFeature.java | 2 +- .../apache/sis/feature/DefaultAssociationRole.java | 2 +- .../org/apache/sis/feature/DefaultFeatureType.java | 2 +- .../apache/sis/feature/ExpressionOperation.java | 2 +- .../main/org/apache/sis/filter/Optimization.java | 2 +- .../sis/feature/DefaultAssociationRoleTest.java | 2 +- .../org/apache/sis/metadata/MetadataStandard.java | 2 +- .../org/apache/sis/metadata/MetadataVisitor.java | 8 +- .../apache/sis/metadata/ModifiableMetadata.java | 2 +- .../main/org/apache/sis/metadata/ObjectPair.java | 2 +- .../apache/sis/metadata/ValueExistencePolicy.java | 2 +- .../apache/sis/metadata/sql/MetadataWriter.java | 2 +- .../sis/metadata/sql/privy/LocalDataSource.java | 6 +- .../main/org/apache/sis/xml/ReferenceResolver.java | 2 +- .../main/org/apache/sis/xml/XML.java | 2 +- .../main/org/apache/sis/xml/bind/Context.java | 1 + .../apache/sis/metadata/AbstractMetadataTest.java | 2 +- .../apache/sis/metadata/MetadataStandardTest.java | 4 +- .../test/org/apache/sis/metadata/PrunerTest.java | 4 +- .../gazetteer/AbstractLocationType.java | 10 +- .../referencing/gazetteer/LocationTypeTest.java | 2 +- .../main/org/apache/sis/io/wkt/Warnings.java | 2 +- .../apache/sis/referencing/AuthorityFactories.java | 209 +++++++------ .../main/org/apache/sis/referencing/CRS.java | 5 +- .../main/org/apache/sis/referencing/CommonCRS.java | 326 +++++++++------------ .../apache/sis/referencing/IdentifiedObjects.java | 2 + .../sis/referencing/crs/AbstractDerivedCRS.java | 2 +- .../factory/AuthorityFactoryIdentifier.java | 104 ++++--- .../referencing/factory/AuthorityFactoryProxy.java | 75 +++-- .../factory/ConcurrentAuthorityFactory.java | 10 +- .../factory/IdentifiedObjectFinder.java | 120 +++++++- .../factory/LazySynchronizedIterator.java | 48 +-- .../factory/MultiAuthoritiesFactory.java | 164 +++++------ .../referencing/factory/sql/EPSGDataAccess.java | 18 +- .../sis/referencing/factory/sql/EPSGFactory.java | 15 +- .../sis/referencing/factory/sql/EPSGInstaller.java | 5 +- .../factory/sql/InstallationScriptProvider.java | 2 +- .../referencing/internal/ServicesForMetadata.java | 3 +- .../operation/AbstractCoordinateOperation.java | 4 +- .../operation/CoordinateOperationFinder.java | 4 +- .../operation/builder/ProjectedTransformTry.java | 3 +- .../transform/DefaultMathTransformFactory.java | 2 +- .../apache/sis/geometry/DirectPosition1DTest.java | 4 +- .../org/apache/sis/parameter/ParametersTest.java | 2 +- .../apache/sis/referencing/ClenshawSummation.java | 2 +- .../sis/referencing/EPSGFactoryFallbackTest.java | 4 +- .../operation/transform/MathTransformTestCase.java | 2 +- .../operation/transform/MathTransformWrapper.java | 4 +- .../sis/storage/geotiff/MultiResolutionImage.java | 2 +- .../apache/sis/storage/geotiff/NativeMetadata.java | 2 +- .../org/apache/sis/storage/geotiff/Reader.java | 2 +- .../sis/storage/geotiff/reader/Localization.java | 2 +- .../sis/storage/sql/feature/FeatureAdapter.java | 4 +- .../sis/storage/sql/feature/InfoStatements.java | 12 +- .../apache/sis/storage/sql/feature/Relation.java | 2 +- .../org/apache/sis/storage/sql/feature/Table.java | 2 +- .../sis/util/stream/PaginedDoubleStream.java | 4 +- .../org/apache/sis/util/stream/PaginedStream.java | 4 +- .../storage/sql/feature/InfoStatementsTest.java | 8 +- .../main/org/apache/sis/io/stream/IOUtilities.java | 5 +- .../sis/storage/aggregate/GridSliceLocator.java | 2 +- .../sis/storage/base/GridResourceWrapper.java | 6 +- .../apache/sis/storage/event/StoreListeners.java | 10 +- .../apache/sis/converter/ConverterRegistry.java | 4 +- .../org/apache/sis/converter/SystemRegistry.java | 2 +- .../main/org/apache/sis/math/MathFunctions.java | 2 +- .../main/org/apache/sis/math/Vector.java | 2 +- .../main/org/apache/sis/pending/jdk/JDK22.java | 2 +- .../main/org/apache/sis/setup/About.java | 2 +- .../apache/sis/setup/InstallationResources.java | 22 +- .../apache/sis/setup/OptionalInstallations.java | 10 +- .../main/org/apache/sis/system/DataDirectory.java | 3 +- .../main/org/apache/sis/system/Semaphores.java | 2 +- .../main/org/apache/sis/util/Exceptions.java | 24 +- .../main/org/apache/sis/util/collection/Cache.java | 2 +- .../sis/util/collection/DefaultTreeTable.java | 2 +- .../org/apache/sis/util/collection/TreeTable.java | 6 +- .../sis/util/collection/TreeTableFormat.java | 32 +- .../main/org/apache/sis/util/internal/Acyclic.java | 2 +- .../main/org/apache/sis/util/logging/Logging.java | 6 +- .../org/apache/sis/util/privy/AbstractMap.java | 2 +- .../main/org/apache/sis/util/privy/Cloner.java | 2 +- .../sis/util/resources/IndexedResourceBundle.java | 18 +- .../test/org/apache/sis/test/Assertions.java | 5 +- .../main/module-info.java | 2 + .../org/apache/sis/storage/gimi/GimiProvider.java | 15 +- .../org/apache/sis/storage/gimi/GimiStore.java | 154 +++++++--- .../apache/sis/storage/gimi/GimiTileMatrix.java | 2 +- .../org/apache/sis/storage/gimi/GimiUtils.java | 53 ---- .../main/org/apache/sis/storage/gimi/Group.java | 66 +++++ .../main/org/apache/sis/storage/gimi/Item.java | 179 ++++++++--- .../org/apache/sis/storage/gimi/ResourceGrid.java | 8 +- .../apache/sis/storage/gimi/ResourceImageJpeg.java | 3 +- .../storage/gimi/ResourceImageUncompressed.java | 151 +++++++--- .../apache/sis/storage/gimi/ResourcePyramid.java | 7 +- .../apache/sis/storage/gimi/ResourceUnknown.java | 16 + .../storage/gimi/internal/MatrixGridRessource.java | 6 +- .../sis/storage/gimi/isobmff/ISOBMFFReader.java | 22 ++ .../apache/sis/storage/gimi/isobmff/gimi/GIMI.java | 6 +- .../TiledImageConfigurationBox.java} | 23 +- .../gimi/isobmff/iso14496_12/MediaData.java | 21 ++ .../gimi/isobmff/iso23001_17/ISO23001_17.java | 2 +- .../gimi/isobmff/iso23001_17/TAIClockInfo.java | 1 + .../sis/storage/gsf/panama/LibraryLoader.java | 4 +- .../sis/gui/coverage/ImagePropertyExplorer.java | 4 +- .../gui/internal/io/OptionalDataDownloader.java | 15 + .../apache/sis/gui/referencing/AuthorityCodes.java | 3 +- .../resources/embedded/EmbeddedResourcesTest.java | 1 - .../apache/sis/storage/panama/LibraryLoader.java | 4 +- .../org/apache/sis/storage/panama/Resources.java | 2 +- .../apache/sis/storage/panama/Resources.properties | 2 +- .../sis/storage/panama/Resources_fr.properties | 2 +- 114 files changed, 1341 insertions(+), 869 deletions(-) diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultFeatureType.java index d8fe6432f3,d9110ab7c3..1ac6a3bc4d --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultFeatureType.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultFeatureType.java @@@ -556,17 -555,19 +556,17 @@@ public class DefaultFeatureType extend { if (!resolved) { resolved = true; - for (final FeatureType type : feature.getSuperTypes()) { + for (final DefaultFeatureType type : feature.getSuperTypes()) { resolved &= resolve(type, previous); } - for (final PropertyType property : toUpdate) { - if (property instanceof FeatureAssociationRole) { - if (property instanceof DefaultAssociationRole) { - if (!((DefaultAssociationRole) property).resolve(this, properties)) { - resolved = false; - continue; - } + for (final AbstractIdentifiedType property : toUpdate) { + if (property instanceof DefaultAssociationRole) { + if (!((DefaultAssociationRole) property).resolve(this, properties)) { + resolved = false; + continue; } /* - * Resolve recursively the associated features, with a check against infinite recursivity. + * Resolve recursively the associated features, with a check against infinite recursion. * If we fall in a loop (for example A → B → C → A), conservatively returns `false`. This * may not be the most accurate answer, but will not cause any more hurt than checking more * often than necessary. diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/ExpressionOperation.java index 9d56804430,7a23b3ebdf..46a2044881 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/ExpressionOperation.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/ExpressionOperation.java @@@ -55,10 -60,10 +55,10 @@@ final class ExpressionOperation<V> exte private static final ParameterDescriptorGroup PARAMETERS = FeatureUtilities.parameters("Expression"); /** - * The expression on which to delegate the execution of this operation. + * The expression to which to delegate the execution of this operation. */ @SuppressWarnings("serial") // Not statically typed as serializable. - private final Function<? super Feature, ? extends V> expression; + private final Function<? super AbstractFeature, ? extends V> expression; /** * The type of result of evaluating the expression. diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/DefaultAssociationRoleTest.java index 5c024fbc5a,bc2323d70e..28e1ee3f92 --- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/DefaultAssociationRoleTest.java +++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/DefaultAssociationRoleTest.java @@@ -138,9 -142,9 +138,9 @@@ public final class DefaultAssociationRo } /** - * Tests {@link DefaultFeatureType#isAssignableFrom(FeatureType)} and {@link DefaultFeatureType#equals(Object)} + * Tests {@code DefaultFeatureType.isAssignableFrom(FeatureType)} and {@code DefaultFeatureType.equals(Object)} * on a feature type having a bidirectional association to another feature. This test will fall in an infinite - * loop if the implementation does not have proper guard against infinite recursivity. + * loop if the implementation does not have proper guard against infinite recursion. */ @Test public void testCyclicAssociation() { diff --cc endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/AbstractLocationType.java index c591389c21,0af8af30c2..f73721edbe --- a/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/AbstractLocationType.java +++ b/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/AbstractLocationType.java @@@ -77,9 -75,9 +77,9 @@@ abstract class AbstractLocationType imp /** * Implementation of {@link #checkForCycles()} to be invoked recursively for each children. * - * @throws IllegalArgumentException if an infinite recursivity is detected. + * @throws IllegalArgumentException if an infinite recursion is detected. */ - private static void checkForCycles(final LocationType type, final Map<LocationType,Boolean> parents) { + private static void checkForCycles(final AbstractLocationType type, final Map<AbstractLocationType,Boolean> parents) { if (parents.put(type, Boolean.TRUE) != null) { throw new IllegalArgumentException(Resources.format(Resources.Keys.LocationTypeCycle_1, type.getName())); } @@@ -190,11 -140,11 +190,11 @@@ // Fall through } default: { - if (!(object instanceof LocationType)) break; - final LocationType that = (LocationType) object; + if (!(object instanceof AbstractLocationType)) break; + final AbstractLocationType that = (AbstractLocationType) object; if (Objects.equals(getName(), that.getName())) { /* - * To be safe, we should apply some check against infinite recursivity here. + * To be safe, we should apply some check against infinite recursion here. * We do not on the assumption that subclasses verified that we do not have * any cycle. */ @@@ -233,8 -183,8 +233,8 @@@ @Override public int hashCode() { int code = Objects.hashCode(getName()); - for (final LocationType child : getChildren()) { + for (final AbstractLocationType child : getChildren()) { - // Take only children name without recursivity over their own children. + // Take only children name without recursion over their own children. code = code*31 + Objects.hashCode(child.getName()); } return code; diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/CommonCRS.java index e894c0d817,33edfaf6e3..cb03839409 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/CommonCRS.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/CommonCRS.java @@@ -382,14 -380,14 +382,14 @@@ public enum CommonCRS * * @see #geocentric() */ - private transient volatile GeocentricCRS cachedGeocentric; - private transient GeodeticCRS cachedGeocentric; ++ private transient GeocentricCRS cachedGeocentric; /** * The geocentric CRS using spherical coordinate system, created when first needed. * * @see #spherical() */ - private transient volatile GeocentricCRS cachedSpherical; - private transient GeodeticCRS cachedSpherical; ++ private transient GeocentricCRS cachedSpherical; /** * The Universal Transverse Mercator (UTM) or Universal Polar Stereographic (UPS) projections, @@@ -721,23 -709,16 +711,16 @@@ * We will arbitrarily create this CS only for the most frequently created CRS, * and share that CS instance for all other constants. */ - EllipsoidalCS cs = null; + final EllipsoidalCS cs; if (this != DEFAULT) { cs = DEFAULT.geographic3D().getCoordinateSystem(); + } else { + cs = (EllipsoidalCS) StandardDefinitions.createCoordinateSystem(StandardDefinitions.ELLIPSOIDAL_3D, true); } - synchronized (this) { - object = cachedGeo3D; - if (object == null) { - if (cs == null) { - cs = (EllipsoidalCS) StandardDefinitions.createCoordinateSystem(StandardDefinitions.ELLIPSOIDAL_3D, true); - } - // Use same name and datum than the geographic CRS. - object = new DefaultGeographicCRS(properties(base, geo3D), base.getDatum(), getDatumEnsemble(base), cs); - cachedGeo3D = object; - } - } + // Use same name and datum than the geographic CRS. - cachedGeo3D = new DefaultGeographicCRS(properties(base, geo3D), base.getDatum(), base.getDatumEnsemble(), cs); ++ cachedGeo3D = new DefaultGeographicCRS(properties(base, geo3D), base.getDatum(), getDatumEnsemble(base), cs); } - return object; + return cachedGeo3D; } /** @@@ -767,15 -744,12 +750,12 @@@ * @see CRS#forCode(String) * @see DefaultGeocentricCRS */ - public GeocentricCRS geocentric() { - GeocentricCRS object = cachedGeocentric; - if (object == null) { - public synchronized GeodeticCRS geocentric() { ++ public synchronized GeocentricCRS geocentric() { + if (cachedGeocentric == null) { if (geocentric != 0) { final GeodeticAuthorityFactory factory = factory(); if (factory != null) try { - // Synchronization provided by the cache of the factory. - cachedGeocentric = object = factory.createGeocentricCRS(String.valueOf(geocentric)); - return object; - return cachedGeocentric = factory.createGeodeticCRS(String.valueOf(geocentric)); ++ return cachedGeocentric = factory.createGeocentricCRS(String.valueOf(geocentric)); } catch (FactoryException e) { failure(this, "geocentric", e, geocentric); } @@@ -787,22 -761,15 +767,15 @@@ * We will arbitrarily create this CS only for the most frequently created CRS, * and share that CS instance for all other constants. */ - CartesianCS cs = null; + final CartesianCS cs; if (this != DEFAULT) { cs = (CartesianCS) DEFAULT.geocentric().getCoordinateSystem(); + } else { + cs = (CartesianCS) StandardDefinitions.createCoordinateSystem(StandardDefinitions.EARTH_CENTRED, true); } - synchronized (this) { - object = cachedGeocentric; - if (object == null) { - if (cs == null) { - cs = (CartesianCS) StandardDefinitions.createCoordinateSystem(StandardDefinitions.EARTH_CENTRED, true); - } - object = new DefaultGeocentricCRS(properties(base, geocentric), base.getDatum(), getDatumEnsemble(base), cs); - cachedGeocentric = object; - } - } - cachedGeocentric = new DefaultGeocentricCRS(properties(base, geocentric), base.getDatum(), base.getDatumEnsemble(), cs); ++ cachedGeocentric = new DefaultGeocentricCRS(properties(base, geocentric), base.getDatum(), getDatumEnsemble(base), cs); } - return object; + return cachedGeocentric; } /** @@@ -824,9 -787,8 +797,8 @@@ * * @since 0.7 */ - public GeocentricCRS spherical() { - GeocentricCRS object = cachedSpherical; - if (object == null) { - public synchronized GeodeticCRS spherical() { ++ public synchronized GeocentricCRS spherical() { + if (cachedSpherical == null) { /* * All constants defined in this enumeration use the same coordinate system, EPSG:6404. * We will arbitrarily create this CS only for the most frequently created CRS, @@@ -846,21 -810,12 +820,12 @@@ } // Use same name and datum than the geographic CRS. final GeographicCRS base = geographic(); - synchronized (this) { - object = cachedSpherical; - if (object == null) { - if (cs == null) { - cs = (SphericalCS) StandardDefinitions.createCoordinateSystem(StandardDefinitions.SPHERICAL, true); - } - object = new DefaultGeocentricCRS(IdentifiedObjects.getProperties(base, exclude()), - base.getDatum(), - getDatumEnsemble(base), - cs); - cachedSpherical = object; - } - } + cachedSpherical = new DefaultGeocentricCRS(IdentifiedObjects.getProperties(base, exclude()), + base.getDatum(), - base.getDatumEnsemble(), ++ getDatumEnsemble(base), + cs); } - return object; + return cachedSpherical; } /** @@@ -1507,22 -1440,21 +1446,17 @@@ failure(this, "datum", e, datum); } } - synchronized (this) { - object = datum(cached); - if (object == null) { - if (isEPSG) { - object = StandardDefinitions.createVerticalDatum(datum); - } else { - /* - * All cases where the first constructor argument is `false`, currently BAROMETRIC and - * ELLIPSOIDAL. The way to construct the ellipsoidal pseudo-method shall be equivalent - * to a call to `VerticalDatumTypes.ellipsoidal()`. - */ - object = new DefaultVerticalDatum(properties(datum), VerticalDatumType.valueOf(name())); - } - cached = object; - } + if (isEPSG) { + object = StandardDefinitions.createVerticalDatum(datum); + } else { + /* + * All cases where the first constructor argument is `false`, currently BAROMETRIC and + * ELLIPSOIDAL. The way to construct the ellipsoidal pseudo-method shall be equivalent + * to a call to `VerticalDatumTypes.ellipsoidal()`. + */ - RealizationMethod method = null; - if (this != OTHER_SURFACE) { - method = RealizationMethod.valueOf(name()); - } - object = new DefaultVerticalDatum(properties(datum), method); ++ object = new DefaultVerticalDatum(properties(datum), VerticalDatumType.valueOf(name())); } + cached = object; } return object; } @@@ -2078,7 -1998,7 +2000,7 @@@ /** * Returns {@code true} is the given <abbr>CRS</abbr> uses the datum identified by this enumeration value. * The association may be direct through {@link SingleCRS#getDatum()}, or indirect throw at least one of -- * the members of {@link SingleCRS#getDatumEnsemble()}. ++ * the members of {@code getDatumEnsemble(SingleCRS)}. * * @param crs the CRS to compare against the datum of this enumeration value. May be {@code null}. * @return whether the given <abbr>CRS</abbr> uses the datum, directly or indirectly. diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java index d75513bbe5,a2d4616aff..e0ea64a60c --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java @@@ -177,13 -176,10 +176,13 @@@ abstract class AuthorityFactoryProxy<T * @param classe the type of object for which to get a description. */ static final AuthorityFactoryProxy<InternationalString> description(final Class<? extends IdentifiedObject> classe) { - return new AuthorityFactoryProxy<InternationalString>(InternationalString.class, AuthorityFactoryIdentifier.ANY) { + return new AuthorityFactoryProxy<InternationalString>(InternationalString.class, AuthorityFactoryIdentifier.Type.ANY) { - @Override InternationalString createFromAPI(AuthorityFactory factory, String code) throws FactoryException { + @Override InternationalString create(GeodeticAuthorityFactory factory, String code) throws FactoryException { return factory.getDescriptionText(classe, code).orElse(null); } + @Override InternationalString createFromAPI(AuthorityFactory factory, String code) throws FactoryException { + return factory.getDescriptionText(code); + } @Override AuthorityFactoryProxy<InternationalString> specialize(String typeName) { return this; } @@@ -193,8 -189,9 +192,8 @@@ /** * The proxy for the {@link GeodeticAuthorityFactory#createObject(String)} method. */ - @SuppressWarnings("removal") static final AuthorityFactoryProxy<IdentifiedObject> OBJECT = - new AuthorityFactoryProxy<IdentifiedObject>(IdentifiedObject.class, AuthorityFactoryIdentifier.ANY) { + new AuthorityFactoryProxy<IdentifiedObject>(IdentifiedObject.class, AuthorityFactoryIdentifier.Type.ANY) { @Override IdentifiedObject createFromAPI(AuthorityFactory factory, String code) throws FactoryException { return factory.createObject(code); } @@@ -231,8 -228,18 +230,8 @@@ } }; - static final AuthorityFactoryProxy<ParametricDatum> PARAMETRIC_DATUM = - new AuthorityFactoryProxy<ParametricDatum>(ParametricDatum.class, AuthorityFactoryIdentifier.Type.DATUM) { - @Override ParametricDatum create(GeodeticAuthorityFactory factory, String code) throws FactoryException { - return factory.createParametricDatum(code); - } - @Override ParametricDatum createFromAPI(AuthorityFactory factory, String code) throws FactoryException { - return datumFactory(factory).createParametricDatum(code); - } - }; - static final AuthorityFactoryProxy<VerticalDatum> VERTICAL_DATUM = - new AuthorityFactoryProxy<VerticalDatum>(VerticalDatum.class, AuthorityFactoryIdentifier.DATUM) { + new AuthorityFactoryProxy<VerticalDatum>(VerticalDatum.class, AuthorityFactoryIdentifier.Type.DATUM) { @Override VerticalDatum create(GeodeticAuthorityFactory factory, String code) throws FactoryException { return factory.createVerticalDatum(code); } @@@ -371,8 -378,18 +370,8 @@@ } }; - static final AuthorityFactoryProxy<ParametricCS> PARAMETRIC_CS = - new AuthorityFactoryProxy<ParametricCS>(ParametricCS.class, AuthorityFactoryIdentifier.Type.CS) { - @Override ParametricCS create(GeodeticAuthorityFactory factory, String code) throws FactoryException { - return factory.createParametricCS(code); - } - @Override ParametricCS createFromAPI(AuthorityFactory factory, String code) throws FactoryException { - return csFactory(factory).createParametricCS(code); - } - }; - static final AuthorityFactoryProxy<CoordinateSystemAxis> AXIS = - new AuthorityFactoryProxy<CoordinateSystemAxis>(CoordinateSystemAxis.class, AuthorityFactoryIdentifier.CS) { + new AuthorityFactoryProxy<CoordinateSystemAxis>(CoordinateSystemAxis.class, AuthorityFactoryIdentifier.Type.CS) { @Override CoordinateSystemAxis create(GeodeticAuthorityFactory factory, String code) throws FactoryException { return factory.createCoordinateSystemAxis(code); } @@@ -442,8 -459,9 +441,8 @@@ } }; - @Deprecated(since = "2.0") // Temporary version number until this branch is released. static final AuthorityFactoryProxy<GeocentricCRS> GEOCENTRIC_CRS = - new AuthorityFactoryProxy<GeocentricCRS>(GeocentricCRS.class, AuthorityFactoryIdentifier.CRS) { + new AuthorityFactoryProxy<GeocentricCRS>(GeocentricCRS.class, AuthorityFactoryIdentifier.Type.CRS) { @Override GeocentricCRS create(GeodeticAuthorityFactory factory, String code) throws FactoryException { return factory.createGeocentricCRS(code); } @@@ -452,9 -470,19 +451,9 @@@ } }; - static final AuthorityFactoryProxy<GeodeticCRS> GEODETIC_CRS = - new AuthorityFactoryProxy<GeodeticCRS>(GeodeticCRS.class, AuthorityFactoryIdentifier.Type.CRS) { - @Override GeodeticCRS create(GeodeticAuthorityFactory factory, String code) throws FactoryException { - return factory.createGeodeticCRS(code); - } - @Override GeodeticCRS createFromAPI(AuthorityFactory factory, String code) throws FactoryException { - return crsFactory(factory).createGeodeticCRS(code); - } - }; - @SuppressWarnings("deprecation") static final AuthorityFactoryProxy<ImageCRS> IMAGE_CRS = - new AuthorityFactoryProxy<ImageCRS>(ImageCRS.class, AuthorityFactoryIdentifier.CRS) { + new AuthorityFactoryProxy<ImageCRS>(ImageCRS.class, AuthorityFactoryIdentifier.Type.CRS) { @Override ImageCRS create(GeodeticAuthorityFactory factory, String code) throws FactoryException { return factory.createImageCRS(code); } @@@ -493,9 -521,19 +492,9 @@@ } }; - static final AuthorityFactoryProxy<ParametricCRS> PARAMETRIC_CRS = - new AuthorityFactoryProxy<ParametricCRS>(ParametricCRS.class, AuthorityFactoryIdentifier.Type.CRS) { - @Override ParametricCRS create(GeodeticAuthorityFactory factory, String code) throws FactoryException { - return factory.createParametricCRS(code); - } - @Override ParametricCRS createFromAPI(AuthorityFactory factory, String code) throws FactoryException { - return crsFactory(factory).createParametricCRS(code); - } - }; - @SuppressWarnings("rawtypes") static final AuthorityFactoryProxy<ParameterDescriptor> PARAMETER = - new AuthorityFactoryProxy<ParameterDescriptor>(ParameterDescriptor.class, AuthorityFactoryIdentifier.GEODETIC) { + new AuthorityFactoryProxy<ParameterDescriptor>(ParameterDescriptor.class, AuthorityFactoryIdentifier.Type.GEODETIC) { @Override ParameterDescriptor<?> create(GeodeticAuthorityFactory factory, String code) throws FactoryException { return factory.createParameterDescriptor(code); } diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/ServicesForMetadata.java index 0d116aa85b,9ff0ed9f21..2cacfe3989 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/ServicesForMetadata.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/internal/ServicesForMetadata.java @@@ -599,11 -505,11 +600,11 @@@ public final class ServicesForMetadata authority = CRS.getAuthorityFactory(Constants.EPSG).getAuthority(); } catch (FactoryException e) { final String msg = Exceptions.getLocalizedMessage(e, locale); - return (msg != null) ? msg : e.toString(); + return (msg != null) ? msg : Classes.getShortClassName(e); } - if (authority != null) { + if (authority instanceof DefaultCitation) { final OnLineFunction f = OnLineFunction.valueOf(CONNECTION); - for (final OnlineResource res : authority.getOnlineResources()) { + for (final OnlineResource res : ((DefaultCitation) authority).getOnlineResources()) { if (f.equals(res.getFunction())) { final InternationalString i18n = res.getDescription(); if (i18n != null) return i18n.toString(locale);