sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] branch geoapi-4.0 updated: First round of removal of classes/methods deprecated in SIS 1.0. This commit removes only the classes and methods having no dependencies in SIS.
Date Thu, 12 Sep 2019 09:50:04 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new b94b082  First round of removal of classes/methods deprecated in SIS 1.0. This commit
removes only the classes and methods having no dependencies in SIS.
b94b082 is described below

commit b94b08216d6adeb56beb80b4c8d31b2cdf0894a1
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Thu Sep 12 11:06:12 2019 +0200

    First round of removal of classes/methods deprecated in SIS 1.0.
    This commit removes only the classes and methods having no dependencies in SIS.
---
 .../sis/feature/builder/FeatureTypeBuilder.java    |   9 --
 .../sis/metadata/iso/citation/Citations.java       |  11 --
 .../main/java/org/apache/sis/xml/Namespaces.java   |  22 ---
 .../apache/sis/geometry/GeneralDirectPosition.java |  18 ---
 .../sis/metadata/iso/ImmutableIdentifier.java      | 166 ---------------------
 .../main/java/org/apache/sis/referencing/CRS.java  |  11 --
 .../apache/sis/referencing/IdentifiedObjects.java  |   8 -
 .../apache/sis/referencing/cs/AxesConvention.java  |   9 --
 .../operation/transform/MathTransforms.java        |   2 +-
 .../operation/transform/PassThroughTransform.java  |  13 +-
 .../apache/sis/distance/LatLonPointRadiusTest.java |  89 -----------
 .../sis/test/suite/ReferencingTestSuite.java       |   3 -
 .../java/org/apache/sis/util/ComparisonMode.java   |  18 ---
 .../main/java/org/apache/sis/util/Utilities.java   |  10 --
 .../apache/sis/util/logging/WarningListener.java   |   1 -
 .../apache/sis/util/logging/WarningListeners.java  |  10 --
 .../apache/sis/test/suite/UtilityTestSuite.java    |   1 -
 .../sis/util/logging/WarningListenersTest.java     | 118 ---------------
 .../java/org/apache/sis/storage/DataStore.java     |  52 -------
 .../apache/sis/storage/event/StoreListeners.java   |  10 --
 20 files changed, 2 insertions(+), 579 deletions(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
index bb227ba..29ed49a 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
@@ -551,15 +551,6 @@ public class FeatureTypeBuilder extends TypeBuilder {
     }
 
     /**
-     * @deprecated Renamed {@link #setDefaultMultiplicity(int, int)}. A cardinality is the
actual number of elements
-     * in a set, while multiplicity is the range of cardinality that a set can have.
-     */
-    @Deprecated
-    public FeatureTypeBuilder setDefaultCardinality(final int minimumOccurs, final int maximumOccurs)
{
-        return setDefaultMultiplicity(minimumOccurs, maximumOccurs);
-    }
-
-    /**
      * Sets the default minimum and maximum number of next attributes and associations to
add.
      * Those defaults will applied to newly created attributes or associations,
      * for example in next calls to {@link #addAttribute(Class)}.
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
index 339120f..67c24d4 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
@@ -880,17 +880,6 @@ public final class Citations extends Static {
     }
 
     /**
-     * @deprecated Renamed as {@link #toCodeSpace(Citation)}. The previous name was confusing
because this
-     * method does not return the namespace of the given citation, but instead represents
it as a namespace.
-     *
-     * @since 0.8
-     */
-    @Deprecated
-    public static String getCodeSpace(final Citation citation) {
-        return toCodeSpace(citation);
-    }
-
-    /**
      * Removes characters that are ignorable according Unicode specification.
      *
      * @param  identifier  the character sequence from which to remove ignorable characters,
or {@code null}.
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java b/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java
index 6beccea..3b068c1 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java
@@ -453,28 +453,6 @@ public final class Namespaces extends Static {
 
     /**
      * The <code>{@value}</code> URL.
-     * The usual prefix for this namespace is {@code "gmi"}.
-     *
-     * @category ISO
-     *
-     * @deprecated as of ISO 19115-4, splitted in many different namespaces.
-     */
-    @Deprecated
-    public static final String GMI = LegacyNamespaces.GMI;
-
-    /**
-     * The <code>{@value}</code> URL.
-     * The usual prefix for this namespace is {@code "gmx"}.
-     *
-     * @category ISO
-     *
-     * @deprecated as of ISO 19115-3, splitted in many different namespaces.
-     */
-    @Deprecated
-    public static final String GMX = LegacyNamespaces.GMX;
-
-    /**
-     * The <code>{@value}</code> URL.
      * The usual prefix for this namespace is {@code "gts"}.
      *
      * @category ISO
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
b/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
index 6a43ae4..852dd42 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
@@ -80,14 +80,6 @@ public class GeneralDirectPosition extends AbstractDirectPosition implements
Ser
     public final double[] coordinates;
 
     /**
-     * @deprecated Renamed {@link #coordinates}.
-     *
-     * @see <a href="https://issues.apache.org/jira/browse/SIS-461">SIS-461</a>
-     */
-    @Deprecated
-    public transient double[] ordinates;
-
-    /**
      * The coordinate reference system for this position, or {@code null}.
      */
     private CoordinateReferenceSystem crs;
@@ -111,7 +103,6 @@ public class GeneralDirectPosition extends AbstractDirectPosition implements
Ser
      */
     public GeneralDirectPosition(final int dimension) throws NegativeArraySizeException {
         coordinates = new double[dimension];
-        ordinates = coordinates;
     }
 
     /**
@@ -134,7 +125,6 @@ public class GeneralDirectPosition extends AbstractDirectPosition implements
Ser
      */
     public GeneralDirectPosition(final double... coordinates) {
         this.coordinates = coordinates;
-        ordinates = coordinates;
     }
 
     /**
@@ -147,7 +137,6 @@ public class GeneralDirectPosition extends AbstractDirectPosition implements
Ser
         coordinates = point.getCoordinate();                            // Should already
be cloned.
         crs = point.getCoordinateReferenceSystem();
         ensureDimensionMatches("crs", coordinates.length, crs);
-        ordinates = coordinates;
     }
 
     /**
@@ -172,7 +161,6 @@ public class GeneralDirectPosition extends AbstractDirectPosition implements
Ser
             throw new IllegalArgumentException(Errors.format(
                     Errors.Keys.UnparsableStringForClass_2, "POINT", wkt));
         }
-        ordinates = coordinates;
     }
 
     /**
@@ -325,7 +313,6 @@ public class GeneralDirectPosition extends AbstractDirectPosition implements
Ser
             }
             GeneralDirectPosition e = (GeneralDirectPosition) super.clone();
             field.set(e, coordinates.clone());
-            e.ordinates = e.coordinates;
             return e;
         } catch (ReflectiveOperationException | CloneNotSupportedException exception) {
             /*
@@ -337,11 +324,6 @@ public class GeneralDirectPosition extends AbstractDirectPosition implements
Ser
         }
     }
 
-    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException
{
-        in.defaultReadObject();
-        ordinates = coordinates;
-    }
-
     /**
      * {@inheritDoc}
      */
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
b/core/sis-referencing/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
deleted file mode 100644
index fcc74cd..0000000
--- a/core/sis-referencing/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sis.metadata.iso;
-
-import java.util.Map;
-import java.util.Locale;
-import org.opengis.metadata.Identifier;
-import org.opengis.metadata.citation.Citation;
-import org.opengis.util.InternationalString;
-
-
-/**
- * Immutable value uniquely identifying an object within a namespace, together with a version.
- *
- * @author  Martin Desruisseaux (Geomatys)
- * @version 1.0
- * @since 0.3
- * @module
- *
- * @deprecated Moved to {@link org.apache.sis.referencing} for anticipation with Jigsaw modules.
- */
-@Deprecated
-public class ImmutableIdentifier extends org.apache.sis.referencing.ImmutableIdentifier {
-
-    /**
-     * Creates a new identifier from the specified one. This is a copy constructor which
-     * get the code, codespace, authority and version from the given identifier.
-     *
-     * @param identifier  the identifier to copy.
-     *
-     * @see #castOrCopy(Identifier)
-     */
-    public ImmutableIdentifier(final Identifier identifier) {
-        super(identifier);
-    }
-
-    /**
-     * Creates a new identifier from the specified code and authority.
-     *
-     * @param authority  the person or party responsible for maintenance of the namespace,
or {@code null} if not available.
-     * @param codeSpace  identifier or namespace in which the code is valid, or {@code null}
if not available.
-     *                   This is often an abbreviation of the authority name.
-     * @param code       alphanumeric value identifying an instance in the namespace. The
code can not be null.
-     */
-    public ImmutableIdentifier(final Citation authority, final String codeSpace, final String
code) {
-        super(authority, codeSpace, code);
-    }
-
-    /**
-     * Creates a new identifier from the specified code and authority,
-     * with an optional version number and description.
-     *
-     * @param authority    the person or party responsible for maintenance of the namespace,
or {@code null} if not available.
-     * @param codeSpace    identifier or namespace in which the code is valid, or {@code
null} if not available.
-     *                     This is often an abbreviation of the authority name.
-     * @param code         alphanumeric value identifying an instance in the namespace. The
code can not be null.
-     * @param version      the version identifier for the namespace as specified by the code
authority, or {@code null} if none.
-     * @param description  natural language description of the meaning of the code value,
or {@code null} if none.
-     */
-    public ImmutableIdentifier(final Citation authority, final String codeSpace,
-            final String code, final String version, final InternationalString description)
-    {
-        super(authority, codeSpace, code, version, description);
-    }
-
-    /**
-     * Constructs an identifier from the given properties. Keys are strings from the table
below.
-     * The map given in argument shall contain an entry at least for the
-     * {@value org.opengis.metadata.Identifier#CODE_KEY} key.
-     * Other properties listed in the table below are optional.
-     *
-     * <table class="sis">
-     *   <caption>Recognized properties</caption>
-     *   <tr>
-     *     <th>Property name</th>
-     *     <th>Value type</th>
-     *     <th>Returned by</th>
-     *   </tr>
-     *   <tr>
-     *     <td>{@value org.opengis.metadata.Identifier#CODE_KEY}</td>
-     *     <td>{@link String}</td>
-     *     <td>{@link #getCode()}</td>
-     *   </tr>
-     *   <tr>
-     *     <td>{@value org.opengis.metadata.Identifier#CODESPACE_KEY}</td>
-     *     <td>{@link String}</td>
-     *     <td>{@link #getCodeSpace()}</td>
-     *   </tr>
-     *   <tr>
-     *     <td>{@value org.opengis.metadata.Identifier#AUTHORITY_KEY}</td>
-     *     <td>{@link String} or {@link Citation}</td>
-     *     <td>{@link #getAuthority()}</td>
-     *   </tr>
-     *   <tr>
-     *     <td>{@value org.opengis.metadata.Identifier#VERSION_KEY}</td>
-     *     <td>{@link String}</td>
-     *     <td>{@link #getVersion()}</td>
-     *   </tr>
-     *   <tr>
-     *     <td>{@value org.opengis.metadata.Identifier#DESCRIPTION_KEY}</td>
-     *     <td>{@link String} or {@link InternationalString}</td>
-     *     <td>{@link #getDescription()}</td>
-     *   </tr>
-     *   <tr>
-     *     <td>{@value org.apache.sis.referencing.AbstractIdentifiedObject#LOCALE_KEY}</td>
-     *     <td>{@link Locale}</td>
-     *     <td>(none)</td>
-     *   </tr>
-     * </table>
-     *
-     * <div class="section">Localization</div>
-     * {@code "description"} is a localizable attributes which may have a language and country
-     * code suffix. For example the {@code "description_fr"} property stands for description
in
-     * {@linkplain Locale#FRENCH French} and the {@code "description_fr_CA"} property stands
-     * for description in {@linkplain Locale#CANADA_FRENCH French Canadian}.
-     *
-     * <p>The {@code "locale"} property applies only to exception messages, if any.
-     * After successful construction, {@code ImmutableIdentifier} instances do not keep the
locale
-     * since localizations are deferred to the {@link InternationalString#toString(Locale)}
method.</p>
-     *
-     * @param  properties  the properties to be given to this identifier.
-     * @throws IllegalArgumentException if a property has an illegal value.
-     */
-    public ImmutableIdentifier(final Map<String,?> properties) throws IllegalArgumentException
{
-        super(properties);
-    }
-
-    /**
-     * Returns a SIS identifier implementation with the values of the given arbitrary implementation.
-     * This method performs the first applicable action in the following choices:
-     *
-     * <ul>
-     *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
-     *   <li>Otherwise if the given object is already an instance of
-     *       {@code ImmutableIdentifier}, then it is returned unchanged.</li>
-     *   <li>Otherwise a new {@code ImmutableIdentifier} instance is created using
the
-     *       {@linkplain #ImmutableIdentifier(Identifier) copy constructor} and returned.
-     *       Note that this is a <cite>shallow</cite> copy operation, since the
other
-     *       metadata contained in the given object are not recursively copied.</li>
-     * </ul>
-     *
-     * @param  object  the object to get as a SIS implementation, or {@code null} if none.
-     * @return a SIS implementation containing the values of the given object (may be the
-     *         given object itself), or {@code null} if the argument was null.
-     */
-    public static ImmutableIdentifier castOrCopy(final Identifier object) {
-        if (object == null || object instanceof ImmutableIdentifier) {
-            return (ImmutableIdentifier) object;
-        }
-        return new ImmutableIdentifier(object);
-    }
-}
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
index d6bf977..53cfa2a 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
@@ -86,7 +86,6 @@ import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
 import org.apache.sis.metadata.iso.extent.Extents;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.logging.Logging;
-import org.apache.sis.util.logging.WarningListener;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Utilities;
 import org.apache.sis.util.Static;
@@ -433,16 +432,6 @@ public final class CRS extends Static {
     }
 
     /**
-     * @deprecated {@code WarningListener} argument replaced by {@code java.util.logging.Filter}.
-     */
-    @Deprecated
-    public static CoordinateReferenceSystem fromAuthority(CoordinateReferenceSystem crs,
-            final CRSAuthorityFactory factory, final WarningListener<?> listener) throws
FactoryException
-    {
-        return fromAuthority(crs, factory, (listener != null) ? listener.asFilter() : null);
-    }
-
-    /**
      * Suggests a coordinate reference system which could be a common target for coordinate
operations having the
      * given sources. This method compares the {@linkplain #getGeographicBoundingBox(CoordinateReferenceSystem)
      * domain of validity} of all given CRSs. If a CRS has a domain of validity that contains
the domain of all other
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
index 353d086..8c992a4 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
@@ -384,14 +384,6 @@ public final class IdentifiedObjects extends Static {
     }
 
     /**
-     * @deprecated Renamed {@link #getSimpleNameOrIdentifier(IdentifiedObject)}.
-     */
-    @Deprecated
-    public static String getUnicodeIdentifier(final IdentifiedObject object) {
-        return getSimpleNameOrIdentifier(object);
-    }
-
-    /**
      * Looks up a URN, such as {@code "urn:ogc:def:crs:EPSG:9.1:4326"}, of the specified
object.
      * This method searches in all {@linkplain org.apache.sis.referencing.factory.GeodeticAuthorityFactory
geodetic
      * authority factories} known to SIS for an object {@linkplain org.apache.sis.util.ComparisonMode#APPROXIMATE
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
index 7e97721..c1f6cd2 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AxesConvention.java
@@ -282,13 +282,4 @@ public enum AxesConvention implements AxisFilter {
      * @see org.opengis.referencing.cs.RangeMeaning#WRAPAROUND
      */
     POSITIVE_RANGE;
-
-    /**
-     * @deprecated Renamed {@link #DISPLAY_ORIENTED} since "conventional" is too vague.
-     *             For example the (latitude, longitude) axis order is also conventional.
-     *
-     * @since 0.5
-     */
-    @Deprecated
-    public static final AxesConvention CONVENTIONALLY_ORIENTED = DISPLAY_ORIENTED;
 }
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
index 04895bf..7379d6c 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
@@ -357,7 +357,7 @@ public final class MathTransforms extends Static {
                 return IdentityTransform.create(firstAffectedCoordinate + dimension + numTrailingCoordinates);
             }
         }
