You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2023/01/15 18:43:49 UTC

[sis] branch geoapi-4.0 updated (f8afbbfd5b -> 9f079c7e51)

This is an automated email from the ASF dual-hosted git repository.

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


    from f8afbbfd5b Document `StandardDateFormat` as not intended for serialization. We verified that it was not used as non-transient field in a serialiable class.
     new c288461503 Consolidate the constants for `ByteBuffer` capacity and increase the default capacity from 8 kb to 16 kb.
     new 47e5b43141 Replace some <div> by <h2> or <h4> headings. This is a change in javadoc formatting only.
     new 9f079c7e51 Move the `Configuration` annotation to internal package. Apply the annotation on some static constants worth to know that they can be changed.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/sis/gui/RecentFiles.java  |  2 +
 .../org/apache/sis/gui/dataset/FeatureLoader.java  |  2 +
 .../java/org/apache/sis/gui/map/MapCanvasAWT.java  |  3 +
 .../org/apache/sis/internal/gui/LogHandler.java    |  2 +
 .../org/apache/sis/internal/gui/RecentChoices.java |  2 +
 .../apache/sis/internal/gui/control/ColorCell.java |  6 +-
 .../org/apache/sis/coverage/SampleRangeFormat.java |  2 +
 .../java/org/apache/sis/image/ResamplingGrid.java  |  2 +
 .../sis/internal/coverage/j2d/ImageLayout.java     |  4 +
 .../sis/internal/coverage/j2d/ImageUtilities.java  |  4 +
 .../sis/internal/metadata/sql/Initializer.java     |  4 +-
 .../org/apache/sis/metadata/AbstractMetadata.java  |  4 +-
 .../org/apache/sis/metadata/MetadataStandard.java  |  2 +
 .../sis/metadata/StandardImplementation.java       |  4 +-
 .../org/apache/sis/metadata/TreeNodeChildren.java  |  4 +-
 .../apache/sis/metadata/sql/MetadataSource.java    |  3 +
 .../java/org/apache/sis/xml/MarshallerPool.java    |  4 +-
 .../java/org/apache/sis/xml/NilObjectHandler.java  |  4 +-
 .../main/java/org/apache/sis/xml/NilReason.java    |  4 +-
 .../src/main/java/org/apache/sis/xml/XML.java      |  4 +-
 .../coverage/MultiResolutionCoverageLoader.java    |  2 +
 .../org/apache/sis/portrayal/CanvasContext.java    |  2 +
 .../org/apache/sis/geometry/AbstractEnvelope.java  |  4 +-
 .../apache/sis/geometry/GeneralDirectPosition.java |  6 +-
 .../sis/internal/referencing/Arithmetic.java       |  2 +
 .../sis/internal/referencing/DeprecatedCode.java   |  9 +--
 .../sis/internal/referencing/DeprecatedName.java   |  9 +--
 .../apache/sis/internal/referencing/Formulas.java  |  8 +-
 .../referencing/PositionalAccuracyConstant.java    |  4 +
 .../referencing/provider/Geographic3Dto2D.java     |  6 +-
 .../referencing/provider/VerticalOffset.java       |  6 +-
 .../main/java/org/apache/sis/io/wkt/Formatter.java |  3 +
 .../java/org/apache/sis/io/wkt/WKTDictionary.java  |  6 +-
 .../apache/sis/parameter/ParameterValueList.java   |  6 +-
 .../java/org/apache/sis/parameter/Verifier.java    |  4 +-
 .../sis/referencing/GeodesicsOnEllipsoid.java      |  6 +-
 .../sis/referencing/ImmutableIdentifier.java       |  4 +-
 .../sis/referencing/crs/DefaultEngineeringCRS.java |  4 +-
 .../sis/referencing/datum/DatumShiftGrid.java      |  6 +-
 .../factory/ConcurrentAuthorityFactory.java        | 10 ++-
 .../factory/MultiAuthoritiesFactory.java           |  5 +-
 .../sis/referencing/factory/ReferenceKeeper.java   |  3 +
 .../referencing/factory/sql/EPSGCodeFinder.java    |  3 +-
 .../DefaultCoordinateOperationFactory.java         |  2 +
 .../operation/builder/LinearTransformBuilder.java  |  6 +-
 .../operation/builder/LocalizationGridBuilder.java |  2 +
 .../operation/builder/ProjectedTransformTry.java   | 12 +--
 .../operation/matrix/GeneralMatrix.java            |  4 +
 .../referencing/operation/projection/Mercator.java |  3 +-
 .../operation/projection/Orthographic.java         |  4 +-
 .../operation/projection/TransverseMercator.java   |  2 +
 .../operation/transform/ConcatenatedTransform.java |  4 +-
 .../operation/transform/InterpolatedTransform.java |  3 +
 .../org/apache/sis/internal/jdk17/HexFormat.java   |  6 +-
 .../apache/sis/internal/system/CommonExecutor.java |  1 +
 .../apache/sis/internal/system/Configuration.java  | 91 ++++++++++++++++++++++
 .../org/apache/sis/internal/system/Supervisor.java |  6 +-
 .../org/apache/sis/internal/util/DoubleDouble.java |  4 +
 .../org/apache/sis/internal/util/Numerics.java     |  3 +
 .../src/main/java/org/apache/sis/math/Plane.java   |  2 +
 .../src/main/java/org/apache/sis/math/Vector.java  | 10 ++-
 .../java/org/apache/sis/measure/AbstractUnit.java  |  2 +
 .../java/org/apache/sis/measure/UnitFormat.java    |  2 +
 .../java/org/apache/sis/measure/UnitRegistry.java  |  6 +-
 .../java/org/apache/sis/setup/Configuration.java   | 11 ++-
 .../java/org/apache/sis/util/Configuration.java    | 44 -----------
 .../src/main/java/org/apache/sis/util/Locales.java |  4 +-
 .../java/org/apache/sis/util/collection/Cache.java |  8 +-
 .../apache/sis/util/collection/CodeListSet.java    |  4 +-
 .../sis/util/collection/DefaultTreeTable.java      |  9 ++-
 .../sis/util/collection/FrequencySortedSet.java    |  6 +-
 .../apache/sis/util/collection/TreeNodeList.java   |  4 +-
 .../java/org/apache/sis/util/logging/Logging.java  |  2 +
 .../apache/sis/util/logging/MonolineFormatter.java | 15 ++--
 .../apache/sis/util/logging/PerformanceLevel.java  |  7 +-
 .../sis/util/resources/IndexedResourceBundle.java  |  2 +
 ide-project/NetBeans/nbproject/genfiles.properties |  4 +-
 ide-project/NetBeans/nbproject/project.xml         |  1 +
 .../storage/inflater/CompressionChannel.java       |  6 +-
 .../org/apache/sis/storage/geotiff/Reader.java     |  6 +-
 .../org/apache/sis/internal/netcdf/FeatureSet.java |  2 +
 .../apache/sis/storage/netcdf/MetadataReader.java  |  2 +
 .../sis/internal/storage/StoreUtilities.java       |  2 +
 .../internal/storage/io/FileCacheByteChannel.java  |  3 +-
 .../internal/storage/io/MemoryDataTransfer.java    |  4 +-
 .../internal/storage/io/RewindableLineReader.java  |  7 +-
 .../org/apache/sis/storage/AbstractResource.java   | 12 +--
 .../org/apache/sis/storage/ProbeInputStream.java   |  2 +-
 .../java/org/apache/sis/storage/ProbeReader.java   |  2 +-
 .../org/apache/sis/storage/StorageConnector.java   | 31 +++++---
 .../apache/sis/test/storage/SubsampledImage.java   |  4 +-
 91 files changed, 366 insertions(+), 197 deletions(-)
 create mode 100644 core/sis-utility/src/main/java/org/apache/sis/internal/system/Configuration.java
 delete mode 100644 core/sis-utility/src/main/java/org/apache/sis/util/Configuration.java


[sis] 02/03: Replace some
by

or

headings. This is a change in javadoc formatting only.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 47e5b431413ce000a1d752da5d32097cca481629
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Sun Jan 15 16:16:27 2023 +0100

    Replace some <div> by <h2> or <h4> headings.
    This is a change in javadoc formatting only.
---
 .../java/org/apache/sis/internal/gui/control/ColorCell.java  |  6 +++---
 .../main/java/org/apache/sis/metadata/AbstractMetadata.java  |  4 ++--
 .../java/org/apache/sis/metadata/StandardImplementation.java |  4 ++--
 .../main/java/org/apache/sis/metadata/TreeNodeChildren.java  |  4 ++--
 .../src/main/java/org/apache/sis/xml/MarshallerPool.java     |  4 ++--
 .../src/main/java/org/apache/sis/xml/NilObjectHandler.java   |  4 ++--
 .../src/main/java/org/apache/sis/xml/NilReason.java          |  4 ++--
 core/sis-metadata/src/main/java/org/apache/sis/xml/XML.java  |  4 ++--
 .../main/java/org/apache/sis/geometry/AbstractEnvelope.java  |  4 ++--
 .../java/org/apache/sis/geometry/GeneralDirectPosition.java  |  6 +++---
 .../org/apache/sis/internal/referencing/DeprecatedCode.java  |  9 ++++-----
 .../org/apache/sis/internal/referencing/DeprecatedName.java  |  9 ++++-----
 .../sis/internal/referencing/provider/Geographic3Dto2D.java  |  6 +++---
 .../sis/internal/referencing/provider/VerticalOffset.java    |  6 +++---
 .../src/main/java/org/apache/sis/io/wkt/WKTDictionary.java   |  6 +++---
 .../java/org/apache/sis/parameter/ParameterValueList.java    |  6 +++---
 .../src/main/java/org/apache/sis/parameter/Verifier.java     |  4 ++--
 .../java/org/apache/sis/referencing/ImmutableIdentifier.java |  4 ++--
 .../apache/sis/referencing/crs/DefaultEngineeringCRS.java    |  4 ++--
 .../org/apache/sis/referencing/datum/DatumShiftGrid.java     |  6 +++---
 .../sis/referencing/factory/MultiAuthoritiesFactory.java     |  5 ++---
 .../apache/sis/referencing/factory/sql/EPSGCodeFinder.java   |  3 +--
 .../operation/builder/LinearTransformBuilder.java            |  6 +++---
 .../sis/referencing/operation/projection/Mercator.java       |  3 +--
 .../sis/referencing/operation/projection/Orthographic.java   |  4 ++--
 .../operation/transform/ConcatenatedTransform.java           |  4 ++--
 .../main/java/org/apache/sis/internal/jdk17/HexFormat.java   |  6 +++---
 .../src/main/java/org/apache/sis/math/Vector.java            | 10 ++++++----
 .../src/main/java/org/apache/sis/measure/UnitRegistry.java   |  6 +++---
 .../src/main/java/org/apache/sis/util/Locales.java           |  4 ++--
 .../src/main/java/org/apache/sis/util/collection/Cache.java  |  8 ++++----
 .../java/org/apache/sis/util/collection/CodeListSet.java     |  4 ++--
 .../org/apache/sis/util/collection/DefaultTreeTable.java     |  9 +++++----
 .../org/apache/sis/util/collection/FrequencySortedSet.java   |  6 +++---
 .../java/org/apache/sis/util/collection/TreeNodeList.java    |  4 ++--
 .../java/org/apache/sis/util/logging/MonolineFormatter.java  |  8 ++++----
 .../src/main/java/org/apache/sis/storage/geotiff/Reader.java |  6 +++---
 .../apache/sis/internal/storage/io/MemoryDataTransfer.java   |  4 ++--
 .../main/java/org/apache/sis/storage/AbstractResource.java   | 12 ++++++------
 .../java/org/apache/sis/test/storage/SubsampledImage.java    |  4 ++--
 40 files changed, 109 insertions(+), 111 deletions(-)

