This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-3.1 in repository https://gitbox.apache.org/repos/asf/sis.git
commit ecb7e5eb33ce477bc2f2f4aa24d2231425b26701 Merge: 9c83ff49c1 9e0e1fb26b Author: Martin Desruisseaux <[email protected]> AuthorDate: Thu May 16 17:37:51 2024 +0200 Merge branch 'geoapi-4.0' into geoapi-3.1, but continue to throw the deprecated `MismatchedDimensionException` internally. This is for compatibility with `catch` clause of user code. The deprecated exception may be removed in GeoAPI 4. .../coverage/MismatchedCoverageRangeException.java | 2 +- .../sis/coverage/grid/BufferedGridCoverage.java | 2 +- .../sis/coverage/grid/DimensionalityReduction.java | 2 +- .../coverage/grid/FractionalGridCoordinates.java | 4 +-- .../org/apache/sis/coverage/grid/GridCoverage.java | 2 +- .../apache/sis/coverage/grid/GridCoverage2D.java | 4 +-- .../org/apache/sis/coverage/grid/GridExtent.java | 4 +-- .../org/apache/sis/coverage/grid/GridGeometry.java | 4 +-- .../sis/coverage/privy/CommonDomainFinder.java | 2 +- .../sis/filter/internal/GeometryConverter.java | 2 +- .../sis/coverage/grid/GridCoverage2DTest.java | 2 +- .../apache/sis/geometry/wrapper/jts/JTSTest.java | 2 +- .../metadata/iso/extent/DefaultVerticalExtent.java | 8 ++--- .../apache/sis/metadata/iso/extent/Extents.java | 4 +-- .../sis/pending/temporal/TemporalUtilities.java | 35 +++++++++++++++++++--- .../org/apache/sis/xml/bind/gml/TM_Primitive.java | 5 ++-- .../main/org/apache/sis/portrayal/Canvas.java | 8 ++--- .../sis/geometry/AbstractDirectPosition.java | 12 ++++---- .../org/apache/sis/geometry/AbstractEnvelope.java | 10 +++---- .../org/apache/sis/geometry/ArrayEnvelope.java | 10 +++---- .../org/apache/sis/geometry/DirectPosition1D.java | 2 +- .../org/apache/sis/geometry/DirectPosition2D.java | 2 +- .../main/org/apache/sis/geometry/Envelope2D.java | 8 ++--- .../apache/sis/geometry/GeneralDirectPosition.java | 2 +- .../org/apache/sis/geometry/GeneralEnvelope.java | 10 +++---- .../org/apache/sis/geometry/ImmutableEnvelope.java | 8 ++--- .../sis/referencing/crs/AbstractDerivedCRS.java | 2 +- .../sis/referencing/crs/DefaultDerivedCRS.java | 2 +- .../sis/referencing/crs/DefaultProjectedCRS.java | 2 +- .../sis/referencing/datum/DefaultEllipsoid.java | 17 +++++------ .../referencing/internal/PositionTransformer.java | 2 +- .../apache/sis/referencing/internal/RTreeNode.java | 4 +-- .../operation/InverseOperationMethod.java | 2 +- .../operation/MismatchedDatumException.java | 4 +-- .../operation/TransformedCoordinateSet.java | 2 +- .../operation/builder/LinearTransformBuilder.java | 14 +++++---- .../operation/builder/LocalizationGridBuilder.java | 7 +++-- .../sis/referencing/operation/matrix/Matrices.java | 4 +-- .../matrix/MismatchedMatrixSizeException.java | 4 +-- .../operation/transform/AbstractMathTransform.java | 5 ++-- .../transform/AbstractMathTransform1D.java | 2 +- .../transform/DefaultMathTransformFactory.java | 16 ++++++++++ .../operation/transform/MathTransforms.java | 2 +- .../operation/transform/PassThroughTransform.java | 7 +++-- .../wkt/{WKTParserTest.java => CRSParserTest.java} | 6 ++-- .../operation/provider/ProviderMock.java | 2 +- .../operation/provider/SeismicBinGridMock.java | 2 +- .../transform/MathTransformFactoryBase.java | 6 ++++ .../transform/MathTransformFactoryMock.java | 13 ++++++++ .../operation/transform/MathTransformWrapper.java | 2 +- .../transform/TransformResultComparator.java | 2 +- .../main/org/apache/sis/math/Line.java | 7 +++-- .../main/org/apache/sis/math/Plane.java | 7 +++-- .../main/org/apache/sis/util/ArgumentChecks.java | 21 ++++++------- geoapi/snapshot | 2 +- .../sis/map/service/se1/PresentationToScene2D.java | 2 +- .../main/org/apache/sis/gui/map/MapCanvas.java | 2 +- .../main/org/apache/sis/gui/map/StatusBar.java | 2 +- 58 files changed, 199 insertions(+), 131 deletions(-) diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/FractionalGridCoordinates.java index a7e59a1e39,c1a3fd6284..0058248a1b --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/FractionalGridCoordinates.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/FractionalGridCoordinates.java @@@ -248,7 -248,7 +248,7 @@@ public class FractionalGridCoordinates if (bounds != null) { final int bd = bounds.getDimension(); if (bd != dimension) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, "bounds", dimension, bd)); } } diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridCoverage2D.java index c284a4d2d2,91343a9c73..0d4d78952f --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridCoverage2D.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridCoverage2D.java @@@ -572,7 -572,7 +572,7 @@@ public class GridCoverage2D extends Gri final int expected = gridGeometry.getDimension(); final int dimension = sliceExtent.getDimension(); if (expected != dimension) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, "sliceExtent", expected, dimension)); } } diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridExtent.java index d7efe9281e,d7d5758175..00495cfbc2 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridExtent.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridExtent.java @@@ -1975,7 -1975,7 +1975,7 @@@ public class GridExtent implements Grid final int n = coordinates.length; final int m = n >>> 1; if (n != other.coordinates.length) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, param, m, other.getDimension())); } // First condition below is a fast check for a common case. diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridGeometry.java index 391cf49463,18db5b1952..9fc44f963c --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridGeometry.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridGeometry.java @@@ -569,7 -569,7 +569,7 @@@ public class GridGeometry implements Le if (extent != null) { final int dimension = extent.getDimension(); if (dimension != expected) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, "extent", expected, dimension)); } } diff --cc endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/portrayal/Canvas.java index 35171bfb6c,8d69567214..418a5c2842 --- a/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/portrayal/Canvas.java +++ b/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/portrayal/Canvas.java @@@ -737,7 -737,7 +737,7 @@@ public class Canvas extends Observable return; } } -- throw new MismatchedDimensionException(errors().getString( ++ throw new org.opengis.geometry.MismatchedDimensionException(errors().getString( Errors.Keys.MismatchedDimension_3, OBJECTIVE_TO_DISPLAY_PROPERTY, expected, actual)); } diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/ArrayEnvelope.java index ee7457c1c2,22b675f9c8..c7b46a7fc5 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/ArrayEnvelope.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/ArrayEnvelope.java @@@ -312,7 -312,7 +312,7 @@@ scanNumber: while ((i += Character.char */ static void ensureSameDimension(final int dim1, final int dim2) throws MismatchedDimensionException { if (dim1 != dim2) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_2, dim1, dim2)); } } diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/GeneralEnvelope.java index 137f1b6a64,72c8a46084..0d3086f73f --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/GeneralEnvelope.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/geometry/GeneralEnvelope.java @@@ -386,7 -386,7 +386,7 @@@ public class GeneralEnvelope extends Ar } final int d = corners.length >>> 1; if (d != dimension) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, "coordinates", dimension, d)); } } diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/InverseOperationMethod.java index 2ada34c583,677ca42b60..b0a75916a3 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/InverseOperationMethod.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/InverseOperationMethod.java @@@ -103,10 -103,10 +103,10 @@@ final class InverseOperationMethod exte } Identifier name = method.getName(); name = new ImmutableIdentifier(null, null, "Inverse of " + name.getCode()); - final Map<String,Object> properties = new HashMap<>(6); + final var properties = new HashMap<String,Object>(6); properties.put(NAME_KEY, name); properties.put(FORMULA_KEY, method.getFormula()); - method.getRemarks().ifPresent((remarks) -> properties.put(REMARKS_KEY, remarks)); + properties.put(REMARKS_KEY, method.getRemarks()); if (method instanceof Deprecable) { properties.put(DEPRECATED_KEY, ((Deprecable) method).isDeprecated()); } diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java index ba106b44f8,3445077bd2..31831f0716 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java @@@ -410,7 -410,7 +410,8 @@@ search: for (int j=numPoints; --j >= 0; return; } if (actual != expected) { -- throw new MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedDimension_3, "source", expected, actual)); ++ throw new org.opengis.geometry.MismatchedDimensionException( ++ Errors.format(Errors.Keys.MismatchedDimension_3, "source", expected, actual)); } } @@@ -420,8 -420,8 +421,9 @@@ * with {@link #numPoints} the index of the next point that we failed to add. */ private MismatchedDimensionException mismatchedDimension(final String name, final int expected, final int actual) { -- return new MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedDimension_3, -- Strings.toIndexed(name, numPoints), expected, actual)); ++ return new org.opengis.geometry.MismatchedDimensionException( ++ Errors.format(Errors.Keys.MismatchedDimension_3, ++ Strings.toIndexed(name, numPoints), expected, actual)); } /** @@@ -577,7 -577,7 +579,7 @@@ } final int srcDim = gridToCRS.getSourceDimensions(); if (srcDim != gridSize.length) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedTransformDimension_4, "gridToCRS", 0, gridSize.length, srcDim)); } final int tgtDim = gridToCRS.getTargetDimensions(); @@@ -975,7 -975,7 +977,7 @@@ search: for (int j=domain(); -- verifySourceDimension(source.length); final int tgtDim = target.length; if (targets != null && tgtDim != targets.length) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, "target", targets.length, tgtDim)); } int index; diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/builder/LocalizationGridBuilder.java index 33bed8a709,b28c76edf5..d165418336 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/builder/LocalizationGridBuilder.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/builder/LocalizationGridBuilder.java @@@ -381,8 -381,8 +381,9 @@@ public class LocalizationGridBuilder ex return; } } -- throw new MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedTransformDimension_4, -- "sourceToGrid", isTarget, SOURCE_DIMENSION, dim)); ++ throw new org.opengis.geometry.MismatchedDimensionException( ++ Errors.format(Errors.Keys.MismatchedTransformDimension_4, ++ "sourceToGrid", isTarget, SOURCE_DIMENSION, dim)); } /** diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java index 2076fb52ae,1cca954ddf..b3aff693e2 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/AbstractMathTransform.java @@@ -284,7 -284,7 +284,8 @@@ public abstract class AbstractMathTrans * @param dimension the wrong dimension. */ static MismatchedDimensionException mismatchedDimension(final String argument, final int expected, final int dimension) { -- return new MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedDimension_3, argument, expected, dimension)); ++ return new org.opengis.geometry.MismatchedDimensionException( ++ Errors.format(Errors.Keys.MismatchedDimension_3, argument, expected, dimension)); } /** diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/PassThroughTransform.java index 603ea104ae,8e46ff6a9f..ae18041b45 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/PassThroughTransform.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/PassThroughTransform.java @@@ -256,8 -256,8 +256,9 @@@ public class PassThroughTransform exten final int subDim = subTransform.getSourceDimensions(); final int actual = modifiedCoordinates.cardinality(); if (actual != subDim) { -- throw new MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedDimension_3, -- "modifiedCoordinates", subDim, actual)); ++ throw new org.opengis.geometry.MismatchedDimensionException( ++ Errors.format(Errors.Keys.MismatchedDimension_3, ++ "modifiedCoordinates", subDim, actual)); } final var sep = new TransformSeparator(subTransform, factory); MathTransform result = MathTransforms.identity(resultDim); diff --cc endorsed/src/org.apache.sis.util/main/org/apache/sis/math/Line.java index 3c88e7a4bd,4f7ca4fcc5..e03a9397b6 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/math/Line.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/math/Line.java @@@ -308,8 -308,8 +308,9 @@@ public class Line implements DoubleUnar for (final DirectPosition p : points) { final int dimension = p.getDimension(); if (dimension != DIMENSION) { -- throw new MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedDimension_3, -- Strings.toIndexed("points", i), DIMENSION, dimension)); ++ throw new org.opengis.geometry.MismatchedDimensionException( ++ Errors.format(Errors.Keys.MismatchedDimension_3, ++ Strings.toIndexed("points", i), DIMENSION, dimension)); } i++; final double x,y; diff --cc endorsed/src/org.apache.sis.util/main/org/apache/sis/math/Plane.java index e1578ad04d,aa9cbc0b31..cb597af297 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/math/Plane.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/math/Plane.java @@@ -401,8 -401,8 +401,9 @@@ public class Plane implements DoubleBin for (final DirectPosition p : points) { final int dimension = p.getDimension(); if (dimension != DIMENSION) { -- throw new MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedDimension_3, -- Strings.toIndexed("points", i), DIMENSION, dimension)); ++ throw new org.opengis.geometry.MismatchedDimensionException( ++ Errors.format(Errors.Keys.MismatchedDimension_3, ++ Strings.toIndexed("points", i), DIMENSION, dimension)); } i++; final double x = p.getCoordinate(0); if (Double.isNaN(x)) continue; diff --cc endorsed/src/org.apache.sis.util/main/org/apache/sis/util/ArgumentChecks.java index d0da9bcc3b,12f17ac4a0..a81c038737 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/ArgumentChecks.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/ArgumentChecks.java @@@ -771,7 -771,7 +771,7 @@@ public final class ArgumentChecks exten if (cs != null) { // Should never be null, but let be safe. final int dimension = cs.getDimension(); if (dimension != expected) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, name, expected, dimension)); } } @@@ -796,7 -796,7 +796,7 @@@ if (cs != null) { final int dimension = cs.getDimension(); if (dimension != expected) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, name, expected, dimension)); } } @@@ -820,7 -820,7 +820,7 @@@ if (indices != null) { final int dimension = indices.length; if (dimension != expected) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, name, expected, dimension)); } } @@@ -842,7 -842,7 +842,7 @@@ if (vector != null) { final int dimension = vector.length; if (dimension != expected) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, name, expected, dimension)); } } @@@ -864,7 -864,7 +864,7 @@@ if (position != null) { final int dimension = position.getDimension(); if (dimension != expected) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, name, expected, dimension)); } } @@@ -886,7 -886,7 +886,7 @@@ if (envelope != null) { final int dimension = envelope.getDimension(); if (dimension != expected) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, name, expected, dimension)); } } @@@ -910,7 -910,7 +910,7 @@@ if (envelope != null) { final int dimension = envelope.getDimension(); if (dimension != expected) { -- throw new MismatchedDimensionException(Errors.format( ++ throw new org.opengis.geometry.MismatchedDimensionException(Errors.format( Errors.Keys.MismatchedDimension_3, name, expected, dimension)); } } @@@ -943,8 -943,8 +943,9 @@@ expectedSource = expectedTarget; side = 1; } -- throw new MismatchedDimensionException(Errors.format(Errors.Keys.MismatchedTransformDimension_4, -- name, side, expectedSource, dimension)); ++ throw new org.opengis.geometry.MismatchedDimensionException( ++ Errors.format(Errors.Keys.MismatchedTransformDimension_4, ++ name, side, expectedSource, dimension)); } } } diff --cc geoapi/snapshot index 32cfb0099f,098de66054..1fe645ba50 --- a/geoapi/snapshot +++ b/geoapi/snapshot @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 32cfb0099f9fc752e39e4d1f25c2a59ac4c909ed -Subproject commit 098de66054a7246dbc88aa6740e098695f668d85 ++Subproject commit 1fe645ba50f15bb3ab97f93892fc4fdb236d3720
