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 51fff833a7694f88ee920141e2a26acaea9b3388 Merge: 3520afc392 99f667e72b Author: Martin Desruisseaux <[email protected]> AuthorDate: Sat Feb 10 13:52:16 2024 +0100 Merge branch 'geoapi-3.1'. .../sis/buildtools/coding/ReorganizeImports.java | 5 +- .../org/apache/sis/cloud/aws/s3/FileService.java | 2 +- .../main/org/apache/sis/console/SIS.java | 2 +- .../org/apache/sis/coverage/BandedCoverage.java | 2 +- .../main/org/apache/sis/coverage/Category.java | 11 +- .../main/org/apache/sis/coverage/CategoryList.java | 12 +- .../org/apache/sis/coverage/ConvertedCategory.java | 2 +- .../org/apache/sis/coverage/CoverageCombiner.java | 2 - .../org/apache/sis/coverage/SampleDimension.java | 26 +- .../sis/coverage/grid/BufferedGridCoverage.java | 7 +- .../coverage/grid/CoordinateOperationFinder.java | 5 +- .../apache/sis/coverage/grid/DefaultEvaluator.java | 6 +- .../sis/coverage/grid/DimensionalityReduction.java | 20 +- .../apache/sis/coverage/grid/DomainLinearizer.java | 22 +- .../apache/sis/coverage/grid/GridClippingMode.java | 2 +- .../sis/coverage/grid/GridCoordinatesView.java | 5 +- .../org/apache/sis/coverage/grid/GridCoverage.java | 16 +- .../apache/sis/coverage/grid/GridCoverage2D.java | 8 +- .../sis/coverage/grid/GridCoverageBuilder.java | 19 +- .../sis/coverage/grid/GridCoverageProcessor.java | 14 +- .../apache/sis/coverage/grid/GridDerivation.java | 15 +- .../org/apache/sis/coverage/grid/GridExtent.java | 33 +- .../org/apache/sis/coverage/grid/GridGeometry.java | 33 +- .../apache/sis/coverage/grid/GridOrientation.java | 4 +- .../apache/sis/coverage/grid/ImageRenderer.java | 21 +- .../apache/sis/coverage/grid/PixelTranslation.java | 14 +- .../apache/sis/coverage/grid/ReshapedImage.java | 2 - .../sis/coverage/grid/j2d/ColorsForRange.java | 3 +- .../sis/coverage/grid/j2d/ImageUtilities.java | 8 +- .../sis/coverage/grid/j2d/TilePlaceholder.java | 5 +- .../org/apache/sis/coverage/grid/package-info.java | 4 +- .../sis/coverage/internal/CompoundTransform.java | 1 - .../apache/sis/feature/AbstractAssociation.java | 3 - .../org/apache/sis/feature/AbstractAttribute.java | 5 +- .../org/apache/sis/feature/AbstractFeature.java | 6 +- .../apache/sis/feature/AbstractIdentifiedType.java | 11 +- .../org/apache/sis/feature/CharacteristicMap.java | 5 - .../apache/sis/feature/CharacteristicTypeMap.java | 9 +- .../apache/sis/feature/DefaultAssociationRole.java | 10 +- .../apache/sis/feature/DefaultAttributeType.java | 8 +- .../org/apache/sis/feature/DefaultFeatureType.java | 11 +- .../main/org/apache/sis/feature/DenseFeature.java | 6 +- .../main/org/apache/sis/feature/FeatureFormat.java | 2 +- .../org/apache/sis/feature/FeatureOperations.java | 4 +- .../main/org/apache/sis/feature/Field.java | 2 - .../sis/feature/FoliationRepresentation.java | 4 +- .../main/org/apache/sis/feature/LinkOperation.java | 2 - .../apache/sis/feature/MultiValuedAssociation.java | 2 +- .../org/apache/sis/feature/OperationResult.java | 3 +- .../main/org/apache/sis/feature/SparseFeature.java | 5 +- .../apache/sis/feature/StringJoinOperation.java | 5 +- .../main/org/apache/sis/feature/package-info.java | 12 +- .../main/org/apache/sis/filter/BinaryFunction.java | 8 +- .../apache/sis/filter/BinaryGeometryFilter.java | 10 +- .../org/apache/sis/filter/BinarySpatialFilter.java | 11 +- .../org/apache/sis/filter/ComparisonFilter.java | 5 +- .../org/apache/sis/filter/DefaultSortProperty.java | 8 +- .../main/org/apache/sis/filter/DistanceFilter.java | 11 +- .../main/org/apache/sis/filter/LikeFilter.java | 7 +- .../main/org/apache/sis/filter/LogicalFilter.java | 6 +- .../main/org/apache/sis/filter/UnaryFunction.java | 7 +- .../sis/filter/internal/GeometryConverter.java | 8 +- .../main/org/apache/sis/filter/package-info.java | 2 +- .../sis/geometry/wrapper/GeometryWrapper.java | 6 +- .../geometry/wrapper/SpatialOperationContext.java | 4 +- .../org/apache/sis/geometry/wrapper/jts/JTS.java | 7 +- .../sis/geometry/wrapper/jts/ShapeAdapter.java | 3 +- .../apache/sis/image/BandedSampleConverter.java | 2 +- .../main/org/apache/sis/image/ComputedImage.java | 7 +- .../main/org/apache/sis/image/ComputedTiles.java | 1 - .../main/org/apache/sis/image/DataType.java | 2 - .../main/org/apache/sis/image/ImageAdapter.java | 7 +- .../main/org/apache/sis/image/ImageCombiner.java | 8 +- .../main/org/apache/sis/image/ImageProcessor.java | 26 +- .../main/org/apache/sis/image/PixelIterator.java | 15 +- .../main/org/apache/sis/image/PlanarImage.java | 5 +- .../sis/image/PositionalConsistencyImage.java | 4 +- .../main/org/apache/sis/image/ResamplingGrid.java | 2 +- .../main/org/apache/sis/image/UserProperties.java | 5 +- .../main/org/apache/sis/image/package-info.java | 2 +- .../org/apache/sis/index/tree/NodeIterator.java | 1 - .../main/org/apache/sis/index/tree/PointTree.java | 9 +- .../org/apache/sis/index/tree/PointTreeNode.java | 6 +- .../apache/sis/coverage/grid/GridGeometryTest.java | 6 +- .../apache/sis/feature/test/FeatureComparator.java | 10 +- .../sis/image/processing/isoline/StepsViewer.java | 1 - .../org/apache/sis/index/tree/PointTreeTest.java | 6 +- .../org/apache/sis/metadata/AbstractMetadata.java | 2 +- .../org/apache/sis/metadata/MetadataStandard.java | 10 +- .../apache/sis/metadata/ModifiableMetadata.java | 9 +- .../org/apache/sis/metadata/PropertyAccessor.java | 32 +- .../main/org/apache/sis/metadata/TreeNode.java | 8 +- .../org/apache/sis/metadata/TreeNodeChildren.java | 2 +- .../org/apache/sis/metadata/TypeValuePolicy.java | 2 +- .../apache/sis/metadata/internal/AxisNames.java | 4 +- .../org/apache/sis/metadata/internal/Merger.java | 17 +- .../sis/metadata/internal/NameToIdentifier.java | 4 +- .../apache/sis/metadata/iso/DefaultMetadata.java | 4 +- .../sis/metadata/iso/citation/Citations.java | 2 +- .../iso/content/DefaultSampleDimension.java | 4 +- .../DefaultDigitalTransferOptions.java | 2 +- .../iso/extent/AbstractGeographicExtent.java | 6 +- .../sis/metadata/iso/extent/DefaultExtent.java | 12 +- .../iso/extent/DefaultGeographicBoundingBox.java | 13 +- .../metadata/iso/extent/DefaultVerticalExtent.java | 2 - .../apache/sis/metadata/iso/extent/Extents.java | 4 +- .../iso/identification/DefaultResolution.java | 2 +- .../metadata/iso/legacy/LegacyPropertyAdapter.java | 4 +- .../maintenance/DefaultMaintenanceInformation.java | 4 +- .../iso/maintenance/DefaultScopeDescription.java | 34 +- .../sis/metadata/iso/maintenance/package-info.java | 2 +- .../iso/quality/DefaultEvaluationMethod.java | 4 +- .../sis/metadata/iso/spatial/DefaultGCP.java | 2 +- .../apache/sis/metadata/sql/MetadataSource.java | 5 +- .../apache/sis/metadata/sql/MetadataWriter.java | 2 +- .../org/apache/sis/metadata/sql/package-info.java | 2 +- .../apache/sis/metadata/sql/util/ScriptRunner.java | 1 - .../org/apache/sis/util/iso/DefaultLocalName.java | 6 +- .../org/apache/sis/util/iso/DefaultMemberName.java | 4 +- .../apache/sis/util/iso/DefaultNameFactory.java | 1 - .../org/apache/sis/util/iso/DefaultNameSpace.java | 5 +- .../org/apache/sis/util/iso/DefaultRecord.java | 5 +- .../apache/sis/util/iso/DefaultRecordSchema.java | 4 +- .../org/apache/sis/util/iso/DefaultRecordType.java | 12 +- .../org/apache/sis/util/iso/DefaultScopedName.java | 1 - .../main/org/apache/sis/util/iso/Names.java | 4 +- .../org/apache/sis/util/iso/RecordDefinition.java | 5 +- .../main/org/apache/sis/util/iso/Types.java | 7 +- .../main/org/apache/sis/util/iso/package-info.java | 2 +- .../main/org/apache/sis/xml/IdentifierSpace.java | 4 +- .../main/org/apache/sis/xml/MarshallerPool.java | 7 +- .../main/org/apache/sis/xml/Namespaces.java | 5 +- .../org/apache/sis/xml/TransformingNamespaces.java | 6 +- .../main/org/apache/sis/xml/XML.java | 6 +- .../apache/sis/xml/bind/AdapterReplacement.java | 2 +- .../main/org/apache/sis/xml/bind/Context.java | 1 - .../apache/sis/xml/bind/IdentifierMapAdapter.java | 7 +- .../sis/xml/bind/ModifiableIdentifierMap.java | 2 +- .../org/apache/sis/xml/bind/gco/PropertyType.java | 2 +- .../org/apache/sis/xml/bind/gco/package-info.java | 2 +- .../apache/sis/xml/bind/lan/LocaleAndCharset.java | 23 +- .../bind/metadata/replace/QualityParameter.java | 2 +- .../apache/sis/metadata/PropertyAccessorTest.java | 2 +- .../main/org/apache/sis/portrayal/Canvas.java | 22 +- .../org/apache/sis/portrayal/CanvasExtent.java | 4 +- .../org/apache/sis/portrayal/CanvasFollower.java | 12 +- .../org/apache/sis/portrayal/PlanarCanvas.java | 12 +- .../apache/sis/portrayal/TransformChangeEvent.java | 5 +- .../org/apache/sis/style/se1/StyleElement.java | 5 +- .../org/apache/sis/style/se1/StyleFactory.java | 5 +- .../apache/sis/profile/france/FrenchProfile.java | 2 +- .../sis/profile/japan/netcdf/FactoryForUCAR.java | 2 + .../apache/sis/profile/japan/netcdf/GCOM_C.java | 2 +- .../referencing/gazetteer/FinalLocationType.java | 6 +- .../gazetteer/GeohashReferenceSystem.java | 3 +- .../sis/referencing/gazetteer/LocationFormat.java | 2 +- .../gazetteer/MilitaryGridReferenceSystem.java | 9 +- .../gazetteer/ModifiableLocationType.java | 10 +- .../gazetteer/ReferenceVerifyException.java | 4 +- .../gazetteer/ReferencingByIdentifiers.java | 4 +- .../sis/referencing/gazetteer/SimpleLocation.java | 2 +- .../sis/referencing/gazetteer/package-info.java | 2 +- .../sis/geometry/AbstractDirectPosition.java | 12 +- .../org/apache/sis/geometry/AbstractEnvelope.java | 33 +- .../org/apache/sis/geometry/ArrayEnvelope.java | 28 +- .../org/apache/sis/geometry/CoordinateFormat.java | 17 +- .../org/apache/sis/geometry/DirectPosition1D.java | 4 +- .../org/apache/sis/geometry/DirectPosition2D.java | 8 +- .../main/org/apache/sis/geometry/Envelope2D.java | 20 +- .../main/org/apache/sis/geometry/Envelopes.java | 6 +- .../apache/sis/geometry/GeneralDirectPosition.java | 2 +- .../org/apache/sis/geometry/GeneralEnvelope.java | 54 ++- .../org/apache/sis/geometry/ImmutableEnvelope.java | 4 +- .../main/org/apache/sis/geometry/SubEnvelope.java | 14 +- .../apache/sis/geometry/WraparoundAdjustment.java | 8 +- .../apache/sis/geometry/WraparoundInEnvelope.java | 1 - .../main/org/apache/sis/geometry/package-info.java | 2 +- .../main/org/apache/sis/io/wkt/AbstractParser.java | 8 +- .../main/org/apache/sis/io/wkt/Colors.java | 2 +- .../main/org/apache/sis/io/wkt/Convention.java | 4 +- .../main/org/apache/sis/io/wkt/Element.java | 4 +- .../main/org/apache/sis/io/wkt/ElementKind.java | 2 +- .../org/apache/sis/io/wkt/FormattableObject.java | 17 +- .../main/org/apache/sis/io/wkt/Formatter.java | 2 +- .../apache/sis/io/wkt/GeodeticObjectParser.java | 30 +- .../org/apache/sis/io/wkt/MathTransformParser.java | 4 +- .../main/org/apache/sis/io/wkt/Symbols.java | 7 +- .../main/org/apache/sis/io/wkt/Transliterator.java | 8 +- .../sis/io/wkt/UnparsableObjectException.java | 2 +- .../main/org/apache/sis/io/wkt/VerticalInfo.java | 6 +- .../main/org/apache/sis/io/wkt/WKTDictionary.java | 5 +- .../main/org/apache/sis/io/wkt/WKTFormat.java | 4 +- .../main/org/apache/sis/io/wkt/Warnings.java | 8 +- .../main/org/apache/sis/io/wkt/package-info.java | 4 +- .../sis/parameter/AbstractParameterDescriptor.java | 2 +- .../sis/parameter/DefaultParameterDescriptor.java | 9 +- .../parameter/DefaultParameterDescriptorGroup.java | 1 - .../sis/parameter/DefaultParameterValue.java | 8 +- .../sis/parameter/DefaultParameterValueGroup.java | 19 +- .../org/apache/sis/parameter/ParameterBuilder.java | 11 +- .../org/apache/sis/parameter/ParameterFormat.java | 13 +- .../apache/sis/parameter/ParameterValueList.java | 17 +- .../org/apache/sis/parameter/TensorParameters.java | 13 +- .../org/apache/sis/parameter/TensorValues.java | 2 +- .../parameter/UnmodifiableParameterValueGroup.java | 7 +- .../org/apache/sis/parameter/package-info.java | 4 +- .../sis/referencing/AbstractIdentifiedObject.java | 18 +- .../sis/referencing/AbstractReferenceSystem.java | 2 +- .../main/org/apache/sis/referencing/Builder.java | 41 ++- .../main/org/apache/sis/referencing/CRS.java | 14 +- .../main/org/apache/sis/referencing/CommonCRS.java | 12 +- .../sis/referencing/DefaultObjectDomain.java | 2 +- .../sis/referencing/GeodesicsOnEllipsoid.java | 4 +- .../apache/sis/referencing/GeodeticCalculator.java | 6 +- .../apache/sis/referencing/IdentifiedObjects.java | 2 +- .../sis/referencing/ImmutableIdentifier.java | 11 +- .../apache/sis/referencing/NamedIdentifier.java | 3 +- .../apache/sis/referencing/crs/AbstractCRS.java | 11 +- .../sis/referencing/crs/AbstractDerivedCRS.java | 2 +- .../sis/referencing/crs/DefaultCompoundCRS.java | 6 +- .../sis/referencing/crs/DefaultDerivedCRS.java | 2 +- .../sis/referencing/crs/DefaultEngineeringCRS.java | 7 +- .../sis/referencing/crs/DefaultGeocentricCRS.java | 2 +- .../sis/referencing/crs/DefaultGeodeticCRS.java | 10 +- .../sis/referencing/crs/DefaultGeographicCRS.java | 2 +- .../sis/referencing/crs/DefaultImageCRS.java | 7 +- .../sis/referencing/crs/DefaultParametricCRS.java | 7 +- .../sis/referencing/crs/DefaultProjectedCRS.java | 2 +- .../sis/referencing/crs/DefaultTemporalCRS.java | 7 +- .../sis/referencing/crs/DefaultVerticalCRS.java | 7 +- .../org/apache/sis/referencing/cs/AbstractCS.java | 13 +- .../apache/sis/referencing/cs/AxesConvention.java | 21 +- .../org/apache/sis/referencing/cs/AxisName.java | 2 +- .../sis/referencing/cs/CoordinateSystems.java | 11 +- .../sis/referencing/cs/DefaultCompoundCS.java | 5 +- .../cs/DefaultCoordinateSystemAxis.java | 6 +- .../sis/referencing/cs/DefaultEllipsoidalCS.java | 4 +- .../apache/sis/referencing/cs/DefaultTimeCS.java | 2 +- .../sis/referencing/cs/DefaultVerticalCS.java | 2 +- .../sis/referencing/cs/DirectionAlongMeridian.java | 7 +- .../org/apache/sis/referencing/cs/Normalizer.java | 4 +- .../org/apache/sis/referencing/cs/SubTypes.java | 4 +- .../sis/referencing/datum/AbstractDatum.java | 4 +- .../sis/referencing/datum/BursaWolfParameters.java | 26 +- .../sis/referencing/datum/DatumShiftGrid.java | 5 +- .../sis/referencing/datum/DefaultEllipsoid.java | 4 +- .../referencing/datum/DefaultEngineeringDatum.java | 2 +- .../referencing/datum/DefaultGeodeticDatum.java | 18 +- .../sis/referencing/datum/DefaultImageDatum.java | 6 +- .../referencing/datum/DefaultPrimeMeridian.java | 8 +- .../referencing/datum/DefaultTemporalDatum.java | 4 +- .../referencing/datum/DefaultVerticalDatum.java | 6 +- .../sis/referencing/datum/TimeDependentBWP.java | 7 +- .../org/apache/sis/referencing/datum/formulas.html | 2 +- .../factory/CommonAuthorityFactory.java | 6 +- .../factory/ConcurrentAuthorityFactory.java | 2 +- .../factory/GeodeticAuthorityFactory.java | 6 +- .../referencing/factory/GeodeticObjectFactory.java | 12 +- .../factory/IdentifiedObjectFinder.java | 13 +- .../referencing/factory/IdentifiedObjectSet.java | 9 +- .../sis/referencing/factory/package-info.java | 6 +- .../sis/referencing/factory/sql/BursaWolfInfo.java | 2 +- .../factory/sql/CoordinateOperationSet.java | 2 +- .../referencing/factory/sql/EPSGCodeFinder.java | 14 +- .../referencing/factory/sql/EPSGDataAccess.java | 15 +- .../sis/referencing/factory/sql/EPSGFactory.java | 7 +- .../factory/sql/InstallationScriptProvider.java | 6 +- .../sis/referencing/factory/sql/SQLTranslator.java | 8 +- .../referencing/internal/PositionTransformer.java | 6 +- .../operation/AbstractCoordinateOperation.java | 4 +- .../operation/AbstractSingleOperation.java | 3 +- .../operation/CoordinateOperationContext.java | 2 +- .../operation/CoordinateOperationFinder.java | 22 +- .../operation/CoordinateOperationRegistry.java | 22 +- .../operation/DefaultConcatenatedOperation.java | 1 - .../referencing/operation/DefaultConversion.java | 8 +- .../DefaultCoordinateOperationFactory.java | 5 +- .../sis/referencing/operation/DefaultFormula.java | 10 +- .../operation/DefaultOperationMethod.java | 18 +- .../operation/builder/LinearTransformBuilder.java | 26 +- .../operation/builder/LocalizationGridBuilder.java | 15 +- .../operation/builder/ProjectedTransformTry.java | 8 +- .../operation/builder/TransformBuilder.java | 2 +- .../operation/builder/package-info.java | 2 +- .../referencing/operation/gridded/GridGroup.java | 5 +- .../referencing/operation/gridded/LoadedGrid.java | 5 +- .../operation/matrix/AffineTransforms2D.java | 20 +- .../sis/referencing/operation/matrix/Matrices.java | 15 +- .../referencing/operation/matrix/MatrixSIS.java | 12 +- .../matrix/MismatchedMatrixSizeException.java | 2 +- .../operation/matrix/NonSquareMatrix.java | 2 +- .../matrix/NoninvertibleMatrixException.java | 2 +- .../referencing/operation/matrix/package-info.java | 8 +- .../sis/referencing/operation/package-info.java | 8 +- .../operation/projection/AlbersEqualArea.java | 2 +- .../operation/projection/AuthalicConversion.java | 8 +- .../operation/projection/CassiniSoldner.java | 2 +- .../operation/projection/ConformalProjection.java | 4 +- .../operation/projection/CylindricalEqualArea.java | 2 +- .../operation/projection/Initializer.java | 17 +- .../projection/LambertConicConformal.java | 2 +- .../operation/projection/LongitudeWraparound.java | 2 +- .../referencing/operation/projection/Mercator.java | 4 +- .../operation/projection/MeridianArcBased.java | 4 +- .../projection/ModifiedAzimuthalEquidistant.java | 2 +- .../operation/projection/NormalizedProjection.java | 72 ++-- .../operation/projection/ObliqueStereographic.java | 2 +- .../operation/projection/PolarStereographic.java | 4 +- .../operation/projection/Polyconic.java | 2 +- .../operation/projection/SatelliteTracking.java | 2 +- .../operation/projection/Sinusoidal.java | 2 +- .../operation/projection/TransverseMercator.java | 2 +- .../operation/projection/package-info.java | 16 +- .../operation/provider/AbstractProvider.java | 2 +- .../operation/provider/Geographic3Dto2D.java | 2 +- .../operation/provider/MapProjection.java | 4 +- .../sis/referencing/operation/provider/NTv2.java | 4 +- .../operation/provider/NorthPoleRotation.java | 2 +- .../provider/TransverseMercatorSouth.java | 4 +- .../operation/transform/AbstractMathTransform.java | 10 +- .../operation/transform/ConcatenatedTransform.java | 9 +- .../operation/transform/ContextualParameters.java | 29 +- .../operation/transform/DatumShiftTransform.java | 8 +- .../transform/DefaultMathTransformFactory.java | 31 +- .../operation/transform/DomainDefinition.java | 4 +- .../transform/EllipsoidToCentricTransform.java | 21 +- .../transform/ExponentialTransform1D.java | 2 +- .../transform/InterpolatedGeocentricTransform.java | 5 +- .../operation/transform/InterpolatedTransform.java | 13 +- .../operation/transform/LinearTransform.java | 2 +- .../transform/LogarithmicTransform1D.java | 2 +- .../operation/transform/MathTransforms.java | 15 +- .../operation/transform/MolodenskyTransform.java | 9 +- .../operation/transform/PassThroughTransform.java | 2 +- .../operation/transform/PoleRotation.java | 6 +- .../transform/SpecializableTransform.java | 2 +- .../operation/transform/TransferFunction.java | 28 +- .../operation/transform/TransformSeparator.java | 7 +- .../referencing/operation/transform/formulas.html | 2 +- .../org/apache/sis/referencing/package-info.java | 4 +- .../sis/referencing/util/AxisDirections.java | 12 +- .../sis/referencing/util/CoordinateOperations.java | 6 +- .../org/apache/sis/referencing/util/Formulas.java | 2 +- .../referencing/util/GeodeticObjectBuilder.java | 4 +- .../sis/referencing/util/ReferencingUtilities.java | 8 +- .../sis/referencing/util/WraparoundApplicator.java | 4 +- .../referencing/util/j2d/AffineTransform2D.java | 4 +- .../referencing/util/j2d/IntervalRectangle.java | 2 +- .../referencing/util/j2d/ParameterizedAffine.java | 2 +- .../org/apache/sis/referencing/util/j2d/Tile.java | 4 +- .../sis/referencing/util/j2d/TileOrganizer.java | 8 +- .../referencing/CC_GeneralOperationParameter.java | 9 +- .../referencing/CC_OperationParameterGroup.java | 6 +- .../apache/sis/geometry/AbstractEnvelopeTest.java | 366 ++++++++++----------- .../org/apache/sis/referencing/Assertions.java | 6 +- .../apache/sis/referencing/ClenshawSummation.java | 6 +- .../operation/transform/MathTransformWrapper.java | 6 +- .../referencing/util/CoordinateOperationsTest.java | 23 +- .../util/PositionalAccuracyConstantTest.java | 20 +- .../org/apache/sis/storage/geotiff/DataSubset.java | 1 + .../apache/sis/storage/geotiff/GeoTiffStore.java | 2 +- .../sis/storage/geotiff/ImageFileDirectory.java | 12 +- .../sis/storage/geotiff/MultiResolutionImage.java | 2 +- .../org/apache/sis/storage/geotiff/Reader.java | 8 +- .../apache/sis/storage/geotiff/WritableStore.java | 2 +- .../org/apache/sis/storage/geotiff/Writer.java | 4 +- .../geotiff/reader/GridGeometryBuilder.java | 8 +- .../sis/storage/geotiff/reader/XMLMetadata.java | 2 +- .../sis/storage/geotiff/spi/SchemaModifier.java | 2 +- .../sis/storage/geotiff/writer/GeoEncoder.java | 2 +- .../sis/storage/geotiff/writer/TileMatrix.java | 1 - .../org/apache/sis/storage/geotiff/WriterTest.java | 2 +- .../apache/sis/storage/netcdf/AttributeNames.java | 2 +- .../apache/sis/storage/netcdf/MetadataReader.java | 2 +- .../org/apache/sis/storage/netcdf/base/Axis.java | 4 +- .../apache/sis/storage/netcdf/base/AxisType.java | 4 +- .../apache/sis/storage/netcdf/base/CRSBuilder.java | 8 +- .../apache/sis/storage/netcdf/base/Convention.java | 4 +- .../apache/sis/storage/netcdf/base/Decoder.java | 7 +- .../sis/storage/netcdf/base/GridMapping.java | 2 +- .../apache/sis/storage/netcdf/base/Variable.java | 4 +- .../sis/storage/netcdf/classic/ChannelDecoder.java | 10 +- .../apache/sis/storage/netcdf/package-info.java | 14 +- .../sis/storage/netcdf/ucar/DecoderWrapper.java | 4 +- .../apache/sis/storage/sql/SQLStoreProvider.java | 14 +- .../sis/storage/sql/feature/FeatureIterator.java | 1 + .../sis/storage/sql/feature/FeatureStream.java | 5 +- .../org/apache/sis/storage/sql/feature/Table.java | 5 +- .../sis/storage/sql/feature/ValueGetter.java | 5 +- .../sis/storage/sql/postgis/RasterFormat.java | 2 +- .../sis/storage/sql/postgis/RasterReader.java | 4 +- .../sis/storage/sql/postgis/RasterWriter.java | 6 +- .../sis/storage/sql/postgis/package-info.java | 2 +- .../apache/sis/util/stream/BaseStreamWrapper.java | 5 +- .../main/org/apache/sis/storage/gpx/Person.java | 2 +- .../main/org/apache/sis/storage/gpx/Store.java | 5 +- .../sis/storage/xml/stream/StaxStreamIO.java | 5 +- .../sis/storage/xml/stream/StaxStreamReader.java | 3 +- .../sis/storage/xml/stream/StaxStreamWriter.java | 1 - .../sis/storage/xml/stream/package-info.java | 2 +- .../org/apache/sis/io/stream/ChannelDataInput.java | 4 +- .../org/apache/sis/io/stream/ChannelFactory.java | 2 +- .../main/org/apache/sis/storage/Aggregate.java | 4 +- .../main/org/apache/sis/storage/CoverageQuery.java | 17 +- .../main/org/apache/sis/storage/DataStore.java | 8 +- .../org/apache/sis/storage/DataStoreProvider.java | 4 +- .../main/org/apache/sis/storage/FeatureNaming.java | 7 +- .../main/org/apache/sis/storage/FeatureQuery.java | 37 +-- .../main/org/apache/sis/storage/FeatureSet.java | 5 +- .../apache/sis/storage/GridCoverageResource.java | 22 +- .../main/org/apache/sis/storage/Query.java | 2 +- .../org/apache/sis/storage/StorageConnector.java | 16 +- .../org/apache/sis/storage/WritableAggregate.java | 2 +- .../aggregate/BandAggregateGridResource.java | 2 +- .../storage/aggregate/ConcatenatedFeatureSet.java | 1 - .../sis/storage/aggregate/CoverageAggregator.java | 2 +- .../org/apache/sis/storage/base/LegalSymbols.java | 217 ++++++++++++ .../apache/sis/storage/base/MemoryFeatureSet.java | 8 +- .../sis/storage/base/MemoryGridResource.java | 9 +- .../apache/sis/storage/base/MetadataBuilder.java | 207 +----------- .../apache/sis/storage/base/MetadataFetcher.java | 2 +- .../org/apache/sis/storage/base/PRJDataStore.java | 5 +- .../sis/storage/base/WritableAggregateSupport.java | 5 +- .../storage/base/WritableGridCoverageSupport.java | 6 +- .../main/org/apache/sis/storage/csv/Store.java | 2 +- .../org/apache/sis/storage/csv/StoreProvider.java | 2 - .../apache/sis/storage/event/StoreListeners.java | 26 +- .../org/apache/sis/storage/event/WarningEvent.java | 5 +- .../main/org/apache/sis/storage/folder/Store.java | 2 +- .../apache/sis/storage/folder/StoreProvider.java | 2 - .../apache/sis/storage/folder/WritableStore.java | 5 +- .../apache/sis/storage/image/WorldFileStore.java | 6 +- .../apache/sis/storage/image/WritableStore.java | 4 +- .../org/apache/sis/storage/image/package-info.java | 2 +- .../org/apache/sis/storage/tiling/TileMatrix.java | 2 +- .../apache/sis/storage/tiling/TileMatrixSet.java | 2 +- .../apache/sis/storage/xml/GeographicEnvelope.java | 2 +- .../src/org.apache.sis.util/main/module-info.java | 9 +- .../apache/sis/converter/ConverterRegistry.java | 4 +- .../apache/sis/converter/FallbackConverter.java | 2 +- .../org/apache/sis/converter/StringConverter.java | 1 - .../org/apache/sis/converter/package-info.java | 2 +- .../main/org/apache/sis/io/Appender.java | 5 +- .../main/org/apache/sis/io/CompoundFormat.java | 6 +- .../main/org/apache/sis/io/LineAppender.java | 7 +- .../main/org/apache/sis/io/TableAppender.java | 17 +- .../main/org/apache/sis/io/TabularFormat.java | 2 +- .../main/org/apache/sis/math/ArrayVector.java | 2 +- .../main/org/apache/sis/math/DecimalFunctions.java | 6 +- .../main/org/apache/sis/math/FunctionProperty.java | 20 +- .../main/org/apache/sis/math/Line.java | 1 - .../main/org/apache/sis/math/MathFunctions.java | 15 +- .../main/org/apache/sis/math/Plane.java | 6 +- .../main/org/apache/sis/math/RepeatedVector.java | 5 +- .../main/org/apache/sis/math/SequenceVector.java | 8 +- .../main/org/apache/sis/math/Statistics.java | 6 +- .../main/org/apache/sis/math/Vector.java | 11 +- .../org/apache/sis/measure/AbstractConverter.java | 2 - .../main/org/apache/sis/measure/Angle.java | 10 +- .../main/org/apache/sis/measure/AngleFormat.java | 10 +- .../apache/sis/measure/ConcatenatedConverter.java | 2 - .../org/apache/sis/measure/ConventionalUnit.java | 18 +- .../org/apache/sis/measure/ElevationAngle.java | 6 +- .../sis/measure/FormattedCharacterIterator.java | 15 +- .../org/apache/sis/measure/IdentityConverter.java | 5 +- .../main/org/apache/sis/measure/Latitude.java | 16 +- .../org/apache/sis/measure/LinearConverter.java | 11 +- .../main/org/apache/sis/measure/Longitude.java | 4 +- .../main/org/apache/sis/measure/Quantities.java | 2 - .../org/apache/sis/measure/QuantityFormat.java | 11 +- .../main/org/apache/sis/measure/Range.java | 11 +- .../main/org/apache/sis/measure/RangeFormat.java | 12 +- .../apache/sis/measure/SexagesimalConverter.java | 14 +- .../main/org/apache/sis/measure/SystemUnit.java | 7 +- .../main/org/apache/sis/measure/UnitDimension.java | 1 - .../main/org/apache/sis/measure/UnitFormat.java | 20 +- .../main/org/apache/sis/measure/UnitServices.java | 4 +- .../main/org/apache/sis/pending/jdk/JDK19.java | 22 ++ .../main/org/apache/sis/pending/jdk/JDK21.java | 27 +- .../main/org/apache/sis/setup/Configuration.java | 9 +- .../apache/sis/setup/InstallationResources.java | 2 +- .../main/org/apache/sis/setup/OptionKey.java | 10 +- .../org/apache/sis/system/OptionalDependency.java | 1 - .../{internal => }/ArgumentCheckByAssertion.java | 21 +- .../main/org/apache/sis/util/ArgumentChecks.java | 42 ++- .../main/org/apache/sis/util/ArraysExt.java | 1 - .../main/org/apache/sis/util/CharSequences.java | 15 +- .../main/org/apache/sis/util/Characters.java | 4 +- .../main/org/apache/sis/util/Classes.java | 6 +- .../main/org/apache/sis/util/ComparisonMode.java | 4 +- ...heckByAssertion.java => ConditionallySafe.java} | 17 +- .../sis/util/DefaultInternationalString.java | 2 +- .../main/org/apache/sis/util/Exceptions.java | 2 +- .../org/apache/sis/util/LenientComparable.java | 8 +- .../main/org/apache/sis/util/Locales.java | 13 +- .../main/org/apache/sis/util/Numbers.java | 4 +- .../main/org/apache/sis/util/ObjectConverter.java | 2 +- .../main/org/apache/sis/util/ObjectConverters.java | 13 +- .../main/org/apache/sis/util/Printable.java | 2 +- .../sis/util/ResourceInternationalString.java | 4 +- .../apache/sis/util/SimpleInternationalString.java | 4 +- .../main/org/apache/sis/util/Static.java | 2 +- .../main/org/apache/sis/util/StringBuilders.java | 14 +- .../sis/util/UnconvertibleObjectException.java | 2 +- .../main/org/apache/sis/util/Version.java | 4 +- .../main/org/apache/sis/util/collection/Cache.java | 12 +- .../org/apache/sis/util/collection/Containers.java | 38 +-- .../sis/util/collection/DefaultTreeTable.java | 22 +- .../org/apache/sis/util/collection/DerivedMap.java | 2 +- .../org/apache/sis/util/collection/DerivedSet.java | 2 +- .../apache/sis/util/collection/IntegerList.java | 14 +- .../org/apache/sis/util/collection/RangeSet.java | 8 +- .../apache/sis/util/collection/TableColumn.java | 8 +- .../apache/sis/util/collection/TreeNodeList.java | 23 +- .../org/apache/sis/util/collection/TreeTable.java | 4 +- .../org/apache/sis/util/collection/TreeTables.java | 1 - .../apache/sis/util/collection/WeakHashSet.java | 47 ++- .../apache/sis/util/internal/CheckedArrayList.java | 11 +- .../apache/sis/util/internal/CheckedHashSet.java | 9 +- .../apache/sis/util/internal/CollectionsExt.java | 10 +- .../apache/sis/util/internal/DefinitionURI.java | 6 +- .../org/apache/sis/util/internal/DoubleDouble.java | 2 +- .../org/apache/sis/util/internal/Numerics.java | 4 +- .../sis/util/internal/SimpleCharacterIterator.java | 1 - .../sis/util/internal/UnmodifiableArrayList.java | 23 +- .../main/org/apache/sis/util/internal/Unsafe.java | 106 ++++++ .../main/org/apache/sis/util/internal/X364.java | 4 +- .../main/org/apache/sis/util/logging/Logging.java | 1 - .../apache/sis/util/logging/MonolineFormatter.java | 8 +- .../apache/sis/util/resources/package-info.java | 2 +- .../test/org/apache/sis/test/TestRunner.java | 4 +- .../test/org/apache/sis/test/TestUtilities.java | 2 +- .../sis/storage/shapefile/ShapefileStore.java | 4 +- .../apache/sis/gui/controls/SyncWindowList.java | 2 +- .../apache/sis/gui/controls/ValueColorMapper.java | 1 + .../apache/sis/gui/coverage/CoverageCanvas.java | 1 + .../apache/sis/gui/coverage/CoverageControls.java | 6 +- .../apache/sis/gui/coverage/CoverageExplorer.java | 13 +- .../apache/sis/gui/coverage/CoverageStyling.java | 1 - .../org/apache/sis/gui/coverage/GridViewSkin.java | 1 - .../org/apache/sis/gui/coverage/ImageRequest.java | 8 +- .../apache/sis/gui/coverage/IsolineRenderer.java | 1 - .../org/apache/sis/gui/dataset/WindowHandler.java | 3 - .../org/apache/sis/gui/internal/ColorName.java | 2 +- .../org/apache/sis/gui/internal/GUIUtilities.java | 2 +- .../org/apache/sis/gui/internal/PropertyView.java | 1 - .../main/org/apache/sis/gui/map/MapCanvas.java | 26 +- .../main/org/apache/sis/gui/map/MapCanvasAWT.java | 1 + .../main/org/apache/sis/gui/map/MapMenu.java | 17 +- .../main/org/apache/sis/gui/map/StatusBar.java | 11 +- .../sis/gui/metadata/IdentificationInfo.java | 4 +- .../org/apache/sis/gui/metadata/MetadataTree.java | 4 +- .../sis/gui/metadata/StandardMetadataTree.java | 1 - .../gui/referencing/PositionableProjection.java | 2 - .../org/apache/sis/gui/referencing/WKTPane.java | 1 - 555 files changed, 2417 insertions(+), 2609 deletions(-) diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/SampleDimension.java index f7b0b01ecc,14a3b14087..250ea6b9f6 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/SampleDimension.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/SampleDimension.java @@@ -515,9 -516,9 +513,9 @@@ public class SampleDimension implement * {@linkplain org.apache.sis.image.ImageProcessor#resample image resampling operations}, * then it should be declared using {@code setBackground(…)} method instead of {@code addQualitative(…)}.</p> * - * <p>A <cite>quantitative category</cite> is a range of sample values associated to numbers with units of measurement. + * <p>A <dfn>quantitative category</dfn> is a range of sample values associated to numbers with units of measurement. * For example, 10 = 1.0°C, 11 = 1.1°C, 12 = 1.2°C, <i>etc</i>. A quantitative category has a - * {@linkplain org.opengis.metadata.content.SampleDimension#getTransferFunctionType() transfer function} + * transfer function * (typically a scale factor and an offset) for converting sample values to values expressed * in the unit of measurement.</p> * diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/DimensionalityReduction.java index d0df555b73,115b80d3f7..4f4a654a6d --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/DimensionalityReduction.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/DimensionalityReduction.java @@@ -942,9 -940,10 +940,9 @@@ public class DimensionalityReduction im * @throws PointOutsideCoverageException if the given point is outside the source grid extent. */ public DimensionalityReduction withSlicePoint(final long[] point) { - ArgumentChecks.ensureNonNull("point", point); + Objects.requireNonNull(point); final GridExtent extent = sourceGeometry.getExtent(); final int sourceDim = extent.getDimension(); - ArgumentChecks.ensureDimensionMatches("slicePoint", sourceDim, extent); final Map<Integer,Long> slices = new HashMap<>(); for (int dim=0; dim < sourceDim; dim++) { final long low = extent.getLow (dim); diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridCoordinatesView.java index dc04e57da5,52885418fd..d8e064a5e4 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridCoordinatesView.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridCoordinatesView.java @@@ -17,8 -17,12 +17,8 @@@ package org.apache.sis.coverage.grid; import java.util.Arrays; - import org.apache.sis.util.ArgumentChecks; + import java.util.Objects; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.coverage.grid.GridCoordinates; -import org.apache.sis.util.resources.Errors; - /** * A view over the low or high grid envelope coordinates. @@@ -67,9 -69,9 +67,8 @@@ final class GridCoordinatesView /** * Returns the coordinate value for the specified dimension. */ - @Override public final long getCoordinateValue(final int index) { - ArgumentChecks.ensureValidIndex(getDimension(), index); - return coordinates[offset + index]; + return coordinates[offset + Objects.checkIndex(index, getDimension())]; } /** diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/coverage/grid/GridExtent.java index 861ebbc15d,49c641e23c..d5322d31dd --- 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 @@@ -757,9 -794,10 +757,8 @@@ public class GridExtent implements Seri * @see #getHigh(int) * @see #withRange(int, long, long) */ - @Override public long getLow(final int index) { - ArgumentChecks.ensureValidIndex(getDimension(), index); - return coordinates[index]; + return coordinates[Objects.checkIndex(index, getDimension())]; } /** @@@ -773,10 -811,11 +772,9 @@@ * @see #getLow(int) * @see #withRange(int, long, long) */ - @Override public long getHigh(final int index) { final int dimension = getDimension(); - ArgumentChecks.ensureValidIndex(dimension, index); - return coordinates[index + dimension]; + return coordinates[Objects.checkIndex(index, dimension) + dimension]; } /** @@@ -853,9 -891,10 +850,9 @@@ * @see #getHigh(int) * @see #resize(long...) */ - @Override public long getSize(final int index) { final int dimension = getDimension(); - ArgumentChecks.ensureValidIndex(dimension, index); + Objects.checkIndex(index, dimension); return Math.incrementExact(Math.subtractExact(coordinates[dimension + index], coordinates[index])); } diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractAssociation.java index bc38064fca,eec56f1b88..8f276324a6 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractAssociation.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractAssociation.java @@@ -21,9 -21,16 +21,8 @@@ import java.util.Iterator import java.io.Serializable; import org.opengis.util.GenericName; import org.opengis.metadata.quality.DataQuality; - import org.apache.sis.util.ArgumentChecks; import org.apache.sis.feature.internal.Resources; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.Feature; -import org.opengis.feature.FeatureType; -import org.opengis.feature.FeatureAssociation; -import org.opengis.feature.FeatureAssociationRole; -import org.opengis.feature.InvalidPropertyValueException; -import org.opengis.feature.MultiValuedPropertyException; - /** * An instance of an {@linkplain DefaultAssociationRole feature association role} containing the associated feature. @@@ -76,8 -84,7 +75,7 @@@ public abstract class AbstractAssociati * * @see DefaultAssociationRole#newInstance() */ - public static AbstractAssociation create(final FeatureAssociationRole role) { + public static AbstractAssociation create(final DefaultAssociationRole role) { - ArgumentChecks.ensureNonNull("role", role); return isSingleton(role.getMaximumOccurs()) ? new SingletonAssociation(role) : new MultiValuedAssociation(role); @@@ -90,10 -97,9 +88,9 @@@ * @param value the initial value (may be {@code null}). * @return the new association. */ - static AbstractAssociation create(final FeatureAssociationRole role, final Object value) { + static AbstractAssociation create(final DefaultAssociationRole role, final Object value) { - ArgumentChecks.ensureNonNull("role", role); return isSingleton(role.getMaximumOccurs()) - ? new SingletonAssociation(role, (Feature) value) + ? new SingletonAssociation(role, (AbstractFeature) value) : new MultiValuedAssociation(role, value); } diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractAttribute.java index 47a863b9e1,819d50cd46..2193353a2c --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractAttribute.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractAttribute.java @@@ -28,8 -28,13 +28,7 @@@ import org.opengis.util.GenericName import org.opengis.metadata.quality.DataQuality; import org.opengis.metadata.maintenance.ScopeCode; import org.apache.sis.util.Classes; - import org.apache.sis.util.ArgumentChecks; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.Attribute; -import org.opengis.feature.AttributeType; -import org.opengis.feature.InvalidPropertyValueException; -import org.opengis.feature.MultiValuedPropertyException; - /** * An instance of an {@linkplain DefaultAttributeType attribute type} containing the value of an attribute in a feature. @@@ -118,8 -124,7 +117,7 @@@ public abstract class AbstractAttribute * * @see DefaultAttributeType#newInstance() */ - public static <V> AbstractAttribute<V> create(final AttributeType<V> type) { + public static <V> AbstractAttribute<V> create(final DefaultAttributeType<V> type) { - ArgumentChecks.ensureNonNull("type", type); return isSingleton(type.getMaximumOccurs()) ? new SingletonAttribute<>(type) : new MultiValuedAttribute<>(type); @@@ -134,8 -139,7 +132,7 @@@ * @param value the initial value (may be {@code null}). * @return the new attribute. */ - static <V> AbstractAttribute<V> create(final AttributeType<V> type, final Object value) { + static <V> AbstractAttribute<V> create(final DefaultAttributeType<V> type, final Object value) { - ArgumentChecks.ensureNonNull("type", type); return isSingleton(type.getMaximumOccurs()) ? new SingletonAttribute<>(type, value) : new MultiValuedAttribute<>(type, value); diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractFeature.java index f48cccfb84,be3bc17842..f3c6fbf2bd --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractFeature.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractFeature.java @@@ -103,9 -118,8 +103,8 @@@ public abstract class AbstractFeature i * * @see DefaultFeatureType#newInstance() */ - protected AbstractFeature(final FeatureType type) { + protected AbstractFeature(final DefaultFeatureType type) { - ArgumentChecks.ensureNonNull("type", type); - this.type = type; + this.type = Objects.requireNonNull(type); } /** @@@ -204,14 -211,14 +203,13 @@@ * * @see #setPropertyValue(String, Object) */ - @Override - public void setProperty(final Property property) throws IllegalArgumentException { - final String name = property.getName().toString(); - verifyPropertyType(name, property); - if (property instanceof Attribute<?> && !Containers.isNullOrEmpty(((Attribute<?>) property).characteristics())) { + public void setProperty(final Object property) throws IllegalArgumentException { - ArgumentChecks.ensureNonNull("property", property); + final String name = ((Property) property).getName().toString(); + verifyPropertyType(name, (Property) property); + if (property instanceof AbstractAttribute<?> && !Containers.isNullOrEmpty(((AbstractAttribute<?>) property).characteristics())) { throw new IllegalArgumentException(Resources.format(Resources.Keys.CanNotAssignCharacteristics_1, name)); } - setPropertyValue(name, property.getValue()); + setPropertyValue(name, ((Property) property).getValue()); } /** diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractIdentifiedType.java index 0b70a4c93d,8dfe7c05c1..ea9d4b74b3 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractIdentifiedType.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/AbstractIdentifiedType.java @@@ -29,8 -29,10 +29,7 @@@ import org.apache.sis.util.Deprecable import org.apache.sis.util.iso.DefaultNameFactory; import org.apache.sis.util.iso.Types; import org.apache.sis.util.resources.Errors; - import static org.apache.sis.util.ArgumentChecks.ensureNonNull; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.IdentifiedType; - /** * Identification and description information inherited by property types and feature types. diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/CharacteristicMap.java index 419f7d71cb,60346f525a..1008b52f1d --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/CharacteristicMap.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/CharacteristicMap.java @@@ -160,13 -165,12 +159,12 @@@ final class CharacteristicMap extends A * * @param key the name for which to get the characteristic index. * @return the index for the characteristic of the given name. - * @throws PropertyNotFoundException if the given key is not the name of a characteristic in this map. + * @throws IllegalArgumentException if the given key is not the name of a characteristic in this map. */ private int indexOf(final String key) { - ArgumentChecks.ensureNonNull("key", key); final Integer index = types.indices.get(key); if (index == null) { - throw new PropertyNotFoundException(Resources.format( + throw new IllegalArgumentException(Resources.format( Resources.Keys.CharacteristicsNotFound_2, source.getName(), key)); } return index; @@@ -198,14 -202,13 +196,13 @@@ * @throws IllegalArgumentException if the given key is not the name of a characteristic in this map. */ @Override - public Attribute<?> put(final String key, final Attribute<?> value) { + public AbstractAttribute<?> put(final String key, final AbstractAttribute<?> value) { final int index = indexOf(key); - ArgumentChecks.ensureNonNull("value", value); verifyAttributeType(index, value.getType()); if (characterizedBy == null) { - characterizedBy = new Attribute<?>[types.characterizedBy.length]; + characterizedBy = new AbstractAttribute<?>[types.characterizedBy.length]; } - final Attribute<?> previous = characterizedBy[index]; + final AbstractAttribute<?> previous = characterizedBy[index]; characterizedBy[index] = value; return previous; } @@@ -240,8 -243,7 +237,7 @@@ * @throws IllegalStateException if another characteristic already exists for the characteristic name. */ @Override - protected boolean addValue(final Attribute<?> value) { + protected boolean addValue(final AbstractAttribute<?> value) { - ArgumentChecks.ensureNonNull("value", value); final int index = indexOf(value.getName().toString()); verifyAttributeType(index, value.getType()); if (characterizedBy == null) { @@@ -335,10 -337,9 +331,9 @@@ } /** Sets the attribute characteristic. */ - @Override public Attribute<?> setValue(final Attribute<?> value) { + @Override public AbstractAttribute<?> setValue(final AbstractAttribute<?> value) { - ArgumentChecks.ensureNonNull("value", value); verifyAttributeType(index, value.getType()); - final Attribute<?> previous = this.value; + final AbstractAttribute<?> previous = this.value; characterizedBy[index] = value; this.value = value; return previous; diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/CharacteristicTypeMap.java index d1d5539c94,9a0285be92..53ac1264a4 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/CharacteristicTypeMap.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/CharacteristicTypeMap.java @@@ -20,13 -20,16 +20,13 @@@ import java.util.Map import java.util.HashMap; import org.opengis.util.ScopedName; import org.opengis.util.GenericName; + import org.apache.sis.util.ArgumentChecks; import org.apache.sis.util.internal.AbstractMap; import org.apache.sis.util.internal.CollectionsExt; - import org.apache.sis.util.collection.Containers; import org.apache.sis.util.collection.WeakValueHashMap; import org.apache.sis.util.resources.Errors; - import static org.apache.sis.util.ArgumentChecks.ensureNonNullElement; + import org.apache.sis.pending.jdk.JDK19; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.AttributeType; - /** * Implementation of the map returned by {@link DefaultAttributeType#characteristics()}. @@@ -103,14 -106,15 +103,15 @@@ final class CharacteristicTypeMap exten * @param characterizedBy characteristics of {@code source}. Should not be empty. * @throws IllegalArgumentException if two characteristics have the same name. */ - private CharacteristicTypeMap(final AttributeType<?> source, final AttributeType<?>[] characterizedBy) { + private CharacteristicTypeMap(final DefaultAttributeType<?> source, final DefaultAttributeType<?>[] characterizedBy) { this.characterizedBy = characterizedBy; int index = 0; - final Map<String,Integer> indices = new HashMap<>(Containers.hashMapCapacity(characterizedBy.length)); + @SuppressWarnings("LocalVariableHidesMemberVariable") + final Map<String,Integer> indices = JDK19.newHashMap(characterizedBy.length); final Map<String,Integer> aliases = new HashMap<>(); for (int i=0; i<characterizedBy.length; i++) { - final AttributeType<?> attribute = characterizedBy[i]; + final DefaultAttributeType<?> attribute = characterizedBy[i]; - ensureNonNullElement("characterizedBy", i, attribute); + ArgumentChecks.ensureNonNullElement("characterizedBy", i, attribute); GenericName name = attribute.getName(); String key = AbstractIdentifiedType.toString(name, source, "characterizedBy", i); final Integer value = index++; diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultAssociationRole.java index 17b60a9c69,0a8bcc85b0..a2ace425b1 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultAssociationRole.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultAssociationRole.java @@@ -26,8 -27,15 +27,7 @@@ import org.opengis.util.InternationalSt import org.opengis.metadata.Identifier; import org.apache.sis.feature.internal.Resources; import org.apache.sis.feature.internal.AttributeConvention; - import static org.apache.sis.util.ArgumentChecks.*; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.PropertyType; -import org.opengis.feature.AttributeType; -import org.opengis.feature.FeatureType; -import org.opengis.feature.FeatureAssociation; -import org.opengis.feature.FeatureAssociationRole; -import org.opengis.feature.PropertyNotFoundException; - /** * Indicates the role played by the association between two features. diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultAttributeType.java index 04ae30afae,b5b5c12a55..fdbd22ea40 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultAttributeType.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultAttributeType.java @@@ -26,8 -26,12 +26,8 @@@ import java.io.InvalidObjectException import org.opengis.util.GenericName; import org.opengis.util.InternationalString; import org.apache.sis.util.Classes; - import static org.apache.sis.util.ArgumentChecks.*; + import org.apache.sis.util.ArgumentChecks; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.Attribute; -import org.opengis.feature.AttributeType; - /** * Definition of an attribute in a feature type. @@@ -184,14 -183,14 +184,14 @@@ public class DefaultAttributeType<V> ex * * @see org.apache.sis.feature.builder.AttributeTypeBuilder */ - @SuppressWarnings("ThisEscapedInObjectConstruction") // Okay because used only in package-private class. + @SuppressWarnings("this-escape") // Okay because used only in package-private class. public DefaultAttributeType(final Map<String,?> identification, final Class<V> valueClass, final int minimumOccurs, final int maximumOccurs, final V defaultValue, - final AttributeType<?>... characterizedBy) + final DefaultAttributeType<?>... characterizedBy) { super(identification, minimumOccurs, maximumOccurs); - ensureNonNull("valueClass", valueClass); - ensureCanCast("defaultValue", valueClass, defaultValue); + ArgumentChecks.ensureNonNull("valueClass", valueClass); + ArgumentChecks.ensureCanCast("defaultValue", valueClass, defaultValue); this.valueClass = valueClass; this.defaultValue = defaultValue; if (characterizedBy != null && characterizedBy.length != 0) { diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DefaultFeatureType.java index 906a030d13,18a362c709..7a942b459e --- 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 @@@ -257,9 -257,9 +257,9 @@@ public class DefaultFeatureType extend * * @see org.apache.sis.feature.builder.FeatureTypeBuilder */ - @SuppressWarnings("ThisEscapedInObjectConstruction") + @SuppressWarnings("this-escape") public DefaultFeatureType(final Map<String,?> identification, final boolean isAbstract, - final FeatureType[] superTypes, final PropertyType... properties) + final DefaultFeatureType[] superTypes, final AbstractIdentifiedType... properties) { super(identification); ArgumentChecks.ensureNonNull("properties", properties); diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DenseFeature.java index 4d9df09ed0,0608b56c55..70ef332a83 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DenseFeature.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/DenseFeature.java @@@ -86,7 -92,8 +86,8 @@@ final class DenseFeature extends Abstra if (index != null) { return index; } + ArgumentChecks.ensureNonNull("name", name); - throw new PropertyNotFoundException(propertyNotFound(type, getName(), name)); + throw new IllegalArgumentException(propertyNotFound(type, getName(), name)); } /** @@@ -94,11 -101,11 +95,11 @@@ * * @param name the property name. * @return the property of the given name. - * @throws PropertyNotFoundException if the given argument is not a property name of this feature. + * @throws IllegalArgumentException if the given argument is not a property name of this feature. */ @Override - public Property getProperty(final String name) throws PropertyNotFoundException { + public Object getProperty(final String name) throws IllegalArgumentException { - ArgumentChecks.ensureNonNull("name", name); + // Null value check done by the invoked method. final int index = getIndex(name); if (index < 0) { return getOperationResult(name); @@@ -130,10 -137,9 +131,9 @@@ * known to this feature, or if the property cannot be set or another reason. */ @Override - public void setProperty(final Property property) throws IllegalArgumentException { - final String name = property.getName().toString(); - verifyPropertyType(name, property); + public void setProperty(final Object property) throws IllegalArgumentException { - ArgumentChecks.ensureNonNull("property", property); + final String name = ((Property) property).getName().toString(); + verifyPropertyType(name, (Property) property); if (!(properties instanceof Property[])) { wrapValuesInProperties(); } diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/Field.java index cfa0bc5dc1,a2560fc6d9..4812b5af2b --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/Field.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/Field.java @@@ -87,11 -92,10 +86,10 @@@ abstract class Field<V> extends Propert * then delegates to {@link #setValue(Object)}.</p> * * @param values the new values. - * @throws InvalidPropertyValueException if the given collection contains too many elements. + * @throws IllegalArgumentException if the given collection contains too many elements. */ - public void setValues(final Collection<? extends V> values) throws InvalidPropertyValueException { + public void setValues(final Collection<? extends V> values) throws IllegalArgumentException { V value = null; - ArgumentChecks.ensureNonNull("values", values); final Iterator<? extends V> it = values.iterator(); if (it.hasNext()) { value = it.next(); diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/LinkOperation.java index 9b5d060d2a,f10e1b2e0d..79f4648ec3 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/LinkOperation.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/LinkOperation.java @@@ -22,9 -22,14 +22,8 @@@ import java.io.IOException import org.opengis.parameter.ParameterValueGroup; import org.opengis.parameter.ParameterDescriptorGroup; import org.apache.sis.feature.internal.FeatureUtilities; - import org.apache.sis.util.ArgumentChecks; import org.apache.sis.util.resources.Errors; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.Feature; -import org.opengis.feature.IdentifiedType; -import org.opengis.feature.Property; -import org.opengis.feature.PropertyType; - /** * A link operation, which is like a redirection or an alias. @@@ -104,8 -112,7 +103,7 @@@ final class LinkOperation extends Abstr * @return the linked property from the given feature. */ @Override - public Property apply(final Feature feature, final ParameterValueGroup parameters) { + public Object apply(final AbstractFeature feature, final ParameterValueGroup parameters) { - ArgumentChecks.ensureNonNull("feature", feature); return feature.getProperty(referentName); } diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/MultiValuedAssociation.java index 40b7aecab7,2eefcee07d..d06569c32a --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/MultiValuedAssociation.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/MultiValuedAssociation.java @@@ -125,12 -131,12 +125,12 @@@ final class MultiValuedAssociation exte * @param newValues the new values. */ @Override - public void setValues(final Collection<? extends Feature> newValues) { + public void setValues(final Collection<? extends AbstractFeature> newValues) { if (newValues != values) { - ArgumentChecks.ensureNonNull("values", newValues); // The parameter name in public API is "values". + ArgumentChecks.ensureNonNull("values", newValues); // The parameter name in public API is "values". - final FeatureType base = role.getValueType(); + final DefaultFeatureType base = role.getValueType(); values.clear(); - for (final Feature value : newValues) { + for (final AbstractFeature value : newValues) { ensureValid(base, value.getType()); values.add(value); } diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/OperationResult.java index c16a4ab21c,04e3ba749d..159408c696 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/OperationResult.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/OperationResult.java @@@ -44,9 -49,10 +44,10 @@@ abstract class OperationResult<V> exten /** * Creates a new operation for a result of the given type. * - * @param type information about the attribute (base Java class, domain of values, <i>etc.</i>). + * @param type information about the attribute (base Java class, domain of values, <i>etc.</i>). + * @param feature the feature instance to use as a source for computing the result. */ - protected OperationResult(final AttributeType<V> type, final Feature feature) { + protected OperationResult(final DefaultAttributeType<V> type, final AbstractFeature feature) { super(type); this.feature = feature; } diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/SparseFeature.java index 5c0b0a6e61,dcb48cd7e2..6eba9707f0 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/SparseFeature.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/SparseFeature.java @@@ -165,11 -172,11 +165,11 @@@ final class SparseFeature extends Abstr * * @param name the property name. * @return the property of the given name. - * @throws PropertyNotFoundException if the given argument is not a property name of this feature. + * @throws IllegalArgumentException if the given argument is not a property name of this feature. */ @Override - public Property getProperty(final String name) throws PropertyNotFoundException { + public Object getProperty(final String name) throws IllegalArgumentException { - ArgumentChecks.ensureNonNull("name", name); + // Null value check done by the invoked method. requireMapOfProperties(); return getPropertyInstance(name); } @@@ -200,10 -207,9 +200,9 @@@ * known to this feature, or if the property cannot be set for another reason. */ @Override - public void setProperty(final Property property) throws IllegalArgumentException { - final String name = property.getName().toString(); - verifyPropertyType(name, property); + public void setProperty(final Object property) throws IllegalArgumentException { - ArgumentChecks.ensureNonNull("property", property); + final String name = ((Property) property).getName().toString(); + verifyPropertyType(name, (Property) property); requireMapOfProperties(); /* * Following index should never be OPERATION_INDEX (a negative value) because the call diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/StringJoinOperation.java index 5fffbad022,3b78f71984..bb98b227ef --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/StringJoinOperation.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/feature/StringJoinOperation.java @@@ -289,9 -302,8 +289,8 @@@ final class StringJoinOperation extend * @return the concatenation of feature property values. */ @Override - public Property apply(Feature feature, ParameterValueGroup parameters) { + public Property apply(AbstractFeature feature, ParameterValueGroup parameters) { - ArgumentChecks.ensureNonNull("feature", feature); - return new Result(feature); + return new Result(Objects.requireNonNull(feature)); } diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/BinaryGeometryFilter.java index f749aafcb1,61e27d49eb..15620e9101 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/BinaryGeometryFilter.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/BinaryGeometryFilter.java @@@ -27,12 -27,17 +27,11 @@@ import org.apache.sis.geometry.wrapper. import org.apache.sis.geometry.wrapper.SpatialOperationContext; import org.apache.sis.feature.internal.AttributeConvention; import org.apache.sis.filter.internal.Node; - import org.apache.sis.util.ArgumentChecks; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.filter.Filter; -import org.opengis.filter.Literal; -import org.opengis.filter.Expression; -import org.opengis.filter.ValueReference; -import org.opengis.filter.SpatialOperator; -import org.opengis.filter.BinarySpatialOperator; -import org.opengis.filter.InvalidFilterValueException; -import org.opengis.feature.FeatureType; -import org.opengis.feature.PropertyNotFoundException; +// Specific to the main branch: +import org.apache.sis.feature.DefaultFeatureType; +import org.apache.sis.pending.geoapi.filter.Literal; +import org.apache.sis.pending.geoapi.filter.ValueReference; /** diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/BinarySpatialFilter.java index 044b022501,240cd00afc..607cd0ec15 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/BinarySpatialFilter.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/BinarySpatialFilter.java @@@ -22,10 -23,11 +23,9 @@@ import org.apache.sis.geometry.Wraparou import org.apache.sis.geometry.wrapper.SpatialOperationContext; import org.apache.sis.geometry.wrapper.GeometryWrapper; import org.apache.sis.geometry.wrapper.Geometries; - import org.apache.sis.util.ArgumentChecks; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.filter.Expression; -import org.opengis.filter.SpatialOperatorName; -import org.opengis.filter.BinarySpatialOperator; +// Specific to the main branch: +import org.apache.sis.pending.geoapi.filter.SpatialOperatorName; /** diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/ComparisonFilter.java index fea849de25,0529727c64..85a27acd66 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/ComparisonFilter.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/ComparisonFilter.java @@@ -35,14 -36,15 +36,13 @@@ import java.time.chrono.ChronoZonedDate import java.time.temporal.ChronoField; import java.time.temporal.Temporal; import org.apache.sis.math.Fraction; - import org.apache.sis.util.ArgumentChecks; import org.apache.sis.filter.internal.Node; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.filter.Filter; -import org.opengis.filter.Expression; -import org.opengis.filter.MatchAction; -import org.opengis.filter.ComparisonOperatorName; -import org.opengis.filter.BinaryComparisonOperator; -import org.opengis.filter.BetweenComparisonOperator; +// Specific to the main branch: +import org.apache.sis.pending.geoapi.filter.MatchAction; +import org.apache.sis.pending.geoapi.filter.ComparisonOperatorName; +import org.apache.sis.pending.geoapi.filter.BinaryComparisonOperator; +import org.apache.sis.pending.geoapi.filter.BetweenComparisonOperator; /** diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/DistanceFilter.java index a8313cf97f,72d5a396fc..aec9b2e313 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/DistanceFilter.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/DistanceFilter.java @@@ -24,11 -25,12 +25,10 @@@ import org.opengis.geometry.Geometry import org.apache.sis.geometry.wrapper.Geometries; import org.apache.sis.geometry.wrapper.GeometryWrapper; import org.apache.sis.geometry.wrapper.SpatialOperationContext; - import org.apache.sis.util.ArgumentChecks; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.filter.Literal; -import org.opengis.filter.Expression; -import org.opengis.filter.DistanceOperator; -import org.opengis.filter.DistanceOperatorName; +// Specific to the main branch: +import org.apache.sis.pending.geoapi.filter.Literal; +import org.apache.sis.pending.geoapi.filter.DistanceOperatorName; /** diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/LikeFilter.java index e87fc0c877,25a68709e0..f4e0df0d40 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/LikeFilter.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/LikeFilter.java @@@ -18,12 -18,14 +18,12 @@@ package org.apache.sis.filter import java.util.List; import java.util.Collection; + import java.util.Objects; import java.util.regex.Pattern; - import org.apache.sis.util.ArgumentChecks; import org.apache.sis.filter.internal.Node; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.filter.Filter; -import org.opengis.filter.Expression; -import org.opengis.filter.LikeOperator; +// Specific to the main branch: +import org.apache.sis.pending.geoapi.filter.ComparisonOperatorName; /** diff --cc endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/UnaryFunction.java index b62de89433,ee78c0e1fa..eefd5a1129 --- a/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/UnaryFunction.java +++ b/endorsed/src/org.apache.sis.feature/main/org/apache/sis/filter/UnaryFunction.java @@@ -18,13 -18,16 +18,13 @@@ package org.apache.sis.filter import java.util.List; import java.util.Collection; + import java.util.Objects; import java.util.Optional; import org.apache.sis.xml.NilReason; - import org.apache.sis.util.ArgumentChecks; import org.apache.sis.filter.internal.Node; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.filter.Filter; -import org.opengis.filter.Expression; -import org.opengis.filter.NilOperator; -import org.opengis.filter.NullOperator; +// Specific to the main branch: +import org.apache.sis.pending.geoapi.filter.ComparisonOperatorName; /** diff --cc endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/test/FeatureComparator.java index cdab6780b0,c542d87539..1665f07782 --- a/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/test/FeatureComparator.java +++ b/endorsed/src/org.apache.sis.feature/test/org/apache/sis/feature/test/FeatureComparator.java @@@ -133,9 -134,7 +133,7 @@@ public class FeatureComparator * @param expected the expected feature instance. * @param actual the actual feature instance. */ - public FeatureComparator(final Feature expected, final Feature actual) { + public FeatureComparator(final AbstractFeature expected, final AbstractFeature actual) { - ArgumentChecks.ensureNonNull("expected", expected); - ArgumentChecks.ensureNonNull("actual", actual); expectedInstance = expected; expectedType = expected.getType(); actualInstance = actual; @@@ -148,13 -147,11 +146,11 @@@ * @param expected the expected feature type. * @param actual the actual feature type. */ - public FeatureComparator(final FeatureType expected, final FeatureType actual) { + public FeatureComparator(final DefaultFeatureType expected, final DefaultFeatureType actual) { - ArgumentChecks.ensureNonNull("expected", expected); - ArgumentChecks.ensureNonNull("actual", actual); expectedInstance = null; - expectedType = expected; + expectedType = Objects.requireNonNull(expected); actualInstance = null; - actualType = actual; + actualType = Objects.requireNonNull(actual); } /** diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java index ed5c325150,91c8666fc4..86015b6854 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java @@@ -52,17 -49,9 +52,17 @@@ import static org.opengis.annotation.Sp * <div class="preformat">{@code MD_SampleDimension} * {@code └─units………………………} Units of data in each dimension included in the resource.</div> * + * <div class="warning"><b>Note on International Standard versions</b><br> + * This class is derived from a new type defined in the ISO 19115 international standard published in 2014, + * while GeoAPI 3.0 is based on the version published in 2003. Consequently this implementation class does + * not yet implement a GeoAPI interface, but is expected to do so after the next GeoAPI releases. + * When the interface will become available, all references to this implementation class in Apache SIS will + * be replaced be references to the {@code SampleDimension} interface. + * </div> + * * <h2>Terminology</h2> - * <cite>Data values</cite> should be physical values expressed in the unit of measurement - * given by {@link #getUnits()}. <cite>Cell values</cite> are values stored in the device, + * <i>Data values</i> should be physical values expressed in the unit of measurement + * given by {@link #getUnits()}. <i>Cell values</i> are values stored in the device, * before conversion to data values by application of {@linkplain #getScaleFactor() scale * factor} and {@linkplain #getOffset() offset}. * diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java index 52706d4d0d,99b5c3fc8b..f3f8d89c26 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/extent/DefaultVerticalExtent.java @@@ -280,9 -282,8 +279,8 @@@ public class DefaultVerticalExtent exte * * @since 0.8 */ - public void intersect(final VerticalExtent other) throws MismatchedReferenceSystemException { + public void intersect(final VerticalExtent other) throws IllegalArgumentException { checkWritePermission(value()); - ArgumentChecks.ensureNonNull("other", other); Double min = other.getMinimumValue(); Double max = other.getMaximumValue(); try { diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java index 09cb2770b5,32dd00fc96..397cc2f703 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java @@@ -268,9 -253,9 +268,9 @@@ public class DefaultMaintenanceInformat public Date getDateOfNextUpdate() { if (FilterByVersion.LEGACY_METADATA.accept()) { final Collection<CitationDate> dates = getMaintenanceDates(); - if (dates != null) { // May be null on XML marshalling. + if (dates != null) { // May be null on XML marshalling. for (final CitationDate date : dates) { - if (NEXT_UPDATE.equals(date.getDateType())) { - if (date.getDateType() == DateType.NEXT_UPDATE) { ++ if (date.getDateType() == NEXT_UPDATE) { return date.getDate(); } } @@@ -293,7 -278,7 +293,7 @@@ final Iterator<CitationDate> it = dates.iterator(); while (it.hasNext()) { final CitationDate date = it.next(); - if (NEXT_UPDATE.equals(date.getDateType())) { - if (date.getDateType() == DateType.NEXT_UPDATE) { ++ if (date.getDateType() == NEXT_UPDATE) { if (newValue == null) { it.remove(); return; diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java index 807f038563,9e61cd69a9..03957006d9 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java @@@ -562,14 -562,13 +562,14 @@@ public class DefaultScopeDescription ex * * @since 1.0 */ + @SuppressWarnings("deprecation") public void setLevelDescription(final ScopeCode level, final Set<? extends CharSequence> newValues) { - if (ScopeCode.DATASET.equals(level)) { + if (level == ScopeCode.DATASET) { String description = null; if (newValues != null) { - for (CharSequence value : newValues) { - if (value != null) { - description = value.toString(); + for (CharSequence v : newValues) { + if (v != null) { + description = v.toString(); break; } } diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/RecordDefinition.java index 2f54d5a67f,e7f78fe005..e75e38fcdd --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/RecordDefinition.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/RecordDefinition.java @@@ -29,11 -28,11 +28,11 @@@ import org.opengis.util.MemberName import org.apache.sis.util.Classes; import org.apache.sis.util.Numbers; import org.apache.sis.util.CharSequences; - import org.apache.sis.util.collection.Containers; import org.apache.sis.util.internal.CollectionsExt; + import org.apache.sis.pending.jdk.JDK19; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.AttributeType; +// Specific to the main branch: +import org.apache.sis.metadata.simple.SimpleAttributeType; /** diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/Types.java index 1e9e59d41f,dd989fefa7..59689bfdcb --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/Types.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/util/iso/Types.java @@@ -42,13 -41,14 +41,13 @@@ import org.apache.sis.util.OptionalCand import org.apache.sis.util.logging.Logging; import org.apache.sis.util.resources.Errors; import org.apache.sis.util.resources.Messages; - import org.apache.sis.util.collection.Containers; import org.apache.sis.util.collection.BackingStoreException; import org.apache.sis.util.internal.CodeLists; + import org.apache.sis.pending.jdk.JDK19; import org.apache.sis.system.Modules; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.annotation.ResourceBundles; -import org.opengis.util.ControlledVocabulary; +// Specific to the main branch: +import java.io.InputStream; /** diff --cc endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/StyleElement.java index eea55392cd,cb20c18989..72ce62a9f3 --- a/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/StyleElement.java +++ b/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/StyleElement.java @@@ -18,12 -18,13 +18,12 @@@ package org.apache.sis.style.se1 import java.awt.Color; import java.util.Arrays; + import java.util.Objects; import jakarta.xml.bind.annotation.XmlTransient; import org.opengis.util.InternationalString; - import org.apache.sis.util.ArgumentChecks; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.filter.Expression; -import org.opengis.filter.Literal; +// Specific to the main branch: +import org.apache.sis.filter.Expression; /** diff --cc endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/StyleFactory.java index 8a32130fcd,66b33da43c..c500734661 --- a/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/StyleFactory.java +++ b/endorsed/src/org.apache.sis.portrayal/main/org/apache/sis/style/se1/StyleFactory.java @@@ -95,9 -95,8 +95,8 @@@ public class StyleFactory<R> * * @param filterFactory the factory to use for creating expressions. */ - public StyleFactory(final FilterFactory<R,?,?> filterFactory) { + public StyleFactory(final DefaultFilterFactory<R,?,?> filterFactory) { - ArgumentChecks.ensureNonNull("filterFactory", filterFactory); - this.filterFactory = filterFactory; + this.filterFactory = Objects.requireNonNull(filterFactory); enabled = filterFactory.literal(Boolean.TRUE); disabled = filterFactory.literal(Boolean.FALSE); zeroAsInt = filterFactory.literal(0); diff --cc endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/FinalLocationType.java index 666e966d2b,17b9f10eb7..53eff98dcd --- a/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/FinalLocationType.java +++ b/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/FinalLocationType.java @@@ -108,9 -112,9 +108,9 @@@ final class FinalLocationType extends A * @param rs the reference system that comprises this location type. * @param existing other {@code FinalLocationType} instances created before this one. */ - @SuppressWarnings("ThisEscapedInObjectConstruction") + @SuppressWarnings("LocalVariableHidesMemberVariable") - private FinalLocationType(final LocationType source, final ReferenceSystemUsingIdentifiers rs, - final Map<LocationType, FinalLocationType> existing) + private FinalLocationType(final AbstractLocationType source, final ReferencingByIdentifiers rs, + final Map<AbstractLocationType, FinalLocationType> existing) { /* * Put 'this' in the map at the beginning in case the parents and children contain cyclic references. @@@ -207,10 -211,14 +207,12 @@@ * @param metadata the metadata object to eventually copy, or {@code null}. * @return an unmodifiable copy of the given metadata object, or {@code null} if the given argument is {@code null}. */ - private static <T> T unmodifiable(final Class<T> type, T metadata) { + private static Object unmodifiable(Object metadata) { if (metadata instanceof ModifiableMetadata) { - metadata = MetadataCopier.forModifiable(((ModifiableMetadata) metadata).getStandard()).copy(type, metadata); + metadata = MetadataCopier.forModifiable(((ModifiableMetadata) metadata).getStandard()).copy(metadata); - ((ModifiableMetadata) metadata).transitionTo(ModifiableMetadata.State.FINAL); + if (metadata instanceof ModifiableMetadata) { + ((ModifiableMetadata) metadata).transitionTo(ModifiableMetadata.State.FINAL); + } } return metadata; } diff --cc endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/GeohashReferenceSystem.java index 09b4e7524e,586603cd64..e1c60e6b95 --- a/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/GeohashReferenceSystem.java +++ b/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/GeohashReferenceSystem.java @@@ -45,9 -45,13 +45,9 @@@ import org.apache.sis.util.resources.Er import org.apache.sis.util.resources.Vocabulary; import org.apache.sis.pending.jdk.JDK18; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.referencing.gazetteer.Location; -import org.opengis.referencing.gazetteer.LocationType; - /** - * Geographic coordinates represented as <cite>geohashes</cite> strings. + * Geographic coordinates represented as <i>geohashes</i> strings. * Geohash is a simple encoding of geographic coordinates into a short string of letters and digits. * Longer strings are more accurate, however the accuracy is not uniformly distributed between latitude * and longitude, and removing digits decreases accuracy faster when the point is located close to the diff --cc endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/LocationFormat.java index 96449117bc,3cccc4f551..f31522fd1c --- a/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/LocationFormat.java +++ b/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/LocationFormat.java @@@ -204,8 -201,8 +204,8 @@@ public class LocationFormat extends Tab * @throws IOException if an error occurred while writing to the given appendable. */ @Override - @SuppressWarnings({"fallthrough", "null"}) + @SuppressWarnings("fallthrough") - public void format(final Location location, final Appendable toAppendTo) throws IOException { + public void format(final AbstractLocation location, final Appendable toAppendTo) throws IOException { ArgumentChecks.ensureNonNull("location", location); final Locale locale = getLocale(Locale.Category.DISPLAY); final Vocabulary vocabulary = Vocabulary.forLocale(locale); diff --cc endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/ReferencingByIdentifiers.java index f6cc69634e,178a1dde52..7b10d323c7 --- a/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/ReferencingByIdentifiers.java +++ b/endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/ReferencingByIdentifiers.java @@@ -191,11 -172,11 +191,11 @@@ public abstract class ReferencingByIden * @param properties the properties to be given to the reference system. * @param types description of location type(s) in the spatial reference system. */ - @SuppressWarnings("ThisEscapedInObjectConstruction") + @SuppressWarnings("this-escape") - public ReferencingByIdentifiers(final Map<String,?> properties, final LocationType... types) { + public ReferencingByIdentifiers(final Map<String,?> properties, final ModifiableLocationType... types) { super(properties); theme = Types.toInternationalString(properties, THEME_KEY); - overallOwner = Containers.property(properties, OVERALL_OWNER_KEY, Party.class); + overallOwner = Containers.property(properties, OVERALL_OWNER_KEY, AbstractParty.class); /* * Having the 'this' reference escaped in object construction should not be an issue here because * we invoke package-private method in such a way that if an exception is thrown, the whole tree diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/ImmutableIdentifier.java index d64dfac068,1c357a918c..6c731a2096 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/ImmutableIdentifier.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/ImmutableIdentifier.java @@@ -171,10 -161,9 +170,9 @@@ public class ImmutableIdentifier extend * * @param identifier the identifier to copy. * - * @see #castOrCopy(Identifier) + * @see #castOrCopy(ReferenceIdentifier) */ - public ImmutableIdentifier(final Identifier identifier) { + public ImmutableIdentifier(final ReferenceIdentifier identifier) { - ensureNonNull("identifier", identifier); code = identifier.getCode(); codeSpace = identifier.getCodeSpace(); authority = identifier.getAuthority(); diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java index 9610db43fa,b934a7d676..60a99868cd --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultGeodeticCRS.java @@@ -44,11 -44,7 +44,10 @@@ import org.apache.sis.metadata.internal import org.apache.sis.io.wkt.Convention; import org.apache.sis.io.wkt.Formatter; import org.apache.sis.measure.Units; - import static org.apache.sis.util.ArgumentChecks.ensureNonNull; +// Specific to the main branch: +import org.opengis.referencing.ReferenceIdentifier; + /** * A 2- or 3-dimensional coordinate reference system based on a geodetic datum. diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultParametricCRS.java index 7fe6172b7c,7c87126140..ac3e06f598 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultParametricCRS.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/crs/DefaultParametricCRS.java @@@ -25,11 -26,11 +26,10 @@@ import org.apache.sis.referencing.util. import org.apache.sis.referencing.cs.AxesConvention; import org.apache.sis.referencing.cs.AbstractCS; import org.apache.sis.io.wkt.Formatter; - import org.apache.sis.util.ArgumentChecks; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.referencing.cs.ParametricCS; -import org.opengis.referencing.crs.ParametricCRS; -import org.opengis.referencing.datum.ParametricDatum; +// Specific to the main branch: +import org.apache.sis.referencing.cs.DefaultParametricCS; +import org.apache.sis.referencing.datum.DefaultParametricDatum; /** @@@ -120,14 -118,15 +120,13 @@@ public class DefaultParametricCRS exten * @param properties the properties to be given to the coordinate reference system. * @param datum the datum. * @param cs the coordinate system. - * - * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createParametricCRS(Map, ParametricDatum, ParametricCS) */ public DefaultParametricCRS(final Map<String,?> properties, - final ParametricDatum datum, - final ParametricCS cs) + final DefaultParametricDatum datum, + final DefaultParametricCS cs) { super(properties, cs); - this.datum = datum; - ArgumentChecks.ensureNonNull("datum", datum); + this.datum = Objects.requireNonNull(datum); } /** diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultImageDatum.java index 7f1ac18320,8d5453e74e..07cafc91ee --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultImageDatum.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultImageDatum.java @@@ -30,10 -30,9 +30,9 @@@ import org.apache.sis.metadata.internal import org.apache.sis.io.wkt.Formatter; import org.apache.sis.io.wkt.Convention; import org.apache.sis.util.ComparisonMode; - import static org.apache.sis.util.ArgumentChecks.ensureNonNull; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.metadata.Identifier; +// Specific to the main branch: +import org.opengis.referencing.ReferenceIdentifier; /** diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java index acd8a63a95,77c1ce039e..d8da478068 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java @@@ -40,10 -40,9 +40,9 @@@ import org.apache.sis.io.wkt.Formatter import org.apache.sis.io.wkt.Convention; import org.apache.sis.measure.Units; import static org.apache.sis.util.ArgumentChecks.ensureFinite; - import static org.apache.sis.util.ArgumentChecks.ensureNonNull; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.metadata.Identifier; +// Specific to the main branch: +import org.opengis.referencing.ReferenceIdentifier; /** diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultTemporalDatum.java index 712f951447,9f91330cf2..d01eac983e --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultTemporalDatum.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultTemporalDatum.java @@@ -33,10 -33,9 +33,9 @@@ import org.apache.sis.metadata.internal import org.apache.sis.util.ComparisonMode; import org.apache.sis.io.wkt.Formatter; import org.apache.sis.io.wkt.FormattableObject; - import static org.apache.sis.util.ArgumentChecks.ensureNonNull; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.metadata.Identifier; +// Specific to the main branch: +import org.opengis.referencing.ReferenceIdentifier; /** diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultVerticalDatum.java index ada07456d8,72006ed1b1..5a304dc830 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultVerticalDatum.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/datum/DefaultVerticalDatum.java @@@ -32,10 -32,9 +32,9 @@@ import org.apache.sis.xml.util.LegacyNa import org.apache.sis.referencing.util.WKTKeywords; import org.apache.sis.referencing.internal.VerticalDatumTypes; import org.apache.sis.metadata.internal.ImplementationHelper; - import static org.apache.sis.util.ArgumentChecks.ensureNonNull; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.metadata.Identifier; +// Specific to the main branch: +import org.opengis.referencing.ReferenceIdentifier; /** diff --cc endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java index b7c5818ad0,7e45dba3b4..d1e9b174d2 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java @@@ -278,8 -278,10 +278,9 @@@ public class DefaultCoordinateOperation * * @see DefaultMathTransformFactory#getOperationMethod(String) */ - @Override public OperationMethod getOperationMethod(String name) throws FactoryException { ArgumentChecks.ensureNonEmpty("name", name = name.strip()); + @SuppressWarnings("LocalVariableHidesMemberVariable") final MathTransformFactory mtFactory = getMathTransformFactory(); if (mtFactory instanceof DefaultMathTransformFactory) { return ((DefaultMathTransformFactory) mtFactory).getOperationMethod(name); diff --cc endorsed/src/org.apache.sis.storage.sql/main/org/apache/sis/storage/sql/feature/FeatureStream.java index 001c8e0097,90711e9ee6..0aa91dbea8 --- a/endorsed/src/org.apache.sis.storage.sql/main/org/apache/sis/storage/sql/feature/FeatureStream.java +++ b/endorsed/src/org.apache.sis.storage.sql/main/org/apache/sis/storage/sql/feature/FeatureStream.java @@@ -152,8 -153,8 +153,8 @@@ final class FeatureStream extends Defer * to express the filter using SQL statements. */ @Override - public Stream<Feature> filter(final Predicate<? super Feature> predicate) { + public Stream<AbstractFeature> filter(final Predicate<? super AbstractFeature> predicate) { - ArgumentChecks.ensureNonNull("predicate", predicate); + Objects.requireNonNull(predicate); if (predicate == Filter.include()) return this; if (predicate == Filter.exclude()) return empty(); if (isPagined()) { diff --cc endorsed/src/org.apache.sis.storage.xml/main/org/apache/sis/storage/gpx/Person.java index ef2ffb4870,e194656d14..24272c7f94 --- a/endorsed/src/org.apache.sis.storage.xml/main/org/apache/sis/storage/gpx/Person.java +++ b/endorsed/src/org.apache.sis.storage.xml/main/org/apache/sis/storage/gpx/Person.java @@@ -108,14 -122,16 +108,14 @@@ public final class Person implements Re return (Person) r; } final Role role = r.getRole(); - final boolean isCreator = Role.ORIGINATOR.equals(role); + final boolean isCreator = (role == Role.ORIGINATOR); - if (isCreator || role == Role.AUTHOR) { - for (final Party p : r.getParties()) { - final String name = Types.toString(p.getName(), locale); - if (name != null) { - final Person pr = new Person(); - pr.name = name; - pr.isCreator = isCreator; - return pr; - } + if (isCreator || Role.AUTHOR.equals(role)) { + final String name = r.getIndividualName(); + if (name != null) { + final Person pr = new Person(); + pr.name = name; + pr.isCreator = isCreator; + return pr; } } return null; diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/FeatureQuery.java index 2d4267e85f,02d6cb6d6d..cde1b1737e --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/FeatureQuery.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/FeatureQuery.java @@@ -581,9 -576,8 +579,8 @@@ public class FeatureQuery extends Quer * @param expression the literal, value reference or expression to be retrieved by a {@code Query}. * @param alias the name to assign to the expression result, or {@code null} if unspecified. */ - public NamedExpression(final Expression<? super Feature,?> expression, final String alias) { + public NamedExpression(final Expression<? super AbstractFeature,?> expression, final String alias) { - ArgumentChecks.ensureNonNull("expression", expression); - this.expression = expression; + this.expression = Objects.requireNonNull(expression); this.alias = (alias != null) ? Names.createLocalName(null, null, alias) : null; this.type = ProjectionType.STORED; } @@@ -597,12 -591,10 +594,10 @@@ * * @since 1.4 */ - public NamedExpression(final Expression<? super Feature,?> expression, final GenericName alias, ProjectionType type) { + public NamedExpression(final Expression<? super AbstractFeature,?> expression, final GenericName alias, ProjectionType type) { - ArgumentChecks.ensureNonNull("expression", expression); - ArgumentChecks.ensureNonNull("type", type); - this.expression = expression; - this.alias = alias; - this.type = type; + this.expression = Objects.requireNonNull(expression); + this.type = Objects.requireNonNull(type); + this.alias = alias; } /** diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/FeatureSet.java index 47bda92e7a,b500df4042..df29fd1d54 --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/FeatureSet.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/FeatureSet.java @@@ -16,12 -16,12 +16,12 @@@ */ package org.apache.sis.storage; + import java.util.Objects; import java.util.stream.Stream; - import org.apache.sis.util.ArgumentChecks; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.Feature; -import org.opengis.feature.FeatureType; +// Specific to the main branch: +import org.apache.sis.feature.AbstractFeature; +import org.apache.sis.feature.DefaultFeatureType; /** diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/LegalSymbols.java index 0000000000,8f6675256b..f9f0e9b198 mode 000000,100644..100644 --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/LegalSymbols.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/LegalSymbols.java @@@ -1,0 -1,217 +1,217 @@@ + /* + * 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.storage.base; + + import java.time.LocalDate; + import java.util.Date; + import java.util.Collections; + import org.opengis.metadata.citation.*; + import org.opengis.metadata.constraint.*; + import org.apache.sis.util.CharSequences; + import org.apache.sis.metadata.iso.citation.*; + import org.apache.sis.metadata.iso.constraint.*; + import static org.apache.sis.util.internal.StandardDateFormat.MILLISECONDS_PER_DAY; + + + /** + * Elements to omit in the legal notice to be parsed by {@link MetadataBuilder#parseLegalNotice(String)}. + * Some of those elements are implied by the metadata were the legal notice will be stored. + * + * @author Martin Desruisseaux (Geomatys) + */ + final class LegalSymbols { + /** + * Symbols associated to restrictions. + */ + private static final LegalSymbols[] VALUES = { + new LegalSymbols(Restriction.COPYRIGHT, "COPYRIGHT", "(C)", "©", "All rights reserved"), + new LegalSymbols(Restriction.TRADEMARK, "TRADEMARK", "(TM)", "™", "(R)", "®") + }; + + /** + * The restriction to use if an item in the {@linkplain #symbols} list is found. + */ + private final Restriction restriction; + + /** + * Symbols to use as an indication that the {@linkplain #restriction} applies. + */ + private final String[] symbols; + + /** + * Creates a new enumeration value for the given symbol. + */ + private LegalSymbols(final Restriction restriction, final String... symbols) { + this.restriction = restriction; + this.symbols = symbols; + } + + /** + * Returns {@code true} if the given character is a space or a punctuation of category "other". + * The punctuation characters include coma, dot, semi-colon, <i>etc.</i> but do not include + * parenthesis or connecting punctuation. + * + * @param c the Unicode code point of the character to test. + */ + private static boolean isSpaceOrPunctuation(final int c) { + switch (Character.getType(c)) { + case Character.LINE_SEPARATOR: + case Character.SPACE_SEPARATOR: + case Character.PARAGRAPH_SEPARATOR: + case Character.OTHER_PUNCTUATION: return true; + default: return false; + } + } + + /** + * Implementation of {@link MetadataBuilder#parseLegalNotice(String)}, provided here for reducing + * the number of class loading in the common case where there is no legal notice to parse. + */ + static void parse(final String notice, final DefaultLegalConstraints constraints) { + final int length = notice.length(); + final StringBuilder buffer = new StringBuilder(length); + int year = 0; // The copyright year, or 0 if none. + int quoteLevel = 0; // Incremented on ( [ « characters, decremented on ) ] » characters. + boolean isCopyright = false; // Whether the word parsed by previous iteration was "Copyright" or "(C)". + boolean wasSeparator = true; // Whether the caracter parsed by the previous iteration was a word separator. + boolean wasPunctuation = true; // Whether the previous character was a punctuation of Unicode category "other". + boolean skipNextChars = true; // Whether the next spaces and some punction characters should be ignored. + parse: for (int i = 0; i < length;) { + final int c = notice.codePointAt(i); + final int n = Character.charCount(c); + int quoteChange = 0; + boolean isSeparator = false; + boolean isPunctuation; + switch (Character.getType(c)) { + case Character.INITIAL_QUOTE_PUNCTUATION: + case Character.START_PUNCTUATION: { + quoteChange = +1; // ( [ « etc. + skipNextChars = false; + isPunctuation = false; + break; + } + case Character.FINAL_QUOTE_PUNCTUATION: + case Character.END_PUNCTUATION: { + quoteChange = -1; // ) ] » etc. + skipNextChars = false; + isPunctuation = false; + break; + } + default: { // Letter, digit, hyphen, etc. + skipNextChars = false; + isPunctuation = false; + break; + } + case Character.OTHER_PUNCTUATION: { // , . : ; / " etc. but not -. + isPunctuation = true; + isSeparator = true; + break; + } + case Character.LINE_SEPARATOR: + case Character.SPACE_SEPARATOR: + case Character.PARAGRAPH_SEPARATOR: { + isPunctuation = wasPunctuation; + isSeparator = true; + break; + } + } + if (wasSeparator && !isSeparator && quoteLevel == 0) { + /* + * Found the beginning of a new word. Ignore textes like "(C)" or "All rights reserved". + * Some of those textes are implied by the metadata where the legal notice will be stored. + */ + for (final LegalSymbols r : VALUES) { + for (final String symbol : r.symbols) { + if (notice.regionMatches(true, i, symbol, 0, symbol.length())) { + final int after = i + symbol.length(); + if (after >= length || isSpaceOrPunctuation(notice.codePointAt(after))) { + isCopyright |= (r.restriction == Restriction.COPYRIGHT); + constraints.getUseConstraints().add(r.restriction); + wasPunctuation = true; // Pretend that "Copyright" was followed by a coma. + skipNextChars = true; // Ignore spaces and punctuations until the next word. + i = after; // Skip the "Copyright" (or other) word. + continue parse; + } + } + } + } + /* + * If a copyright notice is followed by digits, assume that those digits are the copyright year. + * We require the year is followed by punctuations or non-breaking space in order to reduce the + * risk of confusion with postal addresses. So this block should accept "John, 1992." but not + * "1992-1 Nowhere road". + */ + if (isCopyright && wasPunctuation && year == 0 && c >= '0' && c <= '9') { + int endOfDigits = i + n; // After the last digit in sequence. + while (endOfDigits < length) { + final int d = notice.codePointAt(endOfDigits); + if (d < '0' || d > '9') break; + endOfDigits++; // No need to use Character.charCount(s) here. + } + // Verify if the digits are followed by a punctuation. + final int endOfToken = CharSequences.skipLeadingWhitespaces(notice, endOfDigits, length); + if (endOfToken > endOfDigits || isSpaceOrPunctuation(notice.codePointAt(endOfToken))) try { + year = Integer.parseInt(notice.substring(i, endOfDigits)); + if (year >= 1800 && year <= 9999) { // Those limits are arbitrary. + skipNextChars = true; + i = endOfToken; + continue; + } + year = 0; // Reject as not a copyright year. + } catch (NumberFormatException e) { + // Not an integer - ignore, will be handled as text. + } + } + } + /* + * End of the block that was executed at the beginning of each new word. + * Following is executed for every characters, except if the above block + * skipped a portion of the input string. + */ + wasPunctuation = isPunctuation; + wasSeparator = isSeparator; + quoteLevel += quoteChange; + if (!skipNextChars && !Character.isIdentifierIgnorable(c)) { + buffer.appendCodePoint(c); + } + i += n; + } + /* + * End of parsing. Omit trailing spaces and some punctuations if any, then store the result. + */ + int i = buffer.length(); + while (i > 0) { + final int c = buffer.codePointBefore(i); + if (!isSpaceOrPunctuation(c)) break; + i -= Character.charCount(c); + } + final DefaultCitation c = new DefaultCitation(notice); + if (year != 0) { + final Date date = new Date(LocalDate.of(year, 1, 1).toEpochDay() * MILLISECONDS_PER_DAY); - c.setDates(Collections.singleton(new DefaultCitationDate(date, DateType.IN_FORCE))); ++ c.setDates(Collections.singleton(new DefaultCitationDate(date, DateType.valueOf("IN_FORCE")))); + } + if (i != 0) { + buffer.setLength(i); + // Same limitation as MetadataBuilder.party(). + final AbstractParty party = new AbstractParty(buffer, null); + final var r = new DefaultResponsibleParty(Role.OWNER); + r.setParties(Collections.singleton(party)); + c.setCitedResponsibleParties(Collections.singleton(r)); + } + constraints.getReferences().add(c); + } + } diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MemoryFeatureSet.java index 5b67852fdb,8b25894a1b..c2b08a277c --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MemoryFeatureSet.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MemoryFeatureSet.java @@@ -21,11 -22,10 +22,10 @@@ import java.util.OptionalLong import java.util.stream.Stream; import org.apache.sis.storage.Resource; import org.apache.sis.storage.AbstractFeatureSet; - import org.apache.sis.util.ArgumentChecks; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.feature.Feature; -import org.opengis.feature.FeatureType; +// Specific to the main branch: +import org.apache.sis.feature.AbstractFeature; +import org.apache.sis.feature.DefaultFeatureType; /** @@@ -56,12 -56,10 +56,10 @@@ public class MemoryFeatureSet extends A * @param type the type of all features in the given collection. * @param features collection of stored features. This collection will not be copied. */ - public MemoryFeatureSet(final Resource parent, final FeatureType type, final Collection<Feature> features) { + public MemoryFeatureSet(final Resource parent, final DefaultFeatureType type, final Collection<AbstractFeature> features) { super(parent); - ArgumentChecks.ensureNonNull("type", type); - ArgumentChecks.ensureNonNull("features", features); - this.type = type; - this.features = features; + this.type = Objects.requireNonNull(type); + this.features = Objects.requireNonNull(features); } /** diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java index 6c9d7c10cd,e22d14dae3..9cf7d4fe47 --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/base/MetadataBuilder.java @@@ -96,10 -95,11 +95,9 @@@ import org.apache.sis.coverage.grid.Gri import org.apache.sis.coverage.grid.GridExtent; import org.apache.sis.pending.jdk.JDK21; import org.apache.sis.measure.Units; - import static org.apache.sis.util.internal.StandardDateFormat.MILLISECONDS_PER_DAY; -// Specific to the geoapi-3.1 and geoapi-4.0 branches: -import org.opengis.temporal.Duration; -import org.opengis.feature.FeatureType; -import org.apache.sis.metadata.simple.SimpleDuration; +// Specific to the main branch: +import org.apache.sis.feature.DefaultFeatureType; /** diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/csv/Store.java index 40be350d5e,e5920dd3a7..606d638b5e --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/csv/Store.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/csv/Store.java @@@ -232,9 -234,9 +232,9 @@@ final class Store extends URIDataStore final Reader r = connector.commit(Reader.class, StoreProvider.NAME); source = (r instanceof BufferedReader) ? (BufferedReader) r : new LineNumberReader(r); geometries = Geometries.factory(connector.getOption(OptionKey.GEOMETRY_LIBRARY)); - dissociate = FoliationRepresentation.FRAGMENTED.equals(connector.getOption(DataOptionKey.FOLIATION_REPRESENTATION)); + dissociate = connector.getOption(DataOptionKey.FOLIATION_REPRESENTATION) == FoliationRepresentation.FRAGMENTED; GeneralEnvelope envelope = null; - FeatureType featureType = null; + DefaultFeatureType featureType = null; Foliation foliation = null; try { final List<String> elements = new ArrayList<>(); diff --cc endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/xml/GeographicEnvelope.java index d4533b54d8,1b2178976a..ba43baaf4e --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/xml/GeographicEnvelope.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/xml/GeographicEnvelope.java @@@ -136,31 -120,9 +136,31 @@@ public abstract class GeographicEnvelop return Collections.singleton(this); } + /** + * Provides temporal component of the extent of the referring object. + * The default implementation unconditionally returns an empty set. + * + * @return the temporal extent, or an empty set if none. + */ + @Override + public Collection<? extends TemporalExtent> getTemporalElements() { + return Collections.emptySet(); + } + + /** + * Provides vertical component of the extent of the referring object. + * The default implementation unconditionally returns an empty set. + * + * @return the vertical extent, or an empty set if none. + */ + @Override + public Collection<? extends VerticalExtent> getVerticalElements() { + return Collections.emptySet(); + } + /** * Indication of whether the bounding box encompasses an area covered by the data - * (<cite>inclusion</cite>) or an area where data is not present (<cite>exclusion</cite>). + * (<dfn>inclusion</dfn>) or an area where data is not present (<dfn>exclusion</dfn>). * The default implementation unconditionally returns {@link Boolean#TRUE}. * * @return {@code true} for inclusion, or {@code false} for exclusion. diff --cc incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileStore.java index 2b6cda1397,13680c102e..adbc1b7614 --- a/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileStore.java +++ b/incubator/src/org.apache.sis.storage.shapefile/main/org/apache/sis/storage/shapefile/ShapefileStore.java @@@ -1003,9 -1002,9 +1003,9 @@@ public final class ShapefileStore exten */ private static Entry<Envelope,Filter> extractBbox(Filter<?> filter) { - final CodeList operatorType = filter.getOperatorType(); + final Enum operatorType = filter.getOperatorType(); - if (SpatialOperatorName.BBOX.equals(operatorType)) { + if (operatorType == SpatialOperatorName.BBOX) { Envelope env = isDirectBbox(filter); if (env != null) { return new AbstractMap.SimpleImmutableEntry<>(env, null); diff --cc optional/src/org.apache.sis.gui/main/org/apache/sis/gui/metadata/IdentificationInfo.java index 34e0e8f13c,854d7ecdbb..1cb7dd1805 --- a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/metadata/IdentificationInfo.java +++ b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/metadata/IdentificationInfo.java @@@ -340,7 -342,7 +340,7 @@@ final class IdentificationInfo extends final Date cd = c.getDate(); if (cd != null) { final DateType type = c.getDateType(); - if (DateType.PUBLICATION.equals(type) || DateType.valueOf("RELEASED").equals(type)) { - if (type == DateType.PUBLICATION || type == DateType.RELEASED) { ++ if (type == DateType.PUBLICATION || type == DateType.valueOf("RELEASED")) { label = Vocabulary.Keys.PublicationDate; date = cd; break; // Take the first publication or release date.