diff --git a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/control/ColorCell.java b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/control/ColorCell.java
index bccd53bd73..ccb8283410 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/control/ColorCell.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/control/ColorCell.java
@@ -263,12 +263,12 @@ final class ColorCell<S> extends TableCell<S,ColorRamp> implements EventHandler<
      * or because this cell is now used for a new {@code <S>} instance. This method is invoked when the
      * row value (of type {@code <S>}) is modified.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * this method should not invoke {@link #setGraphic(Node)} if the current graphic is a {@link ComboBoxBase}
+     * <h4>Implementation note</h4>
+     * This method should not invoke {@link #setGraphic(Node)} if the current graphic is a {@link ComboBoxBase}
      * (the parent of {@link ComboBox} and {@link ColorPicker}) because this method may be invoked at any time,
      * including during the execution of {@link #startEdit()} or {@link #commitEdit(Object)} methods.
      * Adding or removing {@link ComboBoxBase} in this method cause problems with focus system.
-     * In particular we must be sure to remove {@link ColorPicker} only after it has lost focus.</div>
+     * In particular we must be sure to remove {@link ColorPicker} only after it has lost focus.
      *
      * @param  colors  the new object to show as a color or gradient in this cell.
      * @param  empty   {@code true} if this method is invoked for creating an empty cell.
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java
index dfbea66072..cea810698f 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/AbstractMetadata.java
@@ -308,10 +308,10 @@ public abstract class AbstractMetadata implements LenientComparable, Emptiable {
      * the {@link java.util.Set#hashCode()} one and ensures that the hash code value is
      * insensitive to the ordering of properties.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * This method does not cache the value because current implementation has no notification mechanism
      * for tracking changes in children properties. If this metadata is known to be immutable,
-     * then subclasses may consider caching the hash code value if performance is important.</div>
+     * then subclasses may consider caching the hash code value if performance is important.
      *
      * @see MetadataStandard#hashCode(Object)
      */
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
index c05c6d7d7e..33244739d1 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
@@ -60,12 +60,12 @@ final class StandardImplementation extends MetadataStandard {
     /**
      * Implementations for a given interface, computed when first needed then cached.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * In the particular case of {@code Class} keys, {@code IdentityHashMap} and {@code HashMap} have identical
      * behavior since {@code Class} is final and does not override the {@code equals(Object)} and {@code hashCode()}
      * methods. The {@code IdentityHashMap} Javadoc claims that it is faster than the regular {@code HashMap}.
      * But maybe the most interesting property is that it allocates less objects since {@code IdentityHashMap}
-     * implementation doesn't need the chain of objects created by {@code HashMap}.</div>
+     * implementation doesn't need the chain of objects created by {@code HashMap}.
      */
     private final transient Map<Class<?>,Class<?>> implementations;     // written by reflection on deserialization.
 
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java
index b2d06be34b..fb9bd58784 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/TreeNodeChildren.java
@@ -226,9 +226,9 @@ final class TreeNodeChildren extends AbstractCollection<TreeTable.Node> {
      * Returns {@code true} if the type at the given index is a collection or a map.
      * The given {@code index} is relative to the {@link #accessor} indexing, <strong>not</strong> to this collection.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * We do not test {@code (value instanceof Collection)} because the value could be any user's implementation.
-     * Nothing prevent users from implementing the collection interface even for singleton elements if they wish.</div>
+     * Nothing prevent users from implementing the collection interface even for singleton elements if they wish.
      *
      * @param  index  the index in the accessor (<em>not</em> the index in this collection).
      * @return {@code true} if the value at the given index is a collection.
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/MarshallerPool.java b/core/sis-metadata/src/main/java/org/apache/sis/xml/MarshallerPool.java
index 4d43c14c74..a6867b5a2b 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/xml/MarshallerPool.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/MarshallerPool.java
@@ -93,11 +93,11 @@ public class MarshallerPool {
      * The provider of {@code AdapterReplacement} instances.
      * <strong>Every usage of this service loader must be synchronized.</strong>
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * Each {@code MarshallerPool} has its own service loader instance rather than using a system-wide instance
      * because the {@link ClassLoader} used by the service loader is the <cite>context class loader</cite>,
      * which depends on the thread that created the pool. So two pools in two different applications could have
-     * two different set of replacements.</div>
+     * two different set of replacements.
      */
     private final ServiceLoader<AdapterReplacement> replacements;
 
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/NilObjectHandler.java b/core/sis-metadata/src/main/java/org/apache/sis/xml/NilObjectHandler.java
index 673d7991c1..9a8711b459 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/xml/NilObjectHandler.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/NilObjectHandler.java
@@ -43,9 +43,9 @@ import org.apache.sis.internal.jaxb.ModifiableIdentifierMap;
  * definition were found for a XML element identified by {@code xlink} or {@code uuidref}
  * attributes.
  *
- * <div class="note"><b>Implementation note:</b>
+ * <h4>Implementation note</h4>
  * The same handler could be used for every proxy having the same XLink.
- * For now, it doesn't seem worth to cache the handlers.</div>
+ * For now, it doesn't seem worth to cache the handlers.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 1.3
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/NilReason.java b/core/sis-metadata/src/main/java/org/apache/sis/xml/NilReason.java
index 9ac9b410da..20fb04e72e 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/xml/NilReason.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/NilReason.java
@@ -436,11 +436,11 @@ public final class NilReason implements Serializable {
      * <p><b>Reminder:</b> If more special cases are added, do not forget to update the {@link #mayBeNil(Object)}
      * method and to update the {@link #createNilObject(Class)} and {@link #forObject(Object)} javadoc.</p>
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * There is no special case for {@link Character} because Java {@code char}s are not really full Unicode characters.
      * They are parts of UTF-16 encoding instead. If there is a need to represent a single Unicode character, we should
      * probably still use a {@link String} where the string contain 1 or 2 Java characters. This may also facilitate the
-     * encoding in the XML files, since many files use another encoding than UTF-16 anyway.</div>
+     * encoding in the XML files, since many files use another encoding than UTF-16 anyway.
      *
      * @throws IllegalArgumentException if the given type is not a supported type.
      */
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/XML.java b/core/sis-metadata/src/main/java/org/apache/sis/xml/XML.java
index acbef4e9ef..62710a5679 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/xml/XML.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/XML.java
@@ -403,11 +403,11 @@ public final class XML extends Static {
     /**
      * Returns the default (un)marshaller pool used by all methods in this class.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * Current implementation uses the double-check idiom. This is usually a deprecated practice
      * (the recommended alterative is to use static class initialization), but in this particular
      * case the field may be reset to {@code null} if modules are loaded or unloaded by a container,
-     * so static class initialization would be a little bit too rigid.</div>
+     * so static class initialization would be a little bit too rigid.
      */
     @SuppressWarnings("DoubleCheckedLocking")
     private static MarshallerPool getPool() throws JAXBException {
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java b/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
index 176be0fbf6..afd4ee9d8c 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/geometry/AbstractEnvelope.java
@@ -1117,9 +1117,9 @@ public abstract class AbstractEnvelope extends FormattableObject implements Enve
      * Returns {@code true} if the specified object is an envelope of the same class
      * with equals coordinates and {@linkplain #getCoordinateReferenceSystem() CRS}.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * This implementation requires that the provided {@code object} argument is of the same class than this envelope.
-     * We do not relax this rule since not every implementations in the SIS code base follow the same contract.</div>
+     * We do not relax this rule since not every implementations in the SIS code base follow the same contract.
      *
      * @param  object  the object to compare with this envelope.
      * @return {@code true} if the given object is equal to this envelope.
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java b/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
index bfefda5417..06cdc409b0 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralDirectPosition.java
@@ -110,10 +110,10 @@ public class GeneralDirectPosition extends AbstractDirectPosition implements Ser
      * This constructor assigns the given array directly (without clone) to the {@link #coordinates} field.
      * Consequently, callers shall not recycle the same array for creating many instances.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * the array is not cloned because this is usually not needed, especially in the context of variable
+     * <h4>Implementation notes</h4>
+     * The array is not cloned because this is usually not needed, especially in the context of variable
      * argument lengths since the array is often created implicitly. Furthermore, the {@link #coordinates}
-     * field is public, so cloning the array would not protect the state of this object anyway.</div>
+     * field is public, so cloning the array would not protect the state of this object anyway.
      *
      * <p><b>Caution:</b> if only one number is specified, make sure that the number type is {@code double},
      * {@code float} or {@code long} otherwise the {@link #GeneralDirectPosition(int)} constructor would be
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedCode.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedCode.java
index 1d3fa31deb..ead2748c28 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedCode.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedCode.java
@@ -26,11 +26,10 @@ import org.apache.sis.util.Deprecable;
  * An identifier which should not be used anymore.
  * This is used mostly for deprecated EPSG codes.
  *
- * <div class="note"><b>Implementation note:</b>
- * this class opportunistically recycles the {@linkplain #getDescription() description} property into a
- * {@linkplain #getRemarks() remarks} property. This is a lazy way to inherit {@link #equals(Object)}
- * and {@link #hashCode()} implementations without adding code in this class for taking in account a
- * new field.</div>
+ * <h2>Implementation note</h2>
+ * This class opportunistically recycles the {@linkplain #getDescription() description} property into a
+ * {@linkplain #getRemarks() remarks} property. This is a lazy way to inherit {@link #equals(Object)} and
+ * {@link #hashCode()} implementations without adding code in this class for taking in account a new field.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.7
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedName.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedName.java
index ba55c48ec1..d95b4bf7f0 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedName.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DeprecatedName.java
@@ -26,11 +26,10 @@ import org.apache.sis.util.Deprecable;
  * A deprecated name.
  * This is used mostly for names which were used in legacy versions of the EPSG database.
  *
- * <div class="note"><b>Implementation note:</b>
- * this class opportunistically recycles the {@linkplain #getDescription() description} property into a
- * {@linkplain #getRemarks() remarks} property. This is a lazy way to inherit {@link #equals(Object)}
- * and {@link #hashCode()} implementations without adding code in this class for taking in account a
- * new field.</div>
+ * <h2>Implementation note</h2>
+ * This class opportunistically recycles the {@linkplain #getDescription() description} property into a
+ * {@linkplain #getRemarks() remarks} property. This is a lazy way to inherit {@link #equals(Object)} and
+ * {@link #hashCode()} implementations without adding code in this class for taking in account a new field.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.7
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Geographic3Dto2D.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Geographic3Dto2D.java
index beb18aada1..2e17b121e5 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Geographic3Dto2D.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Geographic3Dto2D.java
@@ -106,15 +106,15 @@ public final class Geographic3Dto2D extends GeographicRedimension {
     /**
      * Returns the transform.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * creating a transform that drop a dimension is trivial. We even have a helper method for that:
+     * <h4>Implementation note</h4>
+     * Creating a transform that drop a dimension is trivial. We even have a helper method for that:
      * {@link Matrices#createDimensionSelect}  The difficulty is that the inverse of that transform
      * will set the height to NaN, while we want zero. The trick is to first create the transform for
      * the inverse transform with the zero that we want, then get the inverse of that inverse transform.
      * The transform that we get will remember where it come from (its inverse).
      *
      * <p>This work with SIS implementation, but is not guaranteed to work with other implementations.
-     * For that reason, this method does not use the given {@code factory}.</p></div>
+     * For that reason, this method does not use the given {@code factory}.</p>
      *
      * @param  factory  ignored (can be null).
      * @param  values   ignored.
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/VerticalOffset.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/VerticalOffset.java
index 511e330232..be98796b7f 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/VerticalOffset.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/VerticalOffset.java
@@ -99,11 +99,11 @@ public final class VerticalOffset extends GeodeticOperation {
      * this method detects that the target axis is oriented toward down. This orientation is detected by a
      * negative sign for the <var>m₀₀</var> coefficient in the given 2×2 affine transform matrix.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * for now we define this method as a static one because it is the only special case handled by
+     * <h4>Implementation note</h4>
+     * For now we define this method as a static one because it is the only special case handled by
      * {@code DefaultMathTransformFactory}. But if there is more special cases in a future SIS version,
      * then we should make this method non-static and declare an overrideable {@code postCreate} method
-     * in {@link AbstractProvider} instead.</div>
+     * in {@link AbstractProvider} instead.
      *
      * @param  parameterized  the transform created by {@code createMathTransform(…)}.
      * @param  after  the matrix for the operation to be concatenated after {@code parameterized}.
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/WKTDictionary.java b/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/WKTDictionary.java
index 421633791a..17b4eb2193 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/WKTDictionary.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/WKTDictionary.java
@@ -172,11 +172,11 @@ public class WKTDictionary extends GeodeticAuthorityFactory {
      * All {@link #parser} usages after {@code WKTDictionary} construction shall be synchronized by
      * the {@link ReadWriteLock#writeLock()}.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * we manage the locks ourselves instead of using a {@link java.util.concurrent.ConcurrentHashMap}
+     * <h4>Implementation note</h4>
+     * We manage the locks ourselves instead of using a {@link java.util.concurrent.ConcurrentHashMap}
      * because if a {@link #definitions} value needs to be computed, then we need to block all other
      * threads anyway since {@link #parser} is not thread-safe. Consequently, the high concurrency
-     * capability provided by {@code ConcurrentHashMap} does not help us in this case.</div>
+     * capability provided by {@code ConcurrentHashMap} does not help us in this case.
      */
     private final ReadWriteLock lock;
 
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java b/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
index de4c7735b5..b7abe02409 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
@@ -43,11 +43,11 @@ import org.apache.sis.internal.referencing.Resources;
  * This class performs checks on the parameter values to be added or removed.
  * This implementation supports {@code set(…)}, {@code add(…)} and {@code remove(…)} operations.
  *
- * <div class="note"><b>Implementation note:</b>
- * this class reproduces some {@link java.util.ArrayList} functionalities.
+ * <h4>Implementation note</h4>
+ * This class reproduces some {@link java.util.ArrayList} functionalities.
  * However, we do <strong>not</strong> extend {@code ArrayList} because we really need the default method
  * implementations provided by {@code AbstractList} — the optimizations performed by {@code ArrayList}
- * are not suitable here.</div>
+ * are not suitable here.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @version 0.4
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java b/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java
index d611cfd86e..904211486c 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java
@@ -284,10 +284,10 @@ final class Verifier {
      * Same as {@link #ensureValidValue(Class, Set, Range, Object)}, used as a fallback when
      * the descriptor is not an instance of {@link DefaultParameterDescriptor}.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * At the difference of {@code ensureValidValue(…, Range, …)}, this method does not need to verify array elements
      * because the type returned by {@link ParameterDescriptor#getMinimumValue()} and {@code getMaximumValue()}
-     * methods (namely {@code Comparable<T>}) does not allow usage with arrays.</div>
+     * methods (namely {@code Comparable<T>}) does not allow usage with arrays.
      *
      * @param convertedValue  the value <em>converted to the units specified by the descriptor</em>.
      *        This is not necessarily the user-provided value.
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/ImmutableIdentifier.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/ImmutableIdentifier.java
index 1038861c67..bbb7b027fc 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/ImmutableIdentifier.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/ImmutableIdentifier.java
@@ -535,9 +535,9 @@ public class ImmutableIdentifier extends FormattableObject implements Identifier
     /**
      * Appends the given code or version number as an integer if possible, or as a text otherwise.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * ISO 19162 specifies "number or text". In Apache SIS, we restrict the numbers to integers
-     * because handling version numbers like "8.2" as floating point numbers can be confusing.</div>
+     * because handling version numbers like "8.2" as floating point numbers can be confusing.
      */
     private static void appendCode(final Formatter formatter, final String text) {
         if (text != null) {
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
index ff0d0f48e1..fae6508915 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultEngineeringCRS.java
@@ -293,7 +293,7 @@ public class DefaultEngineeringCRS extends AbstractCRS implements EngineeringCRS
      * Used by JAXB only (invoked by reflection).
      * Only one of {@code getFooCS()} methods can return a non-null value.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * The usual way to handle {@code <xs:choice>} with JAXB is to annotate a single method like below:
      *
      * {@snippet lang="java" :
@@ -313,7 +313,7 @@ public class DefaultEngineeringCRS extends AbstractCRS implements EngineeringCRS
      * }
      *
      * However, our attempts to apply this approach worked for {@code DefaultParameterValue} but not for this class:
-     * for an unknown reason, the unmarshalled CS object is empty.</div>
+     * for an unknown reason, the unmarshalled CS object is empty.
      *
      * @see <a href="http://issues.apache.org/jira/browse/SIS-166">SIS-166</a>
      */
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java
index f5b5f96883..c5f66c795f 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java
@@ -859,9 +859,9 @@ public abstract class DatumShiftGrid<C extends Quantity<C>, T extends Quantity<T
      * The given {@code parameters} must have the descriptor returned by {@link #getParameterDescriptors()}.
      * The matrices, tensors or file names are stored in the given {@code parameters} instance.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * this method is invoked by {@link org.apache.sis.referencing.operation.transform.InterpolatedTransform}
-     * and other transforms for initializing the values of their parameter group.</div>
+     * <h4>Implementation note</h4>
+     * This method is invoked by {@link org.apache.sis.referencing.operation.transform.InterpolatedTransform}
+     * and other transforms for initializing the values of their parameter group.
      *
      * @param  parameters  the parameter group where to set the values.
      *
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
index d0ad0629dd..f6f47c917c 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
@@ -489,9 +489,8 @@ public class MultiAuthoritiesFactory extends GeodeticAuthorityFactory implements
     /**
      * Returns the code spaces of all factories given to the constructor.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * the current implementation may be relatively costly since it implies instantiation of all factories.
-     * </div>
+     * <h4>Performance note</h4>
+     * The current implementation may be relatively costly because it implies instantiation of all factories.
      *
      * @return the code spaces of all factories.
      */
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGCodeFinder.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGCodeFinder.java
index 94f045c0fc..6d664c600e 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGCodeFinder.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGCodeFinder.java
@@ -110,14 +110,13 @@ final class EPSGCodeFinder extends IdentifiedObjectFinder {
      * Returns a description of the condition to put in a {@code WHERE} clause for an object having
      * the given dependency.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * The {@code super.find(…)} method performs a check (not documented in public API) for detecting
      * when it is invoked recursively, which is the case here. Consequently, the {@code super.find(…)}
      * behavior below is slightly different than usual: since invoked recursively, {@code super.find(…)}
      * checks the cache of the {@link ConcurrentAuthorityFactory} wrapper. If found, the dependency will
      * also be stored in the cache. This is desirable because this method may be invoked (indirectly) in
      * a loop for many CRS objects sharing the same {@link CoordinateSystem} or {@link Datum} dependencies.
-     * </div>
      *
      * @param  column      column in the SQL query containing EPSG codes of dependency.
      * @param  type        GeoAPI interface implemented by the dependency to search.
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java
index 51324255bb..2352825171 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LinearTransformBuilder.java
@@ -128,11 +128,11 @@ public class LinearTransformBuilder extends TransformBuilder {
      * Example: {x[], y[], z[]}.
      * This is {@code null} if not yet specified.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * we could use a flat array with (x₀, y₀), (x₁, y₁), (x₂, y₂), <i>etc.</i> coordinate tuples instead.
+     * <h4>Implementation note</h4>
+     * We could use a flat array with (x₀, y₀), (x₁, y₁), (x₂, y₂), <i>etc.</i> coordinate tuples instead.
      * Such flat array would be more convenient for some coordinate conversions with {@link MathTransform}.
      * But using array of arrays is more convenient for other calculations working on one dimension at time,
-     * make data more local for CPU, and also allows handling of more points.</div>
+     * make data more local for CPU, and also allows handling of more points.
      */
     private double[][] targets;
 
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
index 3e0a60247f..add9caf444 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
@@ -492,7 +492,7 @@ subst:  if (variant.spherical || (eccentricity == 0 && getClass() == Mercator.cl
     /**
      * Provides the transform equations for the spherical case of the Mercator projection.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * this class contains an explicit check for latitude values at a pole. If floating point arithmetic had infinite
      * precision, such checks would not be necessary since the formulas lead naturally to infinite values at poles,
      * which is the correct answer. In practice the infinite value emerges by itself at only one pole, and the other
@@ -506,7 +506,6 @@ subst:  if (variant.spherical || (eccentricity == 0 && getClass() == Mercator.cl
      *       other values we could let the math do their "natural" work.</li>
      *   <li>For φ = -π/2 our arithmetic already produces negative infinity.</li>
      * </ul>
-     * </div>
      *
      * @author  Martin Desruisseaux (MPO, IRD, Geomatys)
      * @author  Rueben Schulz (UBC)
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Orthographic.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Orthographic.java
index 459fb5bc87..44806e3b26 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Orthographic.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Orthographic.java
@@ -166,10 +166,10 @@ public class Orthographic extends NormalizedProjection {
      * Implementation of {@link #transform(double[], int, double[], int, boolean)}
      * with possibility to recycle an existing matrix instance.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * in other map projections, we use a different class for ellipsoidal formulas.
      * But the orthographic projection is a bit different; for this one it is more
-     * convenient to use {@code if} statements.</div>
+     * convenient to use {@code if} statements.
      *
      * @param  derivative  where to store the Jacobian matrix, or {@code null} if none.
      *         If this matrix is an {@link Inverter} instance, we take that as a flag
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
index f1f0c1482c..f051f35c9c 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
@@ -130,10 +130,10 @@ class ConcatenatedTransform extends AbstractMathTransform implements Serializabl
      * Likewise if the concatenation result works with one-dimensional input and output points,
      * then the returned transform will implement {@link MathTransform1D}.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * {@code ConcatenatedTransform} implementations are available in two versions: direct and non-direct.
      * The "non-direct" versions use an intermediate buffer when performing transformations; they are slower
-     * and consume more memory. They are used only as a fallback when a "direct" version cannot be created.</div>
+     * and consume more memory. They are used only as a fallback when a "direct" version cannot be created.
      *
      * @param  tr1      the first math transform.
      * @param  tr2      the second math transform.
diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/jdk17/HexFormat.java b/core/sis-utility/src/main/java/org/apache/sis/internal/jdk17/HexFormat.java
index c2d878a977..7b34e540c5 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/internal/jdk17/HexFormat.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/internal/jdk17/HexFormat.java
@@ -59,9 +59,9 @@ public final class HexFormat {
      * Returns the numerical value of the given hexadecimal digit.
      * The hexadecimal digit can be the decimal digits 0 to 9, or the letters A to F ignoring case.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * we do not use {@link Character#digit(char, int)} because that method handled a large
-     * range of Unicode characters, which is a wider scope than what is intended here.</div>
+     * <h4>Implementation note</h4>
+     * We do not use {@link Character#digit(char, int)} because that method handled a large
+     * range of Unicode characters, which is a wider scope than what is intended here.
      *
      * @param  c  the hexadecimal digit.
      * @throws NumberFormatException if the given character is not a hexadecimal digit.
diff --git a/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java b/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java
index d53a421211..923184a6c0 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java
@@ -874,9 +874,10 @@ search:     for (;;) {
      * The returned view will contain the values from index {@code lower} inclusive to
      * {@code upper} exclusive.
      *
-     * <div class="note"><b>Implementation note:</b> this method delegates its work
+     * <h4>Implementation note</h4>
+     * This method delegates its work
      * <code>{@linkplain #subSampling(int,int,int) subSampling}(lower, 1, upper - lower)</code>.
-     * This method is declared final in order to force subclasses to override {@code subSampling(…)} instead.</div>
+     * This method is declared final in order to force subclasses to override {@code subSampling(…)} instead.
      *
      * @param  lower  index of the first value to be included in the returned view.
      * @param  upper  index after the last value to be included in the returned view.
@@ -1342,9 +1343,10 @@ search:     for (;;) {
     /**
      * Returns a view which contains the values of this vector in reverse order.
      *
-     * <div class="note"><b>Implementation note:</b> this method delegates its work
+     * <h4>Implementation note</h4>
+     * This method delegates its work
      * to <code>{@linkplain #subSampling(int,int,int) subSampling}(size-1, -1, {@linkplain #size() size})</code>.
-     * This method is declared final in order to force subclasses to override {@code subSampling(…)} instead.</div>
+     * This method is declared final in order to force subclasses to override {@code subSampling(…)} instead.
      *
      * @return the vector values in reverse order.
      */
diff --git a/core/sis-utility/src/main/java/org/apache/sis/measure/UnitRegistry.java b/core/sis-utility/src/main/java/org/apache/sis/measure/UnitRegistry.java
index 1fed3d861f..9165c05d6a 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/measure/UnitRegistry.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/measure/UnitRegistry.java
@@ -109,10 +109,10 @@ final class UnitRegistry implements SystemOfUnits, Serializable {
      * Values are stored by weak references and garbage collected when no longer used.
      * Key and value types are the same than the one described in {@link #HARD_CODED}.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * we separate hard-coded values from user-defined values because the amount of hard-coded values is relatively
+     * <h4>Implementation note</h4>
+     * We separate hard-coded values from user-defined values because the amount of hard-coded values is relatively
      * large, using weak references for them is useless, and most applications will not define any custom values.
-     * This map will typically stay empty.</div>
+     * This map will typically stay empty.
      */
     private static final WeakValueHashMap<Object,Object> USER_DEFINED = new WeakValueHashMap<>(Object.class);
 
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java b/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java
index cea1eeab26..e5024abba5 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java
@@ -96,11 +96,11 @@ public final class Locales extends Static {
      * for compactness (conversions is done by {@link #toNumber(String, short)}) and for avoiding references
      * to {@code String} instances.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * OpenJDK 8 implementation computes the 3-letters codes on-the-fly instead of holding references
      * to pre-existing strings. If we were holding string references here, we would prevent the garbage
      * collector to collect the strings for all languages and countries. This would probably be a waste
-     * of resources.</div>
+     * of resources.
      */
     private static final short[] ISO3, ISO2;
     static {
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java b/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java
index c0847a4781..40daebdb49 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java
@@ -1046,10 +1046,10 @@ public class Cache<K,V> extends AbstractMap<K,V> implements ConcurrentMap<K,V> {
         /**
          * Do nothing (except checking for programming error), since we don't hold any lock.
          *
-         * <div class="note"><b>Implementation note:</b>
+         * <h4>Implementation note</h4>
          * An alternative would have been to store the result in the map anyway.
          * But doing so is unsafe because we have no lock; we have no guarantee that nothing
-         * has happened in another thread between {@code peek} and {@code putAndUnlock}.</div>
+         * has happened in another thread between {@code peek} and {@code putAndUnlock}.
          */
         @Override
         public void putAndUnlock(final V result) throws IllegalStateException {
@@ -1161,10 +1161,10 @@ public class Cache<K,V> extends AbstractMap<K,V> implements ConcurrentMap<K,V> {
             /**
              * Do nothing (except checking for programming error), since we don't hold any lock.
              *
-             * <div class="note"><b>Implementation note:</b>
+             * <h4>Implementation note</h4>
              * An alternative would have been to store the result in the map anyway.
              * But doing so is unsafe because we have no lock; we have no guarantee that nothing
-             * has happened in another thread between {@code peek} and {@code putAndUnlock}.</div>
+             * has happened in another thread between {@code peek} and {@code putAndUnlock}.
              */
             @Override
             public void putAndUnlock(final V result) throws IllegalStateException {
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java b/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java
index 43aa408a9f..f8e4f731cf 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/collection/CodeListSet.java
@@ -91,11 +91,11 @@ public class CodeListSet<E extends CodeList<E>> extends AbstractSet<E>
      * if none. This is very rarely needed, but we need this field in case a code list has
      * more than 64 elements.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * The standard {@link java.util.EnumSet} class uses different implementations depending on whether
      * the enumeration contains more or less than 64 elements. We cannot apply the same strategy for
      * {@code CodeListSet}, because new code list elements can be created at runtime. Consequently, this
-     * implementation needs to be able to growth its capacity.</div>
+     * implementation needs to be able to growth its capacity.
      */
     private BitSet supplementary;
 
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java b/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
index 0059575199..f46178efd1 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/collection/DefaultTreeTable.java
@@ -97,10 +97,10 @@ public class DefaultTreeTable implements TreeTable, Cloneable, Serializable {
      * implementation for storing values in a single flat array. After creation, this
      * map shall be read-only since many {@code Node} instances may share it.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * This field and the {@link #columns} field could be computed from each other.
      * But we serialize this field anyway because children nodes will typically hold
-     * a reference to that map, and we want to preserve the references tree.</div>
+     * a reference to that map, and we want to preserve the references tree.
      *
      * @see DefaultTreeTable.Node#columnIndices
      */
@@ -684,12 +684,13 @@ public class DefaultTreeTable implements TreeTable, Cloneable, Serializable {
          * parent}. This method can be used for determining if two branches of a same tree or of two
          * different trees are identical.
          *
-         * <div class="note"><b>Implementation note:</b> This method ignores the parent because:
+         * <h4>Implementation note</h4>
+         * This method ignores the parent because:
          * <ul>
          *   <li>When comparing the children recursively, comparing the parents would cause infinite recursivity.</li>
          *   <li>For consistency with the {@link #clone()} method, which cannot clone the parent.</li>
          *   <li>For making possible to compare branches instead of only whole trees.</li>
-         * </ul></div>
+         * </ul>
          *
          * @param  other  the object to compare with this node.
          * @return {@code true} if the two objects are equal, ignoring the parent node.
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/collection/FrequencySortedSet.java b/core/sis-utility/src/main/java/org/apache/sis/util/collection/FrequencySortedSet.java
index fae1cbd41d..4e8a86aaa0 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/collection/FrequencySortedSet.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/collection/FrequencySortedSet.java
@@ -71,13 +71,13 @@ public class FrequencySortedSet<E> extends AbstractSet<E> implements SortedSet<E
      * The intent is to store negative numbers in the {@link #count} map if this {@code FrequencySortedSet}
      * has been created for reverse order.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * we could have used {@code +1} and {@code -1} for the usual and reverse order respectively, and store the
+     * <h4>Implementation note</h4>
+     * We could have used {@code +1} and {@code -1} for the usual and reverse order respectively, and store the
      * multiplication result {@code n * order} in the {@link #count} map. We rather use XOR for two reasons:
      * first, XOR is a simpler operation for the CPU than multiplication. Second, XOR guarantees us that all
      * negative numbers can be made positive in {@link #frequencies()}, by applying again {@code n ^ order}.
      * By contrast, the multiplication approach (or just the {@code -n} negation) would fail to convert
-     * {@link Integer#MIN_VALUE}.</div>
+     * {@link Integer#MIN_VALUE}.
      */
     private final int order;
 
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java b/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
index d9821689a2..d10b6fadbe 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/collection/TreeNodeList.java
@@ -52,10 +52,10 @@ import org.apache.sis.util.resources.Errors;
  *       to {@code TreeNodeList} (we need the slower path implemented in {@code AbstractList}).</li>
  * </ul>
  *
- * <div class="note"><b>Implementation note:</b>
+ * <h3>Note on serialization</h3>
  * Being serializable may seem contradictory with the non-cloneable requirement.
  * But serializing {@code TreeNodeList} will also serialize the parent, thus
- * creating new copy on deserialization. So the parents should not be mixed.</div>
+ * creating new copy on deserialization. So the parents should not be mixed.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.3
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java b/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
index 1b13f53304..7e0cc6056d 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
@@ -970,9 +970,9 @@ loop:   for (int i=0; ; i++) {
      *       root logger.</li>
      * </ul>
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Limitations</h4>
      * The current implementation does not check for duplicated {@code ConsoleHandler} instances,
-     * and does not check if any child logger has a {@code ConsoleHandler}.</div>
+     * and does not check if any child logger has a {@code ConsoleHandler}.
      *
      * @return the new or existing {@code MonolineFormatter}. The formatter output can be configured
      *         using the {@link #setTimeFormat(String)} and {@link #setSourceFormat(String)} methods.
@@ -1006,9 +1006,9 @@ loop:   for (int i=0; ; i++) {
      *     </ul></li>
      * </ul>
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Limitations</h4>
      * The current implementation does not check for duplicated {@code ConsoleHandler} instances,
-     * and does not check if any child logger has a {@code ConsoleHandler}.</div>
+     * and does not check if any child logger has a {@code ConsoleHandler}.
      *
      * <h4>Specifying a log level</h4>
      * This method can opportunistically set the handler level. If the given level is non-null,
diff --git a/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java b/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
index 9ab1b56c44..6cee41a8b5 100644
--- a/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
+++ b/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
@@ -114,9 +114,9 @@ final class Reader extends GeoTIFF {
      * Entries having a value that cannot be read immediately, but instead have a pointer
      * to a value stored elsewhere in the file. Those values will be read only when needed.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * we use a {@code LinkedList} because we will perform frequent additions and removals,
-     * but no random access.</div>
+     * <h4>Implementation note</h4>
+     * We use a {@code LinkedList} because we will perform frequent additions and removals,
+     * but no random access.
      */
     private final LinkedList<DeferredEntry> deferredEntries = new LinkedList<>();
 
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/MemoryDataTransfer.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/MemoryDataTransfer.java
index 7aa0181d18..f266da4db1 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/MemoryDataTransfer.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/MemoryDataTransfer.java
@@ -34,11 +34,11 @@ import org.apache.sis.util.Classes;
 /**
  * A {@code DataTransfer} with all data in the given buffer, without channel.
  *
- * <div class="note"><b>Implementation note:</b>
+ * <h4>Implementation note</h4>
  * This class implements also an empty {@link ReadableByteChannel} as safety. When using {@link ChannelDataInput}
  * without channel, only an existing {@code Buffer} pre-filled with the data should be used. If we have a bug in
  * our reading process, the empty channel will cause an {@link java.io.EOFException} to be thrown instead of a
- * {@link NullPointerException}.</div>
+ * {@link NullPointerException}.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 1.1
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/AbstractResource.java b/storage/sis-storage/src/main/java/org/apache/sis/storage/AbstractResource.java
index 51a9cea6bb..1bbc59468f 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/AbstractResource.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/AbstractResource.java
@@ -103,9 +103,9 @@ public abstract class AbstractResource implements Resource {
      * The default implementation returns an empty value.
      * Subclasses are strongly encouraged to override if they can provide a value.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * the default implementation of {@link #createMetadata()} uses this identifier for initializing
-     * the {@code metadata/identificationInfo/citation/title} property.</div>
+     * <h4>Relationship with metadata</h4>
+     * The default implementation of {@link #createMetadata()} uses this identifier for initializing
+     * the {@code metadata/identificationInfo/citation/title} property.
      */
     @Override
     public Optional<GenericName> getIdentifier() throws DataStoreException {
@@ -117,9 +117,9 @@ public abstract class AbstractResource implements Resource {
      * of resource such as {@link FeatureSet}. But the method is provided in this base class for convenience.
      * The default implementation gives an empty value.
      *
-     * <div class="note"><b>Implementation note:</b>
-     * the default implementation of {@link #createMetadata()} uses this identifier for initializing
-     * the {@code metadata/identificationInfo/extent/geographicElement} property.</div>
+     * <h4>Implementation note</h4>
+     * The default implementation of {@link #createMetadata()} uses this identifier for initializing
+     * the {@code metadata/identificationInfo/extent/geographicElement} property.
      *
      * @return the spatiotemporal resource extent.
      * @throws DataStoreException if an error occurred while reading or computing the envelope.
diff --git a/storage/sis-storage/src/test/java/org/apache/sis/test/storage/SubsampledImage.java b/storage/sis-storage/src/test/java/org/apache/sis/test/storage/SubsampledImage.java
index ca9d1b74fc..de18dd8de0 100644
--- a/storage/sis-storage/src/test/java/org/apache/sis/test/storage/SubsampledImage.java
+++ b/storage/sis-storage/src/test/java/org/apache/sis/test/storage/SubsampledImage.java
@@ -241,13 +241,13 @@ final class SubsampledImage extends PlanarImage {
      * Computes {@code (coordinate - offset) / subsampling} rounded toward 0.
      * The subsampling offset is assumed 0 in current version.
      *
-     * <div class="note"><b>Implementation note:</b>
+     * <h4>Implementation note</h4>
      * in principle we should subtract the <var>subsampling offset</var>. However, that offset is
      * zero in the context of {@link CoverageReadConsistency} test, because coordinates (0,0) of
      * {@linkplain #source} image is the first pixel in the Area Of Interest specified by user,
      * so there are no more offsets at this stage. Note that we are talking about offset in image
      * coordinate system, not to be confused with offset relative to the data bank
-     * (given to the {@link SampleModel} at construction time).</div>
+     * (given to the {@link SampleModel} at construction time).
      */
     private static int divInclusive(final int coordinate, final int subsampling) {
         return floorDiv(coordinate, subsampling);


[sis] 01/03: Consolidate the constants for `ByteBuffer` capacity and increase the default capacity from 8 kb to 16 kb.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c28846150343c2e5601288359fa1fa91b5c8f978
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Sun Jan 15 15:43:10 2023 +0100

    Consolidate the constants for `ByteBuffer` capacity and increase the default capacity from 8 kb to 16 kb.
---
 .../storage/inflater/CompressionChannel.java       |  6 ++++--
 .../internal/storage/io/FileCacheByteChannel.java  |  3 ++-
 .../internal/storage/io/RewindableLineReader.java  |  7 ++++--
 .../org/apache/sis/storage/ProbeInputStream.java   |  2 +-
 .../java/org/apache/sis/storage/ProbeReader.java   |  2 +-
 .../org/apache/sis/storage/StorageConnector.java   | 25 +++++++++++++---------
 6 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/storage/sis-geotiff/src/main/java/org/apache/sis/internal/storage/inflater/CompressionChannel.java b/storage/sis-geotiff/src/main/java/org/apache/sis/internal/storage/inflater/CompressionChannel.java
index 860a7aff47..bef43cb3d0 100644
--- a/storage/sis-geotiff/src/main/java/org/apache/sis/internal/storage/inflater/CompressionChannel.java
+++ b/storage/sis-geotiff/src/main/java/org/apache/sis/internal/storage/inflater/CompressionChannel.java
@@ -24,6 +24,7 @@ import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.internal.geotiff.Resources;
 import org.apache.sis.internal.storage.io.ChannelDataInput;
 import org.apache.sis.storage.event.StoreListeners;
+import org.apache.sis.storage.StorageConnector;
 
 
 /**
@@ -39,9 +40,10 @@ import org.apache.sis.storage.event.StoreListeners;
 abstract class CompressionChannel extends PixelChannel {
     /**
      * Desired size of the buffer where to temporarily copy decompressed data.
-     * The actual buffer size may be larger, but should not be smaller.
+     * The actual buffer size may become larger (but not smaller)
+     * because we try to use a multiple of scanline stride.
      */
-    private static final int BUFFER_SIZE = 4096;
+    private static final int BUFFER_SIZE = StorageConnector.DEFAULT_BUFFER_SIZE / 2;
 
     /**
      * The source of data to decompress.
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/FileCacheByteChannel.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/FileCacheByteChannel.java
index 986b804628..3234dcfd08 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/FileCacheByteChannel.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/FileCacheByteChannel.java
@@ -25,6 +25,7 @@ import java.nio.file.StandardOpenOption;
 import java.nio.channels.FileChannel;
 import java.nio.channels.SeekableByteChannel;
 import java.nio.channels.NonWritableChannelException;
+import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.internal.storage.Resources;
 import org.apache.sis.internal.system.DelayedExecutor;
 import org.apache.sis.internal.system.DelayedRunnable;
@@ -61,7 +62,7 @@ public abstract class FileCacheByteChannel implements SeekableByteChannel {
     /**
      * Size of the transfer buffer, in number of bytes.
      */
-    private static final int BUFFER_SIZE = 8 * 1024;
+    private static final int BUFFER_SIZE = StorageConnector.DEFAULT_BUFFER_SIZE;
 
     /**
      * Threshold for implementing a change of position by closing current connection and opening a new one.
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/RewindableLineReader.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/RewindableLineReader.java
index fb1fc90f60..d9d1d633ea 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/RewindableLineReader.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/RewindableLineReader.java
@@ -23,6 +23,7 @@ import java.io.LineNumberReader;
 import java.nio.charset.Charset;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.io.InvalidSeekException;
+import org.apache.sis.storage.StorageConnector;
 
 
 /**
@@ -42,9 +43,11 @@ import org.apache.sis.io.InvalidSeekException;
 @SuppressWarnings("SynchronizeOnNonFinalField")
 public final class RewindableLineReader extends LineNumberReader {
     /**
-     * Size of the buffer, in number of characters.
+     * Size of the buffer, in number of characters. The number of bytes is twice this amount.
+     * This is also the maximal "read ahead limit" that can be passed to {@link #mark(int)}
+     * without causing buffer reallocation.
      */
-    public static final int BUFFER_SIZE = 8192;
+    public static final int BUFFER_SIZE = StorageConnector.DEFAULT_BUFFER_SIZE / 2;
 
     /**
      * The input stream, or {@code null} if this reader cannot rewind anymore.
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeInputStream.java b/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeInputStream.java
index dee9603fa9..888d9a52d3 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeInputStream.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeInputStream.java
@@ -45,7 +45,7 @@ final class ProbeInputStream extends FilterInputStream {
         if (!input.markSupported()) {
             throw new DataStoreException(Resources.format(Resources.Keys.MarkNotSupported_1, owner.getStorageName()));
         }
-        input.mark(StorageConnector.DEFAULT_BUFFER_SIZE);
+        input.mark(StorageConnector.READ_AHEAD_LIMIT);
     }
 
     /**
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeReader.java b/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeReader.java
index 5f25cba743..5ecc30d27f 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeReader.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/ProbeReader.java
@@ -48,7 +48,7 @@ final class ProbeReader extends FilterReader {
         if (!input.markSupported()) {
             throw new DataStoreException(Resources.format(Resources.Keys.MarkNotSupported_1, owner.getStorageName()));
         }
-        input.mark(StorageConnector.DEFAULT_BUFFER_SIZE);
+        input.mark(StorageConnector.READ_AHEAD_LIMIT);
     }
 
     /**
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java b/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
index 9fcb237b2a..88a47baa62 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
@@ -110,17 +110,22 @@ public class StorageConnector implements Serializable {
     private static final long serialVersionUID = 2524083964906593093L;
 
     /**
-     * The default size of the {@link ByteBuffer} to be created.
+     * The default size (in bytes) of {@link ByteBuffer}s created by storage connectors.
+     * Those buffers are typically created when the specified storage object is a
+     * {@link File}, {@link Path}, {@link URL} or {@link URI}.
      * Users can override this value by providing a value for {@link OptionKey#BYTE_BUFFER}.
      *
-     * <p>This buffer capacity is also used as read-ahead limit for mark operations.
-     * The rational is to allow as many bytes as contained in buffers of default size.
-     * For increasing the chances to meet that goal, this size should be the same than
-     * {@link java.io.BufferedInputStream} default buffer size.</p>
-     *
-     * @see RewindableLineReader#BUFFER_SIZE
+     * @since 1.4
+     */
+    public static final int DEFAULT_BUFFER_SIZE = 16 * 1024;
+
+    /**
+     * The read-ahead limit for mark operations.
+     * We try to allow as many bytes as contained in buffers of default size.
+     * For increasing the chances to meet that goal, this size should be the
+     * same than {@link BufferedInputStream} default buffer size.
      */
-    static final int DEFAULT_BUFFER_SIZE = 8192;
+    static final int READ_AHEAD_LIMIT = 8 * 1024;
 
     /**
      * The minimal size of the {@link ByteBuffer} to be created. This size is used only
@@ -962,7 +967,7 @@ public class StorageConnector implements Serializable {
          */
         reset();
         if (storage instanceof InputStream) {
-            ((InputStream) storage).mark(DEFAULT_BUFFER_SIZE);
+            ((InputStream) storage).mark(READ_AHEAD_LIMIT);
         }
         if (storage instanceof ByteBuffer) {
             final ChannelDataInput asDataInput = new ChannelImageInputStream(getStorageName(), (ByteBuffer) storage);
@@ -1256,7 +1261,7 @@ public class StorageConnector implements Serializable {
             addView(Reader.class, null);                                        // Remember that there is no view.
             return null;
         }
-        input.mark(DEFAULT_BUFFER_SIZE);
+        input.mark(READ_AHEAD_LIMIT);
         final Reader in = new RewindableLineReader(input, getOption(OptionKey.ENCODING));
         addView(Reader.class, in, InputStream.class, (byte) (CLEAR_ON_RESET | CASCADE_ON_RESET));
         return in;


[sis] 03/03: Move the `Configuration` annotation to internal package. Apply the annotation on some static constants worth to know that they can be changed.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9f079c7e510e46b0dfe3f09d5db4607a93fe520f
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Sun Jan 15 19:41:49 2023 +0100

    Move the `Configuration` annotation to internal package.
    Apply the annotation on some static constants worth to know that they can be changed.
    
    https://issues.apache.org/jira/browse/SIS-86
---
 .../main/java/org/apache/sis/gui/RecentFiles.java  |  2 +
 .../org/apache/sis/gui/dataset/FeatureLoader.java  |  2 +
 .../java/org/apache/sis/gui/map/MapCanvasAWT.java  |  3 +
 .../org/apache/sis/internal/gui/LogHandler.java    |  2 +
 .../org/apache/sis/internal/gui/RecentChoices.java |  2 +
 .../org/apache/sis/coverage/SampleRangeFormat.java |  2 +
 .../java/org/apache/sis/image/ResamplingGrid.java  |  2 +
 .../sis/internal/coverage/j2d/ImageLayout.java     |  4 +
 .../sis/internal/coverage/j2d/ImageUtilities.java  |  4 +
 .../sis/internal/metadata/sql/Initializer.java     |  4 +-
 .../org/apache/sis/metadata/MetadataStandard.java  |  2 +
 .../apache/sis/metadata/sql/MetadataSource.java    |  3 +
 .../coverage/MultiResolutionCoverageLoader.java    |  2 +
 .../org/apache/sis/portrayal/CanvasContext.java    |  2 +
 .../sis/internal/referencing/Arithmetic.java       |  2 +
 .../apache/sis/internal/referencing/Formulas.java  |  8 +-
 .../referencing/PositionalAccuracyConstant.java    |  4 +
 .../main/java/org/apache/sis/io/wkt/Formatter.java |  3 +
 .../sis/referencing/GeodesicsOnEllipsoid.java      |  6 +-
 .../factory/ConcurrentAuthorityFactory.java        | 10 ++-
 .../sis/referencing/factory/ReferenceKeeper.java   |  3 +
 .../DefaultCoordinateOperationFactory.java         |  2 +
 .../operation/builder/LocalizationGridBuilder.java |  2 +
 .../operation/builder/ProjectedTransformTry.java   | 12 +--
 .../operation/matrix/GeneralMatrix.java            |  4 +
 .../operation/projection/TransverseMercator.java   |  2 +
 .../operation/transform/InterpolatedTransform.java |  3 +
 .../apache/sis/internal/system/CommonExecutor.java |  1 +
 .../apache/sis/internal/system/Configuration.java  | 91 ++++++++++++++++++++++
 .../org/apache/sis/internal/system/Supervisor.java |  6 +-
 .../org/apache/sis/internal/util/DoubleDouble.java |  4 +
 .../org/apache/sis/internal/util/Numerics.java     |  3 +
 .../src/main/java/org/apache/sis/math/Plane.java   |  2 +
 .../java/org/apache/sis/measure/AbstractUnit.java  |  2 +
 .../java/org/apache/sis/measure/UnitFormat.java    |  2 +
 .../java/org/apache/sis/setup/Configuration.java   | 11 ++-
 .../java/org/apache/sis/util/Configuration.java    | 44 -----------
 .../java/org/apache/sis/util/logging/Logging.java  |  2 +
 .../apache/sis/util/logging/MonolineFormatter.java |  7 +-
 .../apache/sis/util/logging/PerformanceLevel.java  |  7 +-
 .../sis/util/resources/IndexedResourceBundle.java  |  2 +
 ide-project/NetBeans/nbproject/genfiles.properties |  4 +-
 ide-project/NetBeans/nbproject/project.xml         |  1 +
 .../org/apache/sis/internal/netcdf/FeatureSet.java |  2 +
 .../apache/sis/storage/netcdf/MetadataReader.java  |  2 +
 .../sis/internal/storage/StoreUtilities.java       |  2 +
 .../org/apache/sis/storage/StorageConnector.java   |  8 +-
 47 files changed, 230 insertions(+), 70 deletions(-)

diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/RecentFiles.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/RecentFiles.java
index 9535ffde4a..0bccac802e 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/RecentFiles.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/RecentFiles.java
@@ -28,6 +28,7 @@ import org.apache.sis.gui.dataset.ResourceEvent;
 import org.apache.sis.gui.dataset.ResourceExplorer;
 import org.apache.sis.internal.gui.Resources;
 import org.apache.sis.internal.gui.RecentChoices;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.util.ArraysExt;
 
 
@@ -42,6 +43,7 @@ final class RecentFiles implements EventHandler<ActionEvent> {
     /**
      * Maximum number of items to show.
      */
+    @Configuration
     static final int MAX_COUNT = 10;
 
     /**
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/FeatureLoader.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/FeatureLoader.java
index 1fa4c895e2..65af557681 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/FeatureLoader.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/dataset/FeatureLoader.java
@@ -29,6 +29,7 @@ import org.apache.sis.storage.FeatureSet;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.util.collection.BackingStoreException;
 import org.apache.sis.internal.gui.Resources;
+import org.apache.sis.internal.system.Configuration;
 
 
 /**
@@ -47,6 +48,7 @@ final class FeatureLoader extends Task<Boolean> implements Consumer<Feature> {
      *
      * @see FeatureList#nextPageLoader
      */
+    @Configuration
     private static final int PAGE_SIZE = 100;
 
     /**
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java
index a497028403..ee90198bd7 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/map/MapCanvasAWT.java
@@ -43,6 +43,7 @@ import javafx.beans.property.SimpleObjectProperty;
 import javafx.concurrent.Task;
 import javafx.util.Callback;
 import org.apache.sis.internal.coverage.j2d.ColorModelFactory;
+import org.apache.sis.internal.system.Configuration;
 
 
 /**
@@ -64,6 +65,7 @@ public abstract class MapCanvasAWT extends MapCanvas {
      * back to video card memory. I'm not aware of a way to perform direct transfer from AWT to JavaFX.
      * Consequently before to enable this acceleration, we should benchmark to see if it is worth.
      */
+    @Configuration
     private static final boolean NATIVE_ACCELERATION = false;
 
     /**
@@ -79,6 +81,7 @@ public abstract class MapCanvasAWT extends MapCanvas {
     /**
      * Default value of {@link #imageMargin}.
      */
+    @Configuration
     private static final Insets DEFAULT_MARGIN = new Insets(SCROLL_EVENT_SIZE);
 
     /**
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/LogHandler.java b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/LogHandler.java
index 7a87b9919f..17dd5a95cc 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/LogHandler.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/LogHandler.java
@@ -33,6 +33,7 @@ import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.Resource;
 import org.apache.sis.storage.event.StoreListener;
 import org.apache.sis.storage.event.WarningEvent;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.util.CharSequences;
 
@@ -49,6 +50,7 @@ public final class LogHandler extends Handler implements StoreListener<WarningEv
     /**
      * Maximal number of log records stored by this class.
      */
+    @Configuration
     private static final int LIMIT = 1000;
 
     /**
diff --git a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/RecentChoices.java b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/RecentChoices.java
index 76441c4972..f539cd4a49 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/RecentChoices.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/internal/gui/RecentChoices.java
@@ -25,6 +25,7 @@ import javafx.scene.control.ComboBox;
 import javafx.collections.ObservableList;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.collection.FrequencySortedSet;
+import org.apache.sis.internal.system.Configuration;
 
 
 /**
@@ -42,6 +43,7 @@ public final class RecentChoices {
      *
      * @see #useReferenceSystem(String)
      */
+    @Configuration
     public static final int MAXIMUM_REFERENCE_SYSTEMS = 20;
 
     /**
diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/SampleRangeFormat.java b/core/sis-feature/src/main/java/org/apache/sis/coverage/SampleRangeFormat.java
index 06ef7c6f49..30b54efefa 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/SampleRangeFormat.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/SampleRangeFormat.java
@@ -26,6 +26,7 @@ import org.apache.sis.io.TableAppender;
 import org.apache.sis.measure.Range;
 import org.apache.sis.measure.RangeFormat;
 import org.apache.sis.internal.util.Numerics;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.measure.NumberRange;
 import org.apache.sis.measure.MeasurementRange;
 import org.apache.sis.util.resources.Vocabulary;
@@ -44,6 +45,7 @@ final class SampleRangeFormat extends RangeFormat {
      * Maximum value for {@link #numFractionDigits}. This is the number
      * of significant digits to allow when formatting real values.
      */
+    @Configuration
     private static final int MAX_DIGITS = 6;
 
     /**
diff --git a/core/sis-feature/src/main/java/org/apache/sis/image/ResamplingGrid.java b/core/sis-feature/src/main/java/org/apache/sis/image/ResamplingGrid.java
index e717583931..5c4c30f962 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/image/ResamplingGrid.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/image/ResamplingGrid.java
@@ -28,6 +28,7 @@ import org.apache.sis.referencing.operation.matrix.Matrix2;
 import org.apache.sis.referencing.operation.transform.MathTransforms;
 import org.apache.sis.referencing.operation.transform.AbstractMathTransform2D;
 import org.apache.sis.internal.referencing.j2d.AffineTransform2D;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.util.collection.Cache;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.io.wkt.Formatter;
@@ -71,6 +72,7 @@ final class ResamplingGrid extends AbstractMathTransform2D {
      * This maximum is honored on a best-effort basis; it may happen that for some pixels
      * the error is slightly higher.
      */
+    @Configuration
     static final double TOLERANCE = 0.125;
 
     /**
diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ImageLayout.java b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ImageLayout.java
index aab3f04ad0..1b3bd172ee 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ImageLayout.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ImageLayout.java
@@ -30,6 +30,7 @@ import org.apache.sis.image.ComputedImage;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.internal.util.Strings;
+import org.apache.sis.internal.system.Configuration;
 
 
 /**
@@ -48,7 +49,10 @@ public class ImageLayout {
      * <p>Tiles of 180×180 pixels consume about 127 kB, assuming 4 bytes per pixel. This is about half
      * the consumption of tiles of 256×256 pixels. We select a size which is a multiple of 90 because
      * images are often used with a resolution of e.g. ½° per pixel.</p>
+     *
+     * @see ImageUtilities#DEFAULT_TILE_SIZE
      */
+    @Configuration
     private static final int MIN_TILE_SIZE = 180;
 
     /**
diff --git a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ImageUtilities.java b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ImageUtilities.java
index 1148179ef6..dc11a2f7e6 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ImageUtilities.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/internal/coverage/j2d/ImageUtilities.java
@@ -31,6 +31,7 @@ import java.awt.image.SampleModel;
 import java.awt.image.SinglePixelPackedSampleModel;
 import java.awt.image.MultiPixelPackedSampleModel;
 import org.apache.sis.internal.feature.Resources;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.system.Modules;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.util.Numbers;
@@ -60,6 +61,7 @@ public final class ImageUtilities extends Static {
     /**
      * Default width and height of tiles, in pixels.
      */
+    @Configuration
     public static final int DEFAULT_TILE_SIZE = 256;
 
     /**
@@ -67,6 +69,7 @@ public final class ImageUtilities extends Static {
      * keeping the most recently used tiles up to 10 Mb of memory. This is not for sophisticated caching mechanism;
      * instead the "real" caching should be done by {@link org.apache.sis.image.ComputedImage}.
      */
+    @Configuration
     public static final int SUGGESTED_TILE_CACHE_SIZE = 10 * (1024 * 1024) / (DEFAULT_TILE_SIZE * DEFAULT_TILE_SIZE);
 
     /**
@@ -76,6 +79,7 @@ public final class ImageUtilities extends Static {
      *
      * @see #prepareTransferRegion(Rectangle, int)
      */
+    @Configuration
     private static final int BUFFER_SIZE = 32 * DEFAULT_TILE_SIZE * Byte.SIZE;
 
     /**
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
index e15f8f7e78..eeea549d12 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
@@ -37,13 +37,13 @@ import javax.naming.event.NamingEvent;
 import javax.naming.event.NamingExceptionEvent;
 import javax.naming.event.ObjectChangeListener;
 import org.apache.sis.setup.InstallationResources;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.system.DataDirectory;
 import org.apache.sis.internal.system.Shutdown;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.util.logging.Logging;
-import org.apache.sis.util.Configuration;
 
 import static java.util.logging.Logger.getLogger;
 import static org.apache.sis.internal.util.MetadataServices.EMBEDDED;
@@ -227,7 +227,7 @@ public abstract class Initializer {
      *
      * @since 1.0
      */
-    @Configuration
+    @Configuration(writeAccess = Configuration.Access.GLOBAL)
     public static synchronized boolean setDefault(final Supplier<DataSource> ds) {
         if (source == null) {
             supplier = ds;
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
index 24c276ce3f..04febe4872 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
@@ -34,6 +34,7 @@ import org.apache.sis.util.Classes;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.util.collection.TreeTable;
 import org.apache.sis.util.collection.CheckedContainer;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.system.Modules;
 import org.apache.sis.internal.system.Semaphores;
 import org.apache.sis.internal.system.SystemListener;
@@ -112,6 +113,7 @@ public class MetadataStandard implements Serializable {
      * than GeoAPI, but have a slight performance cost at construction time. Performance
      * after construction should be the same.</p>
      */
+    @Configuration
     static final boolean IMPLEMENTATION_CAN_ALTER_API = false;
 
     /**
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
index 4ff11a50ff..7c9551ddb6 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataSource.java
@@ -60,6 +60,7 @@ import org.apache.sis.internal.metadata.sql.Initializer;
 import org.apache.sis.internal.metadata.sql.Reflection;
 import org.apache.sis.internal.metadata.sql.SQLBuilder;
 import org.apache.sis.internal.metadata.ReferencingServices;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.internal.util.Strings;
 import org.apache.sis.internal.util.CollectionsExt;
@@ -133,12 +134,14 @@ public class MetadataSource implements AutoCloseable {
      *
      * @see #closeExpired()
      */
+    @Configuration
     private static final long TIMEOUT = 2000_000000;
 
     /**
      * An extra delay to add to the {@link #TIMEOUT} in order to increase the chances to
      * close many statements at once.
      */
+    @Configuration
     private static final int EXTRA_DELAY = 500_000000;
 
     /**
diff --git a/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/coverage/MultiResolutionCoverageLoader.java b/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/coverage/MultiResolutionCoverageLoader.java
index d2df229921..27d096675f 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/coverage/MultiResolutionCoverageLoader.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/internal/map/coverage/MultiResolutionCoverageLoader.java
@@ -36,6 +36,7 @@ import org.apache.sis.coverage.grid.GridCoverage;
 import org.apache.sis.coverage.grid.GridRoundingMode;
 import org.apache.sis.math.DecimalFunctions;
 import org.apache.sis.io.TableAppender;
+import org.apache.sis.internal.system.Configuration;
 
 
 /**
@@ -60,6 +61,7 @@ public class MultiResolutionCoverageLoader {
      * This is used by {@link #defaultResolutions(GridGeometry, double[])} when no
      * resolution levels are explicitly given by the {@linkplain #resource}.
      */
+    @Configuration
     private static final int DEFAULT_SIZE = 512;
 
     /**
diff --git a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasContext.java b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasContext.java
index 08be337904..0fe4324b70 100644
--- a/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasContext.java
+++ b/core/sis-portrayal/src/main/java/org/apache/sis/portrayal/CanvasContext.java
@@ -34,6 +34,7 @@ import org.apache.sis.measure.Units;
 import org.apache.sis.geometry.Envelopes;
 import org.apache.sis.geometry.GeneralEnvelope;
 import org.apache.sis.internal.referencing.Formulas;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.referencing.operation.transform.LinearTransform;
 
 
@@ -53,6 +54,7 @@ final class CanvasContext extends CoordinateOperationContext {
      *
      * @see Canvas#findTransform(CoordinateReferenceSystem, CoordinateReferenceSystem, boolean)
      */
+    @Configuration
     private static final double DISPLAY_RESOLUTION = 1;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Arithmetic.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Arithmetic.java
index d6ffd7d4ed..901d8f0bdc 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Arithmetic.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Arithmetic.java
@@ -18,6 +18,7 @@ package org.apache.sis.internal.referencing;
 
 import java.util.function.BiFunction;
 import java.util.function.BinaryOperator;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.util.DoubleDouble;
 import org.apache.sis.math.Fraction;
 
@@ -76,6 +77,7 @@ public enum Arithmetic {
      * Whether to assume that {@code float} and {@code double} values
      * were intended to be exact in base 10.
      */
+    @Configuration
     public static final boolean DECIMAL = true;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java
index 2face4aff3..538cb09cc6 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/Formulas.java
@@ -16,10 +16,11 @@
  */
 package org.apache.sis.internal.referencing;
 
+import org.opengis.referencing.datum.Ellipsoid;
 import org.apache.sis.util.Static;
 import org.apache.sis.measure.Latitude;
 import org.apache.sis.internal.util.Numerics;
-import org.opengis.referencing.datum.Ellipsoid;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.referencing.datum.DefaultEllipsoid;
 
 import static java.lang.Math.*;
@@ -51,6 +52,7 @@ public final class Formulas extends Static {
      * @see #ANGULAR_TOLERANCE
      * @see org.apache.sis.internal.util.Numerics#COMPARISON_THRESHOLD
      */
+    @Configuration
     public static final double LINEAR_TOLERANCE = 0.01;
 
     /**
@@ -63,6 +65,7 @@ public final class Formulas extends Static {
      * @see #LINEAR_TOLERANCE
      * @see org.apache.sis.internal.util.Numerics#COMPARISON_THRESHOLD
      */
+    @Configuration
     public static final double ANGULAR_TOLERANCE = LINEAR_TOLERANCE / (NAUTICAL_MILE * 60);
 
     /**
@@ -70,6 +73,7 @@ public final class Formulas extends Static {
      * assuming that the unit of measurement is second. Current value is arbitrary
      * and may change in any future Apache SIS version.
      */
+    @Configuration
     public static final double TEMPORAL_TOLERANCE = 60;             // One minute.
 
     /**
@@ -96,6 +100,7 @@ public final class Formulas extends Static {
      *
      * <p>Current value has been determined empirically for allowing {@code GeodesicsOnEllipsoidTest} to pass.</p>
      */
+    @Configuration
     public static final int MAXIMUM_ITERATIONS = 18;
 
     /**
@@ -104,6 +109,7 @@ public final class Formulas extends Static {
      * Use of FMA brings performance benefits on machines having hardware support,
      * but come at a high cost on older machines without hardware support.
      */
+    @Configuration
     public static final boolean USE_FMA = true;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
index 411d7a0cd0..246bdfb7ab 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/PositionalAccuracyConstant.java
@@ -36,6 +36,7 @@ import org.apache.sis.measure.Units;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.metadata.iso.quality.DefaultConformanceResult;
 import org.apache.sis.metadata.iso.quality.DefaultAbsoluteExternalPositionalAccuracy;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.util.resources.Vocabulary;
 
 
@@ -65,6 +66,7 @@ public final class PositionalAccuracyConstant extends DefaultAbsoluteExternalPos
      *
      * @see org.apache.sis.referencing.operation.AbstractCoordinateOperation#getLinearAccuracy()
      */
+    @Configuration
     public static final double UNKNOWN_ACCURACY = 3000;
 
     /**
@@ -76,6 +78,7 @@ public final class PositionalAccuracyConstant extends DefaultAbsoluteExternalPos
      *
      * @see org.apache.sis.referencing.operation.AbstractCoordinateOperation#getLinearAccuracy()
      */
+    @Configuration
     private static final double DATUM_SHIFT_ACCURACY = 25;
 
     /**
@@ -84,6 +87,7 @@ public final class PositionalAccuracyConstant extends DefaultAbsoluteExternalPos
      * The result is multiplied by 2 again as a margin because we have no guarantees that the domain
      * of validity of the two datum are close enough for making this concatenation valid.
      */
+    @Configuration
     public static final double INDIRECT_SHIFT_ACCURACY = 100;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java b/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
index f64bef6d26..6d78aff9dd 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
@@ -74,6 +74,7 @@ import org.apache.sis.internal.util.X364;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.util.StandardDateFormat;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.simple.SimpleExtent;
 import org.apache.sis.internal.metadata.Resources;
 import org.apache.sis.internal.referencing.WKTKeywords;
@@ -116,12 +117,14 @@ public class Formatter implements Localized {
      * Accuracy of geographic bounding boxes, in number of fraction digits.
      * We use the accuracy recommended by ISO 19162.
      */
+    @Configuration
     static final int BBOX_ACCURACY = 2;
 
     /**
      * Maximal accuracy of vertical extents, in number of fraction digits.
      * The value used here is arbitrary and may change in any future SIS version.
      */
+    @Configuration
     private static final int VERTICAL_ACCURACY = 9;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodesicsOnEllipsoid.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodesicsOnEllipsoid.java
index 7818cab811..6521f1e00e 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodesicsOnEllipsoid.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/GeodesicsOnEllipsoid.java
@@ -22,6 +22,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.apache.sis.internal.referencing.Resources;
 import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.math.MathFunctions;
+import org.apache.sis.util.Debug;
 
 import static java.lang.Math.*;
 
@@ -78,11 +79,12 @@ import static java.lang.Math.*;
  */
 class GeodesicsOnEllipsoid extends GeodeticCalculator {
     /**
-     * Whether to include code used for JUnit tests only. This field should be
-     * set to {@code true} during development and to {@code false} in releases.
+     * Whether to include code used for JUnit tests only. This field can be set to
+     * {@code true} during debugging and should be set to {@code false} in releases.
      *
      * @see #snapshot()
      */
+    @Debug
     static final boolean STORE_LOCAL_VARIABLES = false;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
index 823976a0af..7ab474133a 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
@@ -55,6 +55,7 @@ import org.apache.sis.internal.simple.SimpleCitation;
 import org.apache.sis.internal.system.ReferenceQueueConsumer;
 import org.apache.sis.internal.system.DelayedExecutor;
 import org.apache.sis.internal.system.DelayedRunnable;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.system.Shutdown;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.internal.util.CollectionsExt;
@@ -111,11 +112,12 @@ public abstract class ConcurrentAuthorityFactory<DAO extends GeodeticAuthorityFa
      * Any operation that take longer than this amount of time to execute will have a message logged.
      * The log level depends on the execution duration as specified in {@link PerformanceLevel}.
      *
-     * <div class="note"><b>Rational:</b>
-     * we do not unconditionally log all creation messages because they are redundant with more detailed
+     * <h4>Rational</h4>
+     * We do not unconditionally log all creation messages because they are redundant with more detailed
      * logs produced by {@link GeodeticObjectFactory}. Their only additional information is the creation
-     * duration, which is not very useful if too close to zero.</div>
+     * duration, which is not very useful if too close to zero.
      */
+    @Configuration
     private static final long DURATION_FOR_LOGGING = 10_000_000L;       // 10 milliseconds.
 
     /**
@@ -263,7 +265,9 @@ public abstract class ConcurrentAuthorityFactory<DAO extends GeodeticAuthorityFa
      * Every access to this field must be performed in a block synchronized on {@link #availableDAOs}.
      *
      * @see #getTimeout(TimeUnit)
+     * @see #setTimeout(long, TimeUnit)
      */
+    @Configuration(writeAccess = Configuration.Access.INSTANCE)
     private long timeout = 60_000_000_000L;     // 1 minute
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ReferenceKeeper.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ReferenceKeeper.java
index 40b5ebcd3c..752f4877b1 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ReferenceKeeper.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ReferenceKeeper.java
@@ -17,6 +17,7 @@
 package org.apache.sis.referencing.factory;
 
 import org.opengis.referencing.IdentifiedObject;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.system.DelayedExecutor;
 import org.apache.sis.internal.system.DelayedRunnable;
 import org.apache.sis.internal.util.StandardDateFormat;
@@ -50,11 +51,13 @@ final class ReferenceKeeper {
      * is not designed for large collections. Note that the number of unique entries may be lower
      * because this class does not try to avoid duplicated references.
      */
+    @Configuration
     private static final int CAPACITY = 40;
 
     /**
      * Time to wait before to remove entries from this map. Current value is 5 minutes.
      */
+    @Configuration
     private static final long EXPIRATION_TIME = 5L * 60 * StandardDateFormat.NANOS_PER_SECOND;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
index 0fde35056c..1136177578 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
@@ -57,6 +57,7 @@ import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Classes;
 import org.apache.sis.util.NullArgumentException;
 import org.apache.sis.util.Utilities;
+import org.apache.sis.util.Debug;
 
 
 /**
@@ -90,6 +91,7 @@ public class DefaultCoordinateOperationFactory extends AbstractFactory implement
      * Whether this class is allowed to use the EPSG authority factory for searching coordinate operation paths.
      * This flag should always be {@code true}, except temporarily for testing purposes.
      */
+    @Debug
     static final boolean USE_EPSG_FACTORY = true;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LocalizationGridBuilder.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LocalizationGridBuilder.java
index 01f456033a..792f319688 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LocalizationGridBuilder.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/LocalizationGridBuilder.java
@@ -38,6 +38,7 @@ import org.apache.sis.referencing.datum.DatumShiftGrid;
 import org.apache.sis.internal.referencing.Resources;
 import org.apache.sis.geometry.GeneralEnvelope;
 import org.apache.sis.geometry.Envelopes;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.util.Numerics;
 import org.apache.sis.internal.util.Strings;
 import org.apache.sis.util.resources.Vocabulary;
@@ -130,6 +131,7 @@ public class LocalizationGridBuilder extends TransformBuilder {
      * precision has been specified. The {@code sourceToGrid} transform shall not be applied on this value.
      * This default precision may change in any future SIS version.
      */
+    @Configuration
     private static final double DEFAULT_PRECISION = 1E-7;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/ProjectedTransformTry.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/ProjectedTransformTry.java
index 8d0a41990d..ffaf3ab3c6 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/ProjectedTransformTry.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/builder/ProjectedTransformTry.java
@@ -25,13 +25,13 @@ import java.text.NumberFormat;
 import org.opengis.geometry.MismatchedDimensionException;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.TransformException;
-import org.apache.sis.referencing.operation.matrix.MatrixSIS;
 import org.apache.sis.io.TableAppender;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.Exceptions;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.referencing.operation.matrix.Matrices;
+import org.apache.sis.referencing.operation.matrix.MatrixSIS;
 import org.apache.sis.referencing.operation.transform.MathTransforms;
 
 
@@ -41,8 +41,8 @@ import org.apache.sis.referencing.operation.transform.MathTransforms;
  * in order to avoid consuming too much memory when many attempts are made; {@link LinearTransformBuilder} needs only
  * to keep the best attempt.
  *
- * <div class="note">
- * <p><b>Purpose:</b> localization grids in netCDF files contain (<var>longitude</var>, <var>latitude</var>) values for all pixels.
+ * <h2>Purpose</h2>
+ * <p>Localization grids in netCDF files contain (<var>longitude</var>, <var>latitude</var>) values for all pixels.
  * {@link LocalizationGridBuilder} first computes a linear (affine) approximation of a localization grid, then stores the residuals.
  * This approach works well when the residuals are small. However if the localization grid is non-linear, then the affine transform
  * is a poor approximation of that grid and the residuals are high. High residuals make inverse transforms hard to compute, which
@@ -53,10 +53,10 @@ import org.apache.sis.referencing.operation.transform.MathTransforms;
  * if one of those projections results in a grid closer to an affine transform. In other words, we use this class for trying to
  * guess what the projection may be. It is okay if the guess is not a perfect match; if the residuals become smalls enough,
  * it will resolve the "no convergence" errors.</p>
- * </div>
  *
- * <p><b>Note:</b> {@link #compareTo(ProjectedTransformTry)} is inconsistent with {@link #equals(Object)}.
- * The fact that {@link ProjectedTransformTry} instances are comparable should not be visible in public API.</p>
+ * <h2>Note</h2>
+ * {@link #compareTo(ProjectedTransformTry)} is inconsistent with {@link #equals(Object)}.
+ * The fact that {@link ProjectedTransformTry} instances are comparable should not be visible in public API.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 1.1
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java
index d43410c5b9..bd3a625868 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/GeneralMatrix.java
@@ -21,6 +21,7 @@ import org.opengis.referencing.operation.Matrix;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.internal.util.Numerics;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.referencing.Arithmetic;
 import org.apache.sis.internal.referencing.ExtendedPrecisionMatrix;
 
@@ -61,7 +62,10 @@ class GeneralMatrix extends MatrixSIS implements ExtendedPrecisionMatrix {
      * <div class="note"><b>Note:</b>
      * A similar constant exists in {@code org.apache.sis.math.Plane}.
      * </div>
+     *
+     * @see Numerics#COMPARISON_THRESHOLD
      */
+    @Configuration
     private static final double ZERO_THRESHOLD = 1E-14;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
index 860e57643f..c633d378b7 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
@@ -36,6 +36,7 @@ import org.apache.sis.internal.referencing.Resources;
 import org.apache.sis.internal.util.DoubleDouble;
 import org.apache.sis.parameter.Parameters;
 import org.apache.sis.util.Workaround;
+import org.apache.sis.util.Debug;
 
 import static java.lang.Math.*;
 import static org.apache.sis.math.MathFunctions.asinh;
@@ -117,6 +118,7 @@ public class TransverseMercator extends NormalizedProjection {
      *
      * @see #identityEquals(double, double)
      */
+    @Debug
     private static final boolean ALLOW_TRIGONOMETRIC_IDENTITIES = true;
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java
index ebbc83f854..1815536d47 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform.java
@@ -31,6 +31,7 @@ import org.apache.sis.referencing.operation.matrix.Matrices;
 import org.apache.sis.referencing.operation.matrix.MatrixSIS;
 import org.apache.sis.referencing.operation.matrix.NoninvertibleMatrixException;
 import org.apache.sis.measure.Units;
+import org.apache.sis.util.Debug;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.ComparisonMode;
@@ -449,6 +450,7 @@ public class InterpolatedTransform extends DatumShiftTransform {
          * be enabled, and some information will be printed to the standard output stream. Enabling debugging slows
          * down considerably the transformations; it should be done only for small set of test data.
          */
+        @Debug
         private static final boolean DEBUG = false;
 
         /**
@@ -458,6 +460,7 @@ public class InterpolatedTransform extends DatumShiftTransform {
          * more curved grids like the ones read from netCDF files. We provide this switch for allowing performance
          * comparisons.
          */
+        @Debug
         private static final boolean SIMPLE = false;
 
         /**
diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/system/CommonExecutor.java b/core/sis-utility/src/main/java/org/apache/sis/internal/system/CommonExecutor.java
index 532bf9a330..17b5e7b6ac 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/internal/system/CommonExecutor.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/internal/system/CommonExecutor.java
@@ -58,6 +58,7 @@ public final class CommonExecutor extends AtomicInteger implements ThreadFactory
      * If the number of tasks is greater than this parallelism value,
      * extraneous tasks will be queued.
      */
+    @Configuration
     public static final int PARALLELISM = Math.max(Runtime.getRuntime().availableProcessors() - 1, 1);
 
     /**
diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/system/Configuration.java b/core/sis-utility/src/main/java/org/apache/sis/internal/system/Configuration.java
new file mode 100644
index 0000000000..5c30cf939c
--- /dev/null
+++ b/core/sis-utility/src/main/java/org/apache/sis/internal/system/Configuration.java
@@ -0,0 +1,91 @@
+/*
+ * 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.internal.system;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+
+
+/**
+ * Annotates methods having a system-wide impact on the configuration of the Apache SIS library.
+ * Also used for some static final constants fixed to arbitrary values that could be customized.
+ * This annotation should not be used on test classes for avoiding to pollute usage searches.
+ *
+ * <h2>Application to static final constants</h2>
+ * We do not annotate all static constants having arbitrary values because there is too many of them.
+ * We annotate only the most interesting ones, when we can reasonably think that some developers may
+ * want to change the values. This annotation is used for identifying aspects where we could add API
+ * in a future version if there is an interest for controlling them.
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @version 1.4
+ * @since   0.3
+ */
+@Target({ElementType.METHOD, ElementType.FIELD})
+@Retention(RetentionPolicy.SOURCE)
+public @interface Configuration {
+    /**
+     * Tells by which API the configuration can be modified.
+     * The value shall be {@code NONE} (the default) for compile-time constants.
+     * At the opposite extreme, the value should be {@code GLOBAL} If the configuration
+     * is accessible from the {@link org.apache.sis.setup.Configuration} public class.
+     *
+     * @return which API can modify the configuration.
+     */
+    Access writeAccess() default Access.NONE;
+
+    /**
+     * Indication of which API can modify the configuration. The enumeration is ordered from
+     * non-modifiable to the preferred place where to provide control on the configuration.
+     */
+    enum Access {
+        /**
+         * The configuration is non-modifiable.
+         * This value applies to all static final constants.
+         */
+        NONE,
+
+        /**
+         * The configuration is modifiable through an internal API.
+         * There is no public API for this configuration yet.
+         */
+        INTERNAL,
+
+        /**
+         * The configuration is modifiable through a public method
+         * that must be invoked on a particular instance of a class.
+         * This configuration can not be easily moved to {@link #GLOBAL}
+         * because it would require to decide on which instance to apply.
+         */
+        INSTANCE,
+
+        /**
+         * The configuration is modifiable through a public static method.
+         * This value means that the configuration could be moved to {@link #GLOBAL},
+         * but has not been moved yet because it is not clear if there is an interest for that.
+         */
+        STATIC,
+
+        /**
+         * The configuration is modifiable through {@link org.apache.sis.setup.Configuration}.
+         * This is the place where we try to centralize all configurations of interest.
+         */
+        GLOBAL
+    }
+}
diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java b/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
index 7197ec5529..325391b862 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
@@ -37,7 +37,6 @@ import javax.management.InstanceAlreadyExistsException;
 import java.lang.management.ManagementFactory;
 
 import org.apache.sis.setup.About;
-import org.apache.sis.util.Configuration;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.resources.Messages;
@@ -59,6 +58,7 @@ public final class Supervisor extends StandardMBean implements SupervisorMBean {
      * Whatever JMX agent is enabled. Setting this variable to {@code false} allows the
      * Java compiler to omit any dependency to this {@code Supervisor} class.
      */
+    @Configuration
     static final boolean ENABLED = true;
 
     /**
@@ -81,7 +81,7 @@ public final class Supervisor extends StandardMBean implements SupervisorMBean {
      * and the MBean will not be registered. This method does not propagate the exception
      * because the MBean is not a mandatory part of SIS library.</p>
      */
-    @Configuration
+    @Configuration(writeAccess = Configuration.Access.INTERNAL)
     public static synchronized void register() {
         if (name == null) {
             name = ObjectName.WILDCARD;                         // In case of failure.
@@ -112,7 +112,7 @@ public final class Supervisor extends StandardMBean implements SupervisorMBean {
      *
      * @throws JMException if an error occurred during unregistration.
      */
-    @Configuration
+    @Configuration(writeAccess = Configuration.Access.INTERNAL)
     static synchronized void unregister() throws JMException {
         final ObjectName n = name;
         if (n != null) {
diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java b/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
index 465f861f00..f3a0f85679 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/internal/util/DoubleDouble.java
@@ -23,6 +23,8 @@ import java.math.MathContext;
 import org.apache.sis.math.Fraction;
 import org.apache.sis.math.MathFunctions;
 import org.apache.sis.math.DecimalFunctions;
+import org.apache.sis.internal.system.Configuration;
+import org.apache.sis.util.Debug;
 
 
 /**
@@ -76,6 +78,7 @@ public final class DoubleDouble extends Number implements Comparable<DoubleDoubl
      * implementation. Since JAMA uses {@code double} arithmetic, SIS needs to disable double-double
      * arithmetic if the results are to be compared for strict equality.</p>
      */
+    @Debug
     public static final boolean DISABLED = false;
 
     /**
@@ -84,6 +87,7 @@ public final class DoubleDouble extends Number implements Comparable<DoubleDoubl
      * if the amount of non-zero significand bits is equal or lower than {@code ZERO_THRESHOLD+1},
      * consider the result as zero.
      */
+    @Configuration
     private static final int ZERO_THRESHOLD = 2;
 
     /**
diff --git a/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java b/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
index 25d2a9dc9b..7633317629 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
@@ -35,6 +35,7 @@ import static java.lang.Math.min;
 import static java.lang.Math.max;
 import static java.lang.Math.abs;
 import static java.lang.Math.ulp;
+import org.apache.sis.internal.system.Configuration;
 
 
 /**
@@ -114,7 +115,9 @@ public final class Numerics extends Static {
      *
      * @see org.apache.sis.internal.referencing.Formulas#LINEAR_TOLERANCE
      * @see org.apache.sis.internal.referencing.Formulas#ANGULAR_TOLERANCE
+     * @see org.apache.sis.referencing.operation.matrix.GeneralMatrix#ZERO_THRESHOLD
      */
+    @Configuration
     public static final double COMPARISON_THRESHOLD = 1E-13;
 
     /**
diff --git a/core/sis-utility/src/main/java/org/apache/sis/math/Plane.java b/core/sis-utility/src/main/java/org/apache/sis/math/Plane.java
index eb1831bf7c..ceaa5294bf 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/math/Plane.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/math/Plane.java
@@ -82,6 +82,8 @@ public class Plane implements DoubleBinaryOperator, Cloneable, Serializable {
      * <div class="note"><b>Note:</b>
      * A similar constant exists in {@code org.apache.sis.referencing.operation.matrix.GeneralMatrix}.
      * </div>
+     *
+     * @see Numerics#COMPARISON_THRESHOLD
      */
     private static final double ZERO_THRESHOLD = 1E-14;
 
diff --git a/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java b/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java
index 09688330c2..ac85136eff 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/measure/AbstractUnit.java
@@ -33,6 +33,7 @@ import org.apache.sis.util.LenientComparable;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.internal.system.Configuration;
 
 import static java.util.logging.Logger.getLogger;
 
@@ -82,6 +83,7 @@ abstract class AbstractUnit<Q extends Quantity<Q>> implements Unit<Q>, LenientCo
      *
      * @see #isValidSymbol(String, boolean, boolean)
      */
+    @Configuration
     private static final int MAX_OPERATIONS_IN_SYMBOL = 1;
 
     /**
diff --git a/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java b/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
index 99d603ea93..12d2cd0dfc 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
@@ -33,6 +33,7 @@ import java.io.UncheckedIOException;
 import javax.measure.Dimension;
 import javax.measure.Unit;
 import javax.measure.format.MeasurementParseException;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.util.DefinitionURI;
@@ -88,6 +89,7 @@ public class UnitFormat extends Format implements javax.measure.format.UnitForma
     /**
      * Whether the parsing of authority codes such as {@code "EPSG:9001"} is allowed.
      */
+    @Configuration
     private static final boolean PARSE_AUTHORITY_CODES = true;
 
     /**
diff --git a/core/sis-utility/src/main/java/org/apache/sis/setup/Configuration.java b/core/sis-utility/src/main/java/org/apache/sis/setup/Configuration.java
index 1e68580692..39575dc8c7 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/setup/Configuration.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/setup/Configuration.java
@@ -21,6 +21,7 @@ import java.util.Optional;
 import javax.sql.DataSource;
 import java.sql.SQLException;
 import java.util.function.Supplier;
+import java.util.concurrent.TimeUnit;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.internal.util.MetadataServices;
 
@@ -32,8 +33,16 @@ import org.apache.sis.internal.util.MetadataServices;
  * in order to avoid interfering with user's settings.
  *
  * <h2>Other system-wide configuration</h2>
+ * The following methods have system-wide effects on Apache SIS configuration,
+ * but are not yet controlled through this {@code Configuration} class:
+ *
+ * <ul>
+ *   <li>{@link org.apache.sis.util.logging.MonolineFormatter#install()}</li>
+ *   <li>{@link org.apache.sis.util.logging.PerformanceLevel#setMinDuration(long, TimeUnit)}</li>
+ * </ul>
+ *
  * The following properties are defined by the standard Java environment.
- * Apache SIS does not modify those properties but read them:
+ * Apache SIS read those properties but does not modify them:
  *
  * <ul>
  *   <li>{@link Locale#getDefault()} (sometimes using {@link Locale.Category})</li>
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/Configuration.java b/core/sis-utility/src/main/java/org/apache/sis/util/Configuration.java
deleted file mode 100644
index 51b97e4d9e..0000000000
--- a/core/sis-utility/src/main/java/org/apache/sis/util/Configuration.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sis.util;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.RetentionPolicy;
-
-
-/**
- * Annotates methods having a system-wide impact on the configuration of the Apache SIS library.
- * See <cite>"Use"</cite> javadoc link for a list of annotated methods.
- *
- * <p><b>Do not use.</b> This annotation is for documentation purpose only
- * and will be replaced by the {@link org.apache.sis.setup.Configuration} class.
- *
- * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.3
- *
- * @see <a href="https://issues.apache.org/jira/browse/SIS-86">SIS-86</a>
- *
- * @since 0.3
- */
-@Documented
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.SOURCE)
-public @interface Configuration {
-}
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java b/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
index 0b4219f852..c7b3196d22 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
@@ -28,6 +28,7 @@ import org.apache.sis.util.Static;
 import org.apache.sis.util.Exceptions;
 import org.apache.sis.util.Classes;
 import org.apache.sis.internal.system.Modules;
+import org.apache.sis.internal.system.Configuration;
 
 
 /**
@@ -57,6 +58,7 @@ public final class Logging extends Static {
      * Consequently, we will ignore the stack traces of recoverable failures, but will report
      * stack traces that may impact performance, configuration, or correctness.</p>
      */
+    @Configuration
     private static final int LEVEL_THRESHOLD_FOR_STACKTRACE = 600;
 
     /**
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java b/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
index 7e0cc6056d..f61f0ed51d 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/logging/MonolineFormatter.java
@@ -36,11 +36,11 @@ import org.apache.sis.internal.system.Modules;
 import org.apache.sis.internal.util.X364;
 import org.apache.sis.internal.util.Strings;
 import org.apache.sis.internal.util.AutoMessageFormat;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.io.IO;
 import org.apache.sis.io.LineAppender;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.CharSequences;
-import org.apache.sis.util.Configuration;
 import org.apache.sis.util.Debug;
 
 import static org.apache.sis.internal.util.StandardDateFormat.UTC;
@@ -184,6 +184,7 @@ public class MonolineFormatter extends Formatter {
     /**
      * Maximal amount of causes to print in stack traces. This is an arbitrary limit.
      */
+    @Configuration
     private static final int MAX_CAUSES = 10;
 
     /**
@@ -978,7 +979,7 @@ loop:   for (int i=0; ; i++) {
      *         using the {@link #setTimeFormat(String)} and {@link #setSourceFormat(String)} methods.
      * @throws SecurityException if this method does not have the permission to install the formatter.
      */
-    @Configuration
+    @Configuration(writeAccess = Configuration.Access.STATIC)
     public static MonolineFormatter install() throws SecurityException {
         return install(Logger.getLogger(""), null);
     }
@@ -1023,7 +1024,7 @@ loop:   for (int i=0; ; i++) {
      * @throws SecurityException if this method does not have the permission to install the formatter.
      */
     @Debug
-    @Configuration
+    @Configuration(writeAccess = Configuration.Access.STATIC)
     public static MonolineFormatter install(final Logger logger, final Level level) throws SecurityException {
         ArgumentChecks.ensureNonNull("logger", logger);
         MonolineFormatter monoline = null;
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/logging/PerformanceLevel.java b/core/sis-utility/src/main/java/org/apache/sis/util/logging/PerformanceLevel.java
index e1c76fad30..110a291393 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/logging/PerformanceLevel.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/logging/PerformanceLevel.java
@@ -19,9 +19,9 @@ package org.apache.sis.util.logging;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.concurrent.TimeUnit;
-import org.apache.sis.util.Configuration;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Vocabulary;
+import org.apache.sis.internal.system.Configuration;
 
 
 /**
@@ -79,7 +79,11 @@ public final class PerformanceLevel extends Level {
 
     /**
      * The minimal duration (in nanoseconds) for logging the record.
+     *
+     * @see #getMinDuration(TimeUnit)
+     * @see #setMinDuration(long, TimeUnit)
      */
+    @Configuration(writeAccess = Configuration.Access.INSTANCE)
     private volatile long minDuration;
 
     /**
@@ -142,7 +146,6 @@ public final class PerformanceLevel extends Level {
      * @param  unit      the unit of the given duration value.
      * @throws IllegalArgumentException if the given duration is zero or negative.
      */
-    @Configuration
     @SuppressWarnings("fallthrough")
     public void setMinDuration(long duration, final TimeUnit unit) throws IllegalArgumentException {
         ArgumentChecks.ensureStrictlyPositive("duration", duration);
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java b/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
index cc387e7ddd..11580346f1 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
@@ -43,6 +43,7 @@ import org.apache.sis.util.Exceptions;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.util.AutoMessageFormat;
 import org.apache.sis.internal.util.MetadataServices;
 import org.apache.sis.internal.util.Strings;
@@ -95,6 +96,7 @@ public class IndexedResourceBundle extends ResourceBundle implements Localized {
      * Resource strings are never cut to this length. However, text replacing {@code "{0}"} in a string like
      * {@code "Parameter name is {0}"} will be cut to this length.
      */
+    @Configuration
     private static final int MAX_STRING_LENGTH = 200;
 
     /**
diff --git a/ide-project/NetBeans/nbproject/genfiles.properties b/ide-project/NetBeans/nbproject/genfiles.properties
index 2427112a0b..dbf91a7a89 100644
--- a/ide-project/NetBeans/nbproject/genfiles.properties
+++ b/ide-project/NetBeans/nbproject/genfiles.properties
@@ -3,6 +3,6 @@
 build.xml.data.CRC32=58e6b21c
 build.xml.script.CRC32=462eaba0
 build.xml.stylesheet.CRC32=28e38971@1.53.1.46
-nbproject/build-impl.xml.data.CRC32=fd717426
+nbproject/build-impl.xml.data.CRC32=b95fb13b
 nbproject/build-impl.xml.script.CRC32=69d63511
-nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.104.0.48
+nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.105.0.48
diff --git a/ide-project/NetBeans/nbproject/project.xml b/ide-project/NetBeans/nbproject/project.xml
index 73c362359f..d23f13fea9 100644
--- a/ide-project/NetBeans/nbproject/project.xml
+++ b/ide-project/NetBeans/nbproject/project.xml
@@ -89,6 +89,7 @@
             <word>collinearity</word>
             <word>complexify</word>
             <word>covariant</word>
+            <word>customizable</word>
             <word>deserialization</word>
             <word>deserialized</word>
             <word>endianness</word>
diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/FeatureSet.java b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/FeatureSet.java
index f7dc1807a6..0e07cd1c65 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/FeatureSet.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/FeatureSet.java
@@ -37,6 +37,7 @@ import org.opengis.referencing.crs.TemporalCRS;
 import org.opengis.metadata.acquisition.GeometryType;
 import org.apache.sis.referencing.crs.DefaultTemporalCRS;
 import org.apache.sis.coverage.grid.GridExtent;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.feature.MovingFeatures;
 import org.apache.sis.internal.util.Strings;
 import org.apache.sis.storage.DataStore;
@@ -82,6 +83,7 @@ final class FeatureSet extends DiscreteSampling {
      * We do not read all features at once neither because it consumes a lot of memory if the netCDF file is large.
      * This value is a compromise between reducing I/O operations and reducing memory consumption.
      */
+    @Configuration
     private static final int PAGE_SIZE = 512;
 
     /**
diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
index 4962e1122e..690a381421 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
@@ -65,6 +65,7 @@ import org.apache.sis.internal.storage.io.IOUtilities;
 import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.internal.storage.wkt.StoreFormat;
 import org.apache.sis.internal.referencing.AxisDirections;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.util.CollectionsExt;
 import org.apache.sis.internal.util.Strings;
 import org.apache.sis.util.resources.Errors;
@@ -119,6 +120,7 @@ final class MetadataReader extends MetadataBuilder {
      * Whether the reader should include experimental fields.
      * They are fields for which we are unsure of the proper ISO 19115 location.
      */
+    @Configuration
     private static final boolean EXPERIMENTAL = true;
 
     /**
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreUtilities.java b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreUtilities.java
index 24503c0824..3e2baca237 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreUtilities.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreUtilities.java
@@ -46,6 +46,7 @@ import org.apache.sis.storage.UnsupportedStorageException;
 import org.apache.sis.storage.event.StoreListeners;
 import org.apache.sis.geometry.GeneralEnvelope;
 import org.apache.sis.internal.metadata.Identifiers;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.system.Modules;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.CharSequences;
@@ -80,6 +81,7 @@ public final class StoreUtilities extends Static {
      * have different sample value ranges for each coverage, which cause {@code CoverageAggregator} to consider
      * that that cannot be aggregated together.</p>
      */
+    @Configuration
     public static final boolean ALLOW_LAST_RESORT_STATISTICS = false;
 
     /**
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java b/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
index 88a47baa62..808db94167 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
@@ -64,6 +64,7 @@ import org.apache.sis.internal.storage.io.ChannelImageOutputStream;
 import org.apache.sis.internal.storage.io.InputStreamAdapter;
 import org.apache.sis.internal.storage.io.RewindableLineReader;
 import org.apache.sis.internal.storage.io.InternalOptionKey;
+import org.apache.sis.internal.system.Configuration;
 import org.apache.sis.internal.util.Strings;
 import org.apache.sis.io.InvalidSeekException;
 import org.apache.sis.setup.OptionKey;
@@ -113,10 +114,15 @@ public class StorageConnector implements Serializable {
      * The default size (in bytes) of {@link ByteBuffer}s created by storage connectors.
      * Those buffers are typically created when the specified storage object is a
      * {@link File}, {@link Path}, {@link URL} or {@link URI}.
-     * Users can override this value by providing a value for {@link OptionKey#BYTE_BUFFER}.
+     * The default buffer size is arbitrary and may change in any future Apache SIS version.
+     *
+     * <p>Users can override this value by providing a value for {@link OptionKey#BYTE_BUFFER}.</p>
+     *
+     * @see OptionKey#BYTE_BUFFER
      *
      * @since 1.4
      */
+    @Configuration
     public static final int DEFAULT_BUFFER_SIZE = 16 * 1024;
 
     /**