-        return PassThroughTransform.create0(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
+        return PassThroughTransform.create(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
     }
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
index 3a47636..1782e41 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
@@ -149,19 +149,8 @@ public class PassThroughTransform extends AbstractMathTransform implements
Seria
      * @param  subTransform           the sub-transform to apply on modified coordinates.
      * @param  numTrailingCoordinates   number of trailing coordinates to pass through.
      * @return a pass-through transform, not necessarily a {@code PassThroughTransform} instance.
-     *
-     * @deprecated Moved to {@link MathTransforms#passThrough(int, MathTransform, int)}.
      */
-    @Deprecated
-    public static MathTransform create(final int firstAffectedCoordinate,
-                                       final MathTransform subTransform,
-                                       final int numTrailingCoordinates)
-    {
-        return MathTransforms.passThrough(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
-    }
-
-    /** TODO: rename create(…) and recycle above javadoc. */
-    static MathTransform create0(final int firstAffectedCoordinate, final MathTransform subTransform,
final int numTrailingCoordinates) {
+    static MathTransform create(final int firstAffectedCoordinate, final MathTransform subTransform,
final int numTrailingCoordinates) {
         Matrix matrix = MathTransforms.getMatrix(subTransform);
         if (matrix != null) {
             return newInstance(firstAffectedCoordinate, matrix, numTrailingCoordinates);
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/distance/LatLonPointRadiusTest.java
b/core/sis-referencing/src/test/java/org/apache/sis/distance/LatLonPointRadiusTest.java
deleted file mode 100644
index 0958264..0000000
--- a/core/sis-referencing/src/test/java/org/apache/sis/distance/LatLonPointRadiusTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.sis.distance;
-
-
-// JDK imports
-import java.awt.geom.Rectangle2D;
-
-// SIS imports
-import org.apache.sis.test.TestCase;
-import org.apache.sis.geometry.DirectPosition2D;
-
-// JUnit imports
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- * Tests methods from the {@link LatLonPointRadius} class.
- *
- * @author rlaidlaw
- */
-public strictfp class LatLonPointRadiusTest extends TestCase
-{
-  private static final double EPSILON = 0.000001;
-
-  /**
-   * Tests the LatLonPointRadius constructor.
-   */
-  @Test
-  public void testCreateLatLonPointRadius()
-  {
-    LatLonPointRadius region = new LatLonPointRadius(new DirectPosition2D(0.0, 0.0), 100.0);
-    assertNotNull(region);
-  }
-
-  /**
-   * Tests the getCircularRegionApproximation() method.
-   */
-  @Test
-  public void testGetCircularRegionApproximation()
-  {
-    LatLonPointRadius pr1 = new LatLonPointRadius(new DirectPosition2D(0.0, 0.0), 25000.0);
-    DirectPosition2D pts1[] = pr1.getCircularRegionApproximation(10);
-    assertEquals(5, pts1.length);
-    assertEquals(-90.0, pts1[0].y, EPSILON);
-    assertEquals(-180.0, pts1[0].x, EPSILON);
-    assertEquals(90.0, pts1[1].y, EPSILON);
-    assertEquals(-180.0, pts1[1].x, EPSILON);
-    assertEquals(90.0, pts1[2].y, EPSILON);
-    assertEquals(180.0, pts1[2].x, EPSILON);
-    assertEquals(-90.0, pts1[3].y, EPSILON);
-    assertEquals(180.0, pts1[3].x, EPSILON);
-    assertEquals(-90.0, pts1[4].y, EPSILON);
-    assertEquals(-180.0, pts1[4].x, EPSILON);
-
-    LatLonPointRadius pr2 = new LatLonPointRadius(new DirectPosition2D(0.0, 0.0), 1000.0);
-    DirectPosition2D pts2[] = pr2.getCircularRegionApproximation(6);
-    assertEquals(7, pts2.length);
-  }
-
-  /**
-   * Tests the getRectangularRegionApproximation() method.
-   */
-  @Test
-  public void testGetRectangularRegionApproximation()
-  {
-    LatLonPointRadius pr1 = new LatLonPointRadius(new DirectPosition2D(0.0, 0.0), 25000.0);
-    Rectangle2D r1 = pr1.getRectangularRegionApproximation(10);
-    assertEquals(0.0, r1.getX(), EPSILON);
-    assertEquals(0.0, r1.getY(), EPSILON);
-    assertEquals(360.0, r1.getWidth(), EPSILON);
-    assertEquals(180.0, r1.getHeight(), EPSILON);
-  }
-}
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
b/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
index 558a6fe..1a29823 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
@@ -276,9 +276,6 @@ import org.junit.BeforeClass;
     org.apache.sis.internal.referencing.ServicesForMetadataTest.class,
     org.apache.sis.internal.referencing.EllipsoidalHeightCombinerTest.class,
     org.apache.sis.geometry.CoordinateFormatTest.class,
-
-    org.apache.sis.distance.LatLonPointRadiusTest.class,        // Pending refactoring in
a geometry package.
-
     org.apache.sis.test.integration.CoordinateReferenceSystemTest.class,
     org.apache.sis.test.integration.CoordinateOperationTest.class,
     org.apache.sis.test.integration.DatumShiftTest.class,
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/ComparisonMode.java b/core/sis-utility/src/main/java/org/apache/sis/util/ComparisonMode.java
index 8b12933..c409796 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/ComparisonMode.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/ComparisonMode.java
@@ -174,14 +174,6 @@ public enum ComparisonMode {
     DEBUG;
 
     /**
-     * @deprecated Renamed {@link #APPROXIMATE}.
-     *
-     * @see <a href="https://issues.apache.org/jira/browse/SIS-440">SIS-440</a>
-     */
-    @Deprecated
-    public static final ComparisonMode APPROXIMATIVE = APPROXIMATE;
-
-    /**
      * Returns {@code true} if this comparison ignores metadata.
      * This method currently returns {@code true} for {@code IGNORE_METADATA}, {@code APPROXIMATE}
      * or {@code DEBUG} only, but this list may be extended in future SIS versions.
@@ -208,16 +200,6 @@ public enum ComparisonMode {
     }
 
     /**
-     * @deprecated Renamed {@link #isApproximate()}.
-     *
-     * @see <a href="https://issues.apache.org/jira/browse/SIS-440">SIS-440</a>
-     */
-    @Deprecated
-    public boolean isApproximative() {
-        return isApproximate();
-    }
-
-    /**
      * If the two given objects are equal according one of the modes enumerated in this class,
      * then returns that mode. Otherwise returns {@code null}.
      *
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java b/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
index d11a357..8adf5b4 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
@@ -113,16 +113,6 @@ public final class Utilities extends Static {
     }
 
     /**
-     * @deprecated Renamed {@link #equalsApproximately(Object, Object)}.
-     *
-     * @see <a href="https://issues.apache.org/jira/browse/SIS-440">SIS-440</a>
-     */
-    @Deprecated
-    public static boolean equalsApproximatively(final Object object1, final Object object2)
{
-        return equalsApproximately(object1, object2);
-    }
-
-    /**
      * Convenience method for testing two objects for equality using the given level of strictness.
      * If at least one of the given objects implement the {@link LenientComparable} interface,
then
      * the comparison is performed using the {@link LenientComparable#equals(Object, ComparisonMode)}
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListener.java
b/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListener.java
index a97777a..642e773 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListener.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListener.java
@@ -42,7 +42,6 @@ import java.util.logging.Filter;
  * @param <S>  the base type of objects that emit warnings (the <cite>source</cite>).
  *
  * @see WarningListeners
- * @see org.apache.sis.storage.DataStore#addWarningListener(WarningListener)
  * @see org.apache.sis.storage.event.StoreListener
  *
  * @since 0.3
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListeners.java
b/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListeners.java
index cf51192..1e4717e 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListeners.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/logging/WarningListeners.java
@@ -363,14 +363,4 @@ public class WarningListeners<S> implements Localized {
         return (current != null) ? UnmodifiableArrayList.wrap(current) : Collections.emptyList();
     }
 
-    /**
-     * Returns {@code true} if this object contains at least one listener.
-     *
-     * @return {@code true} if this object contains at least one listener, {@code false}
otherwise.
-     *
-     * @since 0.4
-     */
-    public synchronized boolean hasListeners() {
-        return listeners != null;
-    }
 }
diff --git a/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
b/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
index 7da3477..3702235 100644
--- a/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
+++ b/core/sis-utility/src/test/java/org/apache/sis/test/suite/UtilityTestSuite.java
@@ -52,7 +52,6 @@ import org.junit.BeforeClass;
     org.apache.sis.util.resources.IndexedResourceBundleTest.class,
     org.apache.sis.util.ArgumentChecksTest.class,                       // Uses resources.
     org.apache.sis.util.logging.PerformanceLevelTest.class,
-    org.apache.sis.util.logging.WarningListenersTest.class,
     org.apache.sis.util.logging.MonolineFormatterTest.class,
     org.apache.sis.util.logging.LoggerAdapterTest.class,
     org.apache.sis.math.FractionTest.class,
diff --git a/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java
b/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java
deleted file mode 100644
index 42b7318..0000000
--- a/core/sis-utility/src/test/java/org/apache/sis/util/logging/WarningListenersTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sis.util.logging;
-
-import java.util.logging.LogRecord;
-import java.util.NoSuchElementException;
-import org.apache.sis.test.DependsOnMethod;
-import org.apache.sis.test.TestCase;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-
-/**
- * Tests the {@link WarningListeners} class.
- *
- * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
- * @since   0.3
- * @module
- */
-@Deprecated
-public final strictfp class WarningListenersTest extends TestCase implements WarningListener<String>
{
-    /**
-     * The object to be tested. Its source will be set to the string {@code "source"}.
-     */
-    private final WarningListeners<String> listeners;
-
-    /**
-     * The warning received by {@link #warningOccured(String, LogRecord)}.
-     * This is stored for allowing test methods to verify the properties.
-     */
-    private LogRecord warning;
-
-    /**
-     * Creates a new test case.
-     */
-    public WarningListenersTest() {
-        listeners = new WarningListeners<>("source");
-    }
-
-    /**
-     * Returns the type warning sources.
-     */
-    @Override
-    public Class<String> getSourceClass() {
-        return String.class;
-    }
-
-    /**
-     * Invoked when a warning occurred. The implementation in this test verifies that the
{@code source} argument has
-     * the expected values, then stores the log record in the {@link #warning} field for
inspection by the test method.
-     */
-    @Override
-    public void warningOccured(final String source, final LogRecord warning) {
-        assertEquals("source", source);
-        this.warning = warning;
-    }
-
-    /**
-     * Returns {@code "TestListener"}, for verification of error messages in exceptions.
-     */
-    @Override
-    public String toString() {
-        return "TestListener";
-    }
-
-    /**
-     * Tests {@link WarningListeners#addWarningListener(WarningListener)} followed by
-     * {@link WarningListeners#removeWarningListener(WarningListener)}
-     */
-    @Test
-    public void testAddAndRemoveWarningListener() {
-        listeners.addWarningListener(this);
-        try {
-            listeners.addWarningListener(this);
-        } catch (IllegalArgumentException e) {
-            // This is the expected exception.
-            assertTrue(e.getMessage().contains("TestListener"));
-        }
-        listeners.removeWarningListener(this);
-        try {
-            listeners.removeWarningListener(this);
-        } catch (NoSuchElementException e) {
-            // This is the expected exception.
-            assertTrue(e.getMessage().contains("TestListener"));
-        }
-    }
-
-    /**
-     * Tests {@link WarningListeners#warning(String, Exception)} with a registered listener.
-     */
-    @Test
-    @DependsOnMethod("testAddAndRemoveWarningListener")
-    public void testWarning() {
-        listeners.addWarningListener(this);
-        listeners.warning("The message", null);
-        listeners.removeWarningListener(this);
-        assertNotNull("Listener has not been notified.", warning);
-        assertEquals(getClass().getName(), warning.getSourceClassName());
-        assertEquals("testWarning", warning.getSourceMethodName());
-        assertEquals("The message", warning.getMessage());
-    }
-}
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java b/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
index 194a435..d8bdffd 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
@@ -19,7 +19,6 @@ package org.apache.sis.storage;
 import java.util.Locale;
 import java.util.Map;
 import java.util.IdentityHashMap;
-import java.util.NoSuchElementException;
 import java.util.Optional;
 import org.opengis.util.ScopedName;
 import org.opengis.util.GenericName;
@@ -30,7 +29,6 @@ import org.opengis.metadata.identification.Identification;
 import org.opengis.parameter.ParameterValueGroup;
 import org.apache.sis.util.Localized;
 import org.apache.sis.util.ArgumentChecks;
-import org.apache.sis.util.logging.WarningListener;
 import org.apache.sis.internal.storage.StoreUtilities;
 import org.apache.sis.internal.storage.Resources;
 import org.apache.sis.internal.util.Strings;
@@ -486,56 +484,6 @@ public abstract class DataStore implements Resource, Localized, AutoCloseable
{
     }
 
     /**
-     * Adds a listener to be notified when a warning occurred while reading from or writing
to the storage.
-     * When a warning occurs, there is a choice:
-     *
-     * <ul>
-     *   <li>If this data store has no warning listener, then the warning is logged
at
-     *       {@link java.util.logging.Level#WARNING}.</li>
-     *   <li>If this data store has at least one warning listener, then all listeners
are notified
-     *       and the warning is <strong>not</strong> logged by this data store
instance.</li>
-     * </ul>
-     *
-     * Consider invoking this method in a {@code try} … {@code finally} block if the {@code
DataStore}
-     * lifetime is longer than the listener lifetime, as below:
-     *
-     * {@preformat java
-     *     datastore.addWarningListener(listener);
-     *     try {
-     *         // Do some work...
-     *     } finally {
-     *         datastore.removeWarningListener(listener);
-     *     }
-     * }
-     *
-     * @param  listener  the listener to add.
-     * @throws IllegalArgumentException if the given listener is already registered in this
data store.
-     *
-     * @deprecated Replaced by {@code addListener(listener, WarningEvent.class)}.
-     */
-    @Deprecated
-    public void addWarningListener(final WarningListener<? super DataStore> listener)
-            throws IllegalArgumentException
-    {
-        listeners.addWarningListener(listener);
-    }
-
-    /**
-     * Removes a previously registered listener.
-     *
-     * @param  listener  the listener to remove.
-     * @throws NoSuchElementException if the given listener is not registered in this data
store.
-     *
-     * @deprecated Replaced by {@code removeListener(listener, WarningEvent.class)}.
-     */
-    @Deprecated
-    public void removeWarningListener(final WarningListener<? super DataStore> listener)
-            throws NoSuchElementException
-    {
-        listeners.removeWarningListener(listener);
-    }
-
-    /**
      * Closes this data store and releases any underlying resources.
      *
      * @throws DataStoreException if an error occurred while closing this data store.
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/event/StoreListeners.java
b/storage/sis-storage/src/main/java/org/apache/sis/storage/event/StoreListeners.java
index 01521cb..1b70be5 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/event/StoreListeners.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/event/StoreListeners.java
@@ -617,16 +617,6 @@ public class StoreListeners extends org.apache.sis.util.logging.WarningListeners
         return false;
     }
 
-    /**
-     * Returns {@code true} if this object contains at least one listener.
-     *
-     * @return {@code true} if this object contains at least one listener, {@code false}
otherwise.
-     */
-    @Override
-    @Deprecated
-    public boolean hasListeners() {
-        return hasListeners(StoreEvent.class);
-    }
 
     /**
      * @deprecated Replaced by {@code addListener(listener, WarningEvent.class)}.


Mime
View raw message