This is an automated email from the ASF dual-hosted git repository. asf-gitbox-commits pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit faa80d5c73853f6085495d50644d7564bb7e3ab5 Author: Martin Desruisseaux <[email protected]> AuthorDate: Tue May 12 10:39:27 2026 +0200 Add an `InternalDataStoreException` for making easier to spot exceptions that shouldn't happen. --- .../main/org/apache/sis/xml/TransformedEvent.java | 2 +- .../sis/referencing/cs/CoordinateSystems.java | 2 +- .../factory/CommonAuthorityFactory.java | 6 ++--- .../referencing/factory/FactoryDataException.java | 2 +- .../referencing/factory/GeodeticObjectFactory.java | 2 +- ...xception.java => InternalFactoryException.java} | 28 ++++++++++++---------- .../referencing/operation/gridded/LoadedGrid.java | 2 +- .../operation/projection/ZonedGridSystem.java | 3 ++- .../provider/FranceGeocentricInterpolation.java | 3 ++- .../GeocentricAffineBetweenGeographic.java | 3 ++- .../operation/provider/GeocentricToGeographic.java | 3 ++- .../operation/provider/Geographic3Dto2D.java | 3 ++- .../operation/provider/Spherical2Dto3D.java | 3 ++- .../operation/provider/VerticalOffset.java | 3 ++- .../transform/DefaultMathTransformFactory.java | 3 ++- .../transform/EllipsoidToRadiusTransform.java | 3 ++- .../sis/storage/geotiff/reader/Localization.java | 3 ++- .../sis/storage/InternalDataStoreException.java | 9 ++++--- .../main/org/apache/sis/util/Exceptions.java | 6 ++--- 19 files changed, 52 insertions(+), 37 deletions(-) diff --git a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/TransformedEvent.java b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/TransformedEvent.java index 414e092375..04cbfa1826 100644 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/TransformedEvent.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/xml/TransformedEvent.java @@ -114,7 +114,7 @@ abstract class TransformedEvent<E extends XMLEvent> implements XMLEvent { */ @Override public final String toString() { - final StringBuilder out = new StringBuilder(); + final var out = new StringBuilder(); try { write(out); } catch (IOException e) { // Should never happen since we write to a StringBuilder. diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/cs/CoordinateSystems.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/cs/CoordinateSystems.java index fdb305898d..b7f83226c4 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/cs/CoordinateSystems.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/cs/CoordinateSystems.java @@ -716,7 +716,7 @@ forDim: switch (axes.length) { * Those two coordinate system types can be differentiated by the unit of the two first axes. * If a future implementation supports more CS types, above condition will need to be updated. */ - final AxisDirection[] directions = new AxisDirection[axes.length]; + final var directions = new AxisDirection[axes.length]; for (int i=0; i<directions.length; i++) { final CoordinateSystemAxis axis = axes[i]; ArgumentChecks.ensureNonNullElement("axes", i, axis); diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/CommonAuthorityFactory.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/CommonAuthorityFactory.java index 4525df2250..6948e078c5 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/CommonAuthorityFactory.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/CommonAuthorityFactory.java @@ -307,7 +307,7 @@ public class CommonAuthorityFactory extends GeodeticAuthorityFactory implements */ static String reformat(String code) { try { - final CommonAuthorityCode parsed = new CommonAuthorityCode(code); + final var parsed = new CommonAuthorityCode(code); code = parsed.localCode; code = parsed.isNumeric ? format(Integer.parseInt(code)) : format(code); } catch (NoSuchAuthorityCodeException | NumberFormatException e) { @@ -371,7 +371,7 @@ public class CommonAuthorityFactory extends GeodeticAuthorityFactory implements private void add(final int code, final Class<? extends SingleCRS> type) throws FactoryException { assert (code >= FIRST_PROJECTION_CODE) == (ProjectedCRS.class.isAssignableFrom(type)) : code; if (codes.put(format(code), type) != null) { - throw new FactoryException(); // Should never happen, but we are paranoiac. + throw new InternalFactoryException(); // Should never happen, but we are paranoiac. } } @@ -424,7 +424,7 @@ public class CommonAuthorityFactory extends GeodeticAuthorityFactory implements public Optional<InternationalString> getDescriptionText(final Class<? extends IdentifiedObject> type, final String code) throws FactoryException { - final CommonAuthorityCode parsed = new CommonAuthorityCode(code); + final var parsed = new CommonAuthorityCode(code); if (parsed.isNumeric && parsed.isParameterless()) { /* * For codes in the "AUTO(2)" namespace without parameters, we cannot rely on the default implementation diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/FactoryDataException.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/FactoryDataException.java index f5038ff681..44b97cffb9 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/FactoryDataException.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/FactoryDataException.java @@ -23,7 +23,7 @@ import org.opengis.util.FactoryException; * Thrown when a factory contains invalid data. * * <h2>Example</h2> - * An EPSG database record containing a null value in a column where nulls should not have been allowed. + * An <abbr>EPSG</abbr> database record containing a null value in a column where nulls should not have been allowed. * * @author Martin Desruisseaux (Geomatys) * @version 1.2 diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticObjectFactory.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticObjectFactory.java index d86a516c4b..eacae1252e 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticObjectFactory.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/GeodeticObjectFactory.java @@ -1885,7 +1885,7 @@ public class GeodeticObjectFactory extends AbstractFactory implements CRSFactory } p = c.newInstance(defaultProperties, this, DefaultMathTransformFactory.provider()); } catch (ReflectiveOperationException e) { - throw new FactoryException(e); + throw new InternalFactoryException(e); } final Object object; try { diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/FactoryDataException.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/InternalFactoryException.java similarity index 68% copy from endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/FactoryDataException.java copy to endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/InternalFactoryException.java index f5038ff681..49752df9b7 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/FactoryDataException.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/factory/InternalFactoryException.java @@ -17,31 +17,33 @@ package org.apache.sis.referencing.factory; import org.opengis.util.FactoryException; +import org.opengis.referencing.operation.NoninvertibleTransformException; /** - * Thrown when a factory contains invalid data. - * - * <h2>Example</h2> - * An EPSG database record containing a null value in a column where nulls should not have been allowed. + * Thrown when an internal error occurred in a {@code Factory} implementation. + * This error is not necessarily caused by a malformed <abbr>CRS</abbr> or other geodetic object. + * It is more likely caused by a bug in the implementation, for example a + * {@linkplain NoninvertibleTransformException non invertible transform} + * in a context where this error should not have occurred. * * @author Martin Desruisseaux (Geomatys) - * @version 1.2 + * @version 1.7 * - * @see MissingFactoryResourceException + * @see org.apache.sis.storage.InternalDataStoreException * - * @since 0.7 + * @since 1.7 */ -public class FactoryDataException extends FactoryException { +public class InternalFactoryException extends FactoryException { /** * Serial number for inter-operability with different versions. */ - private static final long serialVersionUID = -6296443455120500463L; + private static final long serialVersionUID = 2987973777167896560L; /** * Construct an exception with no detail message. */ - public FactoryDataException() { + public InternalFactoryException() { } /** @@ -49,7 +51,7 @@ public class FactoryDataException extends FactoryException { * * @param message the detail message, saved for later retrieval by the {@link #getMessage()} method. */ - public FactoryDataException(String message) { + public InternalFactoryException(String message) { super(message); } @@ -60,7 +62,7 @@ public class FactoryDataException extends FactoryException { * * @since 1.2 */ - public FactoryDataException(Throwable cause) { + public InternalFactoryException(Throwable cause) { super(cause); } @@ -70,7 +72,7 @@ public class FactoryDataException extends FactoryException { * @param message the detail message, saved for later retrieval by the {@link #getMessage()} method. * @param cause the cause for this exception, saved for later retrieval by the {@link #getCause()} method. */ - public FactoryDataException(String message, Throwable cause) { + public InternalFactoryException(String message, Throwable cause) { super(message, cause); } } diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/gridded/LoadedGrid.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/gridded/LoadedGrid.java index 6da8da23d9..f19d618c50 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/gridded/LoadedGrid.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/gridded/LoadedGrid.java @@ -494,7 +494,7 @@ public abstract class LoadedGrid<C extends Quantity<C>, T extends Quantity<T>> e if (subgrids == null) { return global; } - final Map<Envelope,MathTransform> specializations = JDK19.newLinkedHashMap(subgrids.length); + final Map<Envelope, MathTransform> specializations = JDK19.newLinkedHashMap(subgrids.length); for (final LoadedGrid<Angle,Angle> sg : subgrids) try { final Envelope domain = sg.getDomainOfValidity(Units.DEGREE); final MathTransform st = createGeodeticTransformation(provider, factory, sg); diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/projection/ZonedGridSystem.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/projection/ZonedGridSystem.java index 499623609a..18f5187519 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/projection/ZonedGridSystem.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/projection/ZonedGridSystem.java @@ -36,6 +36,7 @@ import org.apache.sis.referencing.operation.transform.AbstractMathTransform2D; import org.apache.sis.referencing.operation.transform.ContextualParameters; import org.apache.sis.referencing.operation.transform.DomainDefinition; import org.apache.sis.referencing.operation.matrix.MatrixSIS; +import org.apache.sis.referencing.factory.InternalFactoryException; import org.apache.sis.parameter.Parameters; import org.apache.sis.geometry.Envelope2D; import org.apache.sis.measure.Longitude; @@ -226,7 +227,7 @@ public class ZonedGridSystem extends AbstractMathTransform2D implements Serializ try { inverseProjection = (AbstractMathTransform) forward.projection.inverse(); } catch (NoninvertibleTransformException e) { - throw new FactoryException(e); // Should not happen. + throw new InternalFactoryException(e); // Should not happen. } } diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/FranceGeocentricInterpolation.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/FranceGeocentricInterpolation.java index 6ec190b41b..b5f2f11a8a 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/FranceGeocentricInterpolation.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/FranceGeocentricInterpolation.java @@ -46,6 +46,7 @@ import org.apache.sis.referencing.operation.gridded.LoadedGrid; import org.apache.sis.referencing.operation.gridded.GridLoader; import org.apache.sis.referencing.operation.gridded.CompressedGrid; import org.apache.sis.referencing.operation.transform.InterpolatedGeocentricTransform; +import org.apache.sis.referencing.factory.InternalFactoryException; import org.apache.sis.referencing.internal.Resources; import org.apache.sis.referencing.internal.shared.NilReferencingObject; import org.apache.sis.parameter.ParameterBuilder; @@ -303,7 +304,7 @@ public final class FranceGeocentricInterpolation extends AbstractProvider { try { tr = tr.inverse(); } catch (NoninvertibleTransformException e) { - throw new FactoryException(e); // Should never happen. + throw new InternalFactoryException(e); // Should never happen. } return tr; } diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/GeocentricAffineBetweenGeographic.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/GeocentricAffineBetweenGeographic.java index 64ca490cb4..b1b536836d 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/GeocentricAffineBetweenGeographic.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/GeocentricAffineBetweenGeographic.java @@ -27,6 +27,7 @@ import org.opengis.referencing.operation.MathTransformFactory; import org.opengis.referencing.operation.NoninvertibleTransformException; import org.apache.sis.referencing.datum.DefaultEllipsoid; import org.apache.sis.referencing.operation.transform.EllipsoidToCentricTransform; +import org.apache.sis.referencing.factory.InternalFactoryException; import org.apache.sis.metadata.iso.citation.Citations; import org.apache.sis.parameter.ParameterBuilder; import org.apache.sis.parameter.Parameters; @@ -237,7 +238,7 @@ public abstract class GeocentricAffineBetweenGeographic extends GeocentricAffine try { toGeographic = toGeographic.inverse(); } catch (NoninvertibleTransformException e) { - throw new FactoryException(e); // Should never happen with SIS implementation. + throw new InternalFactoryException(e); // Should never happen with SIS implementation. } /* * The Geocentric → Affine → Geographic chain. diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/GeocentricToGeographic.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/GeocentricToGeographic.java index c89250e67d..40922fbc26 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/GeocentricToGeographic.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/GeocentricToGeographic.java @@ -24,6 +24,7 @@ import org.opengis.referencing.cs.CartesianCS; import org.opengis.referencing.cs.EllipsoidalCS; import org.opengis.util.FactoryException; import org.apache.sis.metadata.iso.citation.Citations; +import org.apache.sis.referencing.factory.InternalFactoryException; /** @@ -79,7 +80,7 @@ public final class GeocentricToGeographic extends AbstractProvider { try { tr = tr.inverse(); } catch (NoninvertibleTransformException e) { - throw new FactoryException(e); // Should never happen with SIS implementation. + throw new InternalFactoryException(e); // Should never happen with SIS implementation. } return tr; } diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/Geographic3Dto2D.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/Geographic3Dto2D.java index 1afe80287e..142f8cee18 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/Geographic3Dto2D.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/Geographic3Dto2D.java @@ -29,6 +29,7 @@ import org.apache.sis.referencing.operation.matrix.Matrices; import org.apache.sis.referencing.operation.matrix.MatrixSIS; import org.apache.sis.referencing.internal.shared.WKTKeywords; import org.apache.sis.referencing.internal.shared.WKTUtilities; +import org.apache.sis.referencing.factory.InternalFactoryException; import org.apache.sis.io.wkt.FormattableObject; import org.apache.sis.io.wkt.Formatter; @@ -151,7 +152,7 @@ public final class Geographic3Dto2D extends AbstractProvider { if (inverse) try { tr = tr.inverse(); } catch (NoninvertibleTransformException e) { - throw new FactoryException(e); // Should never happen. + throw new InternalFactoryException(e); // Should never happen. } return tr; } diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/Spherical2Dto3D.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/Spherical2Dto3D.java index 8122889c8b..6d54d6fcb2 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/Spherical2Dto3D.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/Spherical2Dto3D.java @@ -26,6 +26,7 @@ import org.opengis.referencing.operation.NoninvertibleTransformException; import org.apache.sis.metadata.iso.citation.Citations; import org.apache.sis.parameter.ParameterBuilder; import org.apache.sis.util.internal.shared.Constants; +import org.apache.sis.referencing.factory.InternalFactoryException; /** @@ -118,7 +119,7 @@ public final class Spherical2Dto3D extends AbstractProvider { try { return inverse().createMathTransform(context).inverse(); } catch (NoninvertibleTransformException e) { - throw new FactoryException(e); // Should never happen. + throw new InternalFactoryException(e); // Should never happen. } } } diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/VerticalOffset.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/VerticalOffset.java index 0833b31b00..1ab85641d1 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/VerticalOffset.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/provider/VerticalOffset.java @@ -26,6 +26,7 @@ import org.opengis.referencing.operation.Matrix; import org.opengis.referencing.operation.NoninvertibleTransformException; import org.opengis.util.FactoryException; import org.apache.sis.parameter.Parameters; +import org.apache.sis.referencing.factory.InternalFactoryException; import org.apache.sis.referencing.operation.transform.MathTransforms; @@ -118,7 +119,7 @@ public final class VerticalOffset extends AbstractProvider { if (after.getElement(0,0) < 0) try { parameterized = parameterized.inverse(); } catch (NoninvertibleTransformException e) { - throw new FactoryException(e); // Should never happe since matrix element is not zero. + throw new InternalFactoryException(e); // Should never happe since matrix element is not zero. } return parameterized; } diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java index 65397554b0..4486250e05 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java @@ -42,6 +42,7 @@ import org.apache.sis.util.collection.WeakHashSet; import org.apache.sis.referencing.internal.ParameterizedTransformBuilder; import org.apache.sis.referencing.internal.shared.CoordinateOperations; import org.apache.sis.referencing.operation.DefaultOperationMethod; +import org.apache.sis.referencing.factory.InternalFactoryException; import org.apache.sis.referencing.factory.InvalidGeodeticParameterException; import org.apache.sis.parameter.DefaultParameterValueGroup; import org.apache.sis.system.Reflect; @@ -610,7 +611,7 @@ public class DefaultMathTransformFactory extends AbstractFactory implements Math } p = c.newInstance(this); } catch (ReflectiveOperationException e) { - throw new FactoryException(e); + throw new InternalFactoryException(e); } /* * No need to check the type of the parsed object, because MathTransformParser diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/EllipsoidToRadiusTransform.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/EllipsoidToRadiusTransform.java index def2725f28..869ca8b11e 100644 --- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/EllipsoidToRadiusTransform.java +++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/transform/EllipsoidToRadiusTransform.java @@ -37,6 +37,7 @@ import org.apache.sis.referencing.operation.matrix.MatrixSIS; import org.apache.sis.referencing.operation.provider.MapProjection; import org.apache.sis.referencing.operation.provider.Spherical2Dto3D; import org.apache.sis.referencing.operation.provider.Spherical3Dto2D; +import org.apache.sis.referencing.factory.InternalFactoryException; import org.apache.sis.referencing.internal.shared.ReferencingUtilities; import org.apache.sis.referencing.internal.shared.Formulas; import org.apache.sis.parameter.Parameters; @@ -228,7 +229,7 @@ public class EllipsoidToRadiusTransform extends AbstractMathTransform implements } return complete; } catch (NoninvertibleTransformException e) { - throw new FactoryException(e); // Should never happen. + throw new InternalFactoryException(e); // Should never happen. } /* * Spherical case: the radius value is a constant. In this case, diff --git a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/reader/Localization.java b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/reader/Localization.java index 605771cb00..78cbc7e196 100644 --- a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/reader/Localization.java +++ b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/reader/Localization.java @@ -28,6 +28,7 @@ import org.opengis.referencing.operation.TransformException; import org.apache.sis.referencing.operation.transform.MathTransforms; import org.apache.sis.referencing.operation.transform.LinearTransform; import org.apache.sis.referencing.operation.builder.LocalizationGridBuilder; +import org.apache.sis.referencing.factory.InternalFactoryException; import org.apache.sis.math.Vector; @@ -103,7 +104,7 @@ final class Localization { grid.setDesiredPrecision(PRECISION); final MathTransform tr = grid.create(null); if (addTo != null && addTo.put(grid.getSourceEnvelope(false), tr) != null) { - throw new FactoryException(); // Should never happen. If it does, we have a bug in our algorithm. + throw new InternalFactoryException(); // Should never happen. If it does, we have a bug in our algorithm. } return tr; } catch (ArithmeticException | FactoryException e) { diff --git a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/InternalDataStoreException.java b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/InternalDataStoreException.java index c076e3e7df..0b5c67ed74 100644 --- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/InternalDataStoreException.java +++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/storage/InternalDataStoreException.java @@ -19,13 +19,16 @@ package org.apache.sis.storage; /** * Thrown when an internal error occurred in a {@code DataStore} implementation. - * This error is not necessarily caused by an illegal data file; - * it is more likely caused by a bug in the implementation, + * This error is not necessarily caused by an illegal data file. + * It is more likely caused by a bug in the implementation, * for example when an inconsistent state is detected. * * @author Martin Desruisseaux (Geomatys) * @version 1.0 - * @since 1.0 + * + * @see org.apache.sis.referencing.factory.InternalFactoryException + * + * @since 1.0 */ public class InternalDataStoreException extends DataStoreException { /** diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Exceptions.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Exceptions.java index e327c54cbf..dce95e41d0 100644 --- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Exceptions.java +++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/Exceptions.java @@ -203,10 +203,10 @@ public final class Exceptions { * details about the reason are less accessible.</li> * </ul> * - * This method uses only the exception class as criterion; - * it does not verify if the exception messages are the same. + * This method uses only the exception class as criterion. + * It does not verify if the exception messages are the same. * - * @param exception the exception to unwrap (may be {@code null}. + * @param exception the exception to unwrap (may be {@code null}). * @return the unwrapped exception (may be the given argument itself). * * @since 0.8
