sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 02/03: Rename ModifiableMetadata.apply(State) as ModifiableMetadata.transition(State) and replace call to freeze() by that transition method.
Date Wed, 25 Jul 2018 17:33:18 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit a0b0ab95632be5b52aa7e8c8616e70c6686e13fd
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Wed Jul 25 12:36:45 2018 +0200

    Rename ModifiableMetadata.apply(State) as ModifiableMetadata.transition(State) and replace
call to freeze() by that transition method.
---
 .../sis/internal/metadata/TransformationAccuracy.java      |  2 +-
 .../java/org/apache/sis/metadata/ModifiableMetadata.java   | 14 +++++++-------
 .../java/org/apache/sis/metadata/PropertyAccessor.java     |  4 ++--
 .../main/java/org/apache/sis/metadata/StateChanger.java    |  6 +++---
 .../main/java/org/apache/sis/metadata/iso/ISOMetadata.java |  4 ++--
 .../org/apache/sis/metadata/iso/ImmutableIdentifier.java   |  4 ++--
 .../java/org/apache/sis/metadata/iso/extent/Extents.java   |  4 ++--
 .../iso/identification/DefaultRepresentativeFraction.java  |  3 ++-
 .../java/org/apache/sis/metadata/sql/MetadataFallback.java |  2 +-
 .../sis/metadata/iso/citation/DefaultCitationTest.java     |  8 ++++----
 .../sis/metadata/iso/citation/HardCodedCitations.java      |  8 ++++----
 .../identification/DefaultRepresentativeFractionTest.java  |  4 ++--
 .../internal/referencing/PositionalAccuracyConstant.java   |  3 +--
 .../java/org/apache/sis/referencing/NamedIdentifier.java   |  4 ++--
 .../apache/sis/referencing/factory/sql/EPSGDataAccess.java |  4 ++--
 .../apache/sis/storage/earthobservation/LandsatReader.java |  2 +-
 .../java/org/apache/sis/storage/gdal/Proj4Factory.java     |  2 +-
 .../java/org/apache/sis/storage/netcdf/NetcdfStore.java    |  2 +-
 .../apache/sis/internal/storage/AbstractFeatureSet.java    |  2 +-
 .../org/apache/sis/internal/storage/MetadataBuilder.java   |  2 +-
 20 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
index e7b27e2..c93558b 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
@@ -79,7 +79,7 @@ public final class TransformationAccuracy extends Static {
                     new DefaultAbsoluteExternalPositionalAccuracy(result);
             element.setNamesOfMeasure(Collections.singleton(TRANSFORMATION_ACCURACY));
             element.setEvaluationMethodType(EvaluationMethodType.DIRECT_EXTERNAL);
-            element.freeze();
+            element.transition(DefaultAbsoluteExternalPositionalAccuracy.State.FINAL);
 
             p = CACHE.putIfAbsent(accuracy, element);
             if (p == null) {
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
index dc5799c..ceecee1 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/ModifiableMetadata.java
@@ -142,7 +142,7 @@ public abstract class ModifiableMetadata extends AbstractMetadata {
     /**
      * Whether the metadata is still editable or has been made final.
      * New {@link ModifiableMetadata} instances are initially {@link #EDITABLE}
-     * and can be made {@link #FINAL} after construction by a call to {@link ModifiableMetadata#apply(State)}.
+     * and can be made {@link #FINAL} after construction by a call to {@link ModifiableMetadata#transition(State)}.
      *
      * <div class="note"><b>Note:</b>
      * more states may be added in future Apache SIS versions. On possible candidate is {@code
STAGED}.
@@ -188,7 +188,7 @@ public abstract class ModifiableMetadata extends AbstractMetadata {
     /**
      * Tells whether this instance of metadata is editable.
      * This is initially {@link State#EDITABLE} for new {@code ModifiableMetadata} instances,
-     * but can be changed by a call to {@link #apply(State)}.
+     * but can be changed by a call to {@link #transition(State)}.
      *
      * <p>{@link State#FINAL} implies that all properties are also final.
      * This recursivity does not necessarily apply to other states. For example {@link State#EDITABLE}
@@ -209,9 +209,9 @@ public abstract class ModifiableMetadata extends AbstractMetadata {
     }
 
     /**
-     * Applies a state transition on this metadata instance and (potentially) all its children.
-     * The action performed by this method depends on the {@linkplain #state() current state},
-     * as listed in the following table:
+     * Requests this metadata instance and (potentially) all its children to transition to
a new state.
+     * The action performed by this method depends on the {@linkplain #state() source state}
and the
+     * given target state, as listed in the following table:
      *
      * <table class="sis">
      *   <caption>State transitions</caption>
@@ -243,7 +243,7 @@ public abstract class ModifiableMetadata extends AbstractMetadata {
      *
      * @since 1.0
      */
-    public boolean apply(final State target) {
+    public boolean transition(final State target) {
         switch (target) {
             case EDITABLE: {
                 if ((state & FINAL) == 0) break;
@@ -354,7 +354,7 @@ public abstract class ModifiableMetadata extends AbstractMetadata {
      */
     @Deprecated
     public void freeze() {
-        apply(State.FINAL);
+        transition(State.FINAL);
     }
 
     /**
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
index 76f0849..7f98d1a 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
@@ -319,8 +319,8 @@ class PropertyAccessor {
                  * be a parent type.
                  *
                  * It is a necessary condition that the type returned by the getter is assignable
-                 * to the type expected by the setter.  This contract is required by the
'freeze'
-                 * method among others.
+                 * to the type expected by the setter.  This contract is required by the
'FINAL'
+                 * state among others.
                  */
                 try {
                     getter = implementation.getMethod(getter.getName(), (Class<?>[])
null);
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/StateChanger.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/StateChanger.java
index da08937..64d8c48 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/StateChanger.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/StateChanger.java
@@ -30,7 +30,7 @@ import org.apache.sis.metadata.iso.identification.DefaultRepresentativeFraction;
 
 
 /**
- * Invokes {@link ModifiableMetadata#apply(ModifiableMetadata.State)} recursively on metadata
elements.
+ * Invokes {@link ModifiableMetadata#transition(ModifiableMetadata.State)} recursively on
metadata elements.
  *
  * As of Apache SIS 1.0, this class is used only for {@link ModifiableMetadata.State#FINAL}.
  * But a future version may use this object for other states too.
@@ -122,7 +122,7 @@ final class StateChanger extends MetadataVisitor<Boolean> {
      *
      * <ul>
      *   <li>If the specified object is an instance of {@code ModifiableMetadata},
then
-     *       {@link ModifiableMetadata#apply(ModifiableMetadata.State)} is invoked on that
object.</li>
+     *       {@link ModifiableMetadata#transition(ModifiableMetadata.State)} is invoked on
that object.</li>
      *   <li>Otherwise, if the object is a {@linkplain Collection collection}, then
the
      *       content is copied into a new collection of similar type, with values replaced
      *       by their unmodifiable variant.</li>
@@ -140,7 +140,7 @@ final class StateChanger extends MetadataVisitor<Boolean> {
          *          It may have its own algorithm for changing its state.
          */
         if (object instanceof ModifiableMetadata) {
-            ((ModifiableMetadata) object).apply(target);
+            ((ModifiableMetadata) object).transition(target);
             return object;
         }
         if (target != ModifiableMetadata.State.FINAL) {
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
index 13b8ac8..45ccb67 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
@@ -219,9 +219,9 @@ public class ISOMetadata extends ModifiableMetadata implements IdentifiedObject,
      * {@inheritDoc}
      */
     @Override
-    public boolean apply(final State target) {
+    public boolean transition(final State target) {
         final Collection<Identifier> p = identifiers;
-        final boolean changed = super.apply(target);
+        final boolean changed = super.transition(target);
         if (changed) {
             /*
              * The 'identifiers' collection will have been replaced by an unmodifiable collection
if
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
index bb29cf4..c7d49f9 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
@@ -53,8 +53,8 @@ import static org.apache.sis.util.collection.Containers.property;
  * <div class="section">Immutability and thread safety</div>
  * This class is immutable and thus inherently thread-safe if the {@link Citation} and {@link
InternationalString}
  * arguments given to the constructor are also immutable. It is caller's responsibility to
ensure that those
- * conditions hold, for example by invoking {@link org.apache.sis.metadata.iso.citation.DefaultCitation#freeze()
- * DefaultCitation.freeze()} before passing the arguments to the constructor.
+ * conditions hold, for example by invoking {@link org.apache.sis.metadata.iso.citation.DefaultCitation#transition
+ * DefaultCitation.transition(DefaultCitation.State.FINAL)} before passing the arguments
to the constructor.
  * Subclasses shall make sure that any overridden methods remain safe to call from multiple
threads and do not change
  * any public {@code ImmutableIdentifier} state.
  *
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
index efba78e..83b2b7e 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
@@ -91,10 +91,10 @@ public final class Extents extends Static {
     public static final Extent WORLD;
     static {
         final DefaultGeographicBoundingBox box = new DefaultGeographicBoundingBox(-180, 180,
-90, 90);
-        box.freeze();
+        box.transition(DefaultGeographicBoundingBox.State.FINAL);
         final DefaultExtent world = new DefaultExtent(
                 Vocabulary.formatInternational(Vocabulary.Keys.World), box, null, null);
-        world.freeze();
+        world.transition(DefaultExtent.State.FINAL);
         WORLD = world;
     }
 
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
index d7dc0a6..a304d5b 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
@@ -27,6 +27,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.identification.RepresentativeFraction;
+import org.apache.sis.metadata.ModifiableMetadata;
 import org.apache.sis.metadata.UnmodifiableMetadataException;
 import org.apache.sis.internal.jaxb.ModifiableIdentifierMap;
 import org.apache.sis.internal.jaxb.IdentifierMapAdapter;
@@ -281,7 +282,7 @@ public class DefaultRepresentativeFraction extends Number implements Representat
      * Makes this representative fraction unmodifiable. After invocation to this method,
      * any call to a setter method will throw an {@link UnmodifiableMetadataException}.
      *
-     * @see org.apache.sis.metadata.ModifiableMetadata#freeze()
+     * @see ModifiableMetadata#transition(ModifiableMetadata.State)
      *
      * @since 0.7
      */
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java
b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java
index 0fc0514..1ca0e4a 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/sql/MetadataFallback.java
@@ -210,7 +210,7 @@ final class MetadataFallback extends MetadataSource {
         if (copyFrom != null) {
             c.setCitedResponsibleParties(createCitation(copyFrom).getCitedResponsibleParties());
         }
-        c.apply(DefaultCitation.State.FINAL);
+        c.transition(DefaultCitation.State.FINAL);
         return c;
     }
 
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
index ddf5708..b4a11d8 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
@@ -127,13 +127,13 @@ public final strictfp class DefaultCitationTest extends TestUsingFile
{
     }
 
     /**
-     * Tests {@link DefaultCitation#freeze()}.
+     * Tests {@link DefaultCitation#transition(DefaultCitation.State)} to the final state.
      */
     @Test
-    public void testFreeze() {
+    public void testTransitionToFinal() {
         final DefaultCitation original = create();
         final DefaultCitation clone = create();
-        clone.freeze();
+        clone.transition(DefaultCitation.State.FINAL);
         assertEquals("original.state", DefaultCitation.State.EDITABLE, original.state());
         assertEquals("clone.state",    DefaultCitation.State.FINAL,    clone.state());
         assertEquals(original, clone);
@@ -211,7 +211,7 @@ public final strictfp class DefaultCitationTest extends TestUsingFile
{
      * Verifies that {@code actual} is an unmodifiable copy of {@code expected}.
      */
     private static <T> void assertCopy(final Collection<T> expected, final Collection<T>
actual) {
-        assertNotSame("ModifiableMetadata.freeze() shall have copied the collection.", expected,
actual);
+        assertNotSame("ModifiableMetadata.transition(FINAL) shall have copied the collection.",
expected, actual);
         assertEquals("The copied collection shall have the same content than the original.",
expected, actual);
         try {
             actual.add(null);
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
index 78feb24..e956cd6 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
@@ -50,7 +50,7 @@ public final strictfp class HardCodedCitations extends Static {
         c.getAlternateTitles().add(new SimpleInternationalString("ISO 19111"));
         c.getIdentifiers().add(new ImmutableIdentifier(null, "ISO", "19111"));
         c.getPresentationForms().add(PresentationForm.DOCUMENT_DIGITAL);
-        c.freeze();
+        c.transition(DefaultCitation.State.FINAL);
         ISO_19111 = c;
     }
 
@@ -61,7 +61,7 @@ public final strictfp class HardCodedCitations extends Static {
     static {
         final DefaultCitation c = new DefaultCitation("ISO 19115");
         c.getPresentationForms().add(PresentationForm.DOCUMENT_DIGITAL);
-        c.freeze();
+        c.transition(DefaultCitation.State.FINAL);
         ISO_19115 = c;
     }
 
@@ -99,7 +99,7 @@ public final strictfp class HardCodedCitations extends Static {
         c.getPresentationForms().add(PresentationForm.TABLE_DIGITAL);
         c.getIdentifiers().add(new DefaultIdentifier(Constants.EPSG));
         c.getCitedResponsibleParties().add(p);
-        c.freeze();
+        c.transition(DefaultCitation.State.FINAL);
         EPSG = c;
     }
 
@@ -109,7 +109,7 @@ public final strictfp class HardCodedCitations extends Static {
     public static final DefaultCitation SIS;
     static {
         final DefaultCitation c = new DefaultCitation(Constants.SIS);
-        c.freeze();
+        c.transition(DefaultCitation.State.FINAL);
         SIS = c;
     }
 
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFractionTest.java
b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFractionTest.java
index f81a76e..700f075 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFractionTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFractionTest.java
@@ -111,7 +111,7 @@ public final strictfp class DefaultRepresentativeFractionTest extends
TestCase {
 
     /**
      * Tests indirectly {@link DefaultRepresentativeFraction#freeze()}.
-     * This method verifies that a call to {@link DefaultResolution#freeze()}
+     * This method verifies that a call to {@code DefaultResolution.transition(FINAL)}
      * implies a call to {@link DefaultRepresentativeFraction#freeze()}.
      *
      * @since 0.7
@@ -120,7 +120,7 @@ public final strictfp class DefaultRepresentativeFractionTest extends
TestCase {
     public void testFreeze() {
         final DefaultRepresentativeFraction fraction = new DefaultRepresentativeFraction(1000);
         final DefaultResolution resolution = new DefaultResolution(fraction);
-        resolution.apply(DefaultResolution.State.FINAL);
+        resolution.transition(DefaultResolution.State.FINAL);
         assertSame(fraction, resolution.getEquivalentScale());
         try {
             fraction.setDenominator(10);
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 3803aa1..f7b8596 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
@@ -108,12 +108,11 @@ public final class PositionalAccuracyConstant extends DefaultAbsoluteExternalPos
             final InternationalString evaluationMethodDescription, final boolean pass)
     {
         DefaultConformanceResult result = new DefaultConformanceResult(Citations.SIS, evaluationMethodDescription,
pass);
-        result.freeze();
         setResults(Collections.singleton(result));
         setMeasureDescription(measureDescription);
         setEvaluationMethodDescription(evaluationMethodDescription);
         setEvaluationMethodType(EvaluationMethodType.DIRECT_INTERNAL);
-        freeze();
+        transition(State.FINAL);
     }
 
     /**
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
index 2b07667..521921d 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
@@ -79,8 +79,8 @@ import org.apache.sis.util.ArgumentChecks;
  * <div class="section">Immutability and thread safety</div>
  * This class is immutable and thus inherently thread-safe if the {@link Citation} and {@link
InternationalString}
  * arguments given to the constructor are also immutable. It is caller's responsibility to
ensure that those
- * conditions hold, for example by invoking {@link org.apache.sis.metadata.iso.citation.DefaultCitation#freeze()
- * DefaultCitation.freeze()} before passing the arguments to the constructor.
+ * conditions hold, for example by invoking {@link org.apache.sis.metadata.iso.citation.DefaultCitation#transition
+ * DefaultCitation.transition(DefaultCitation.State.FINAL)} before passing the arguments
to the constructor.
  * Subclasses shall make sure that any overridden methods remain safe to call from multiple
threads and do not change
  * any public {@code NamedIdentifier} state.
  *
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
index a7c40eb..7bbbb01 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
@@ -486,7 +486,7 @@ addURIs:    for (int i=0; ; i++) {
         } catch (SQLException exception) {
             unexpectedException("getAuthority", exception);
         } finally {
-            c.apply(DefaultCitation.State.FINAL);
+            c.transition(DefaultCitation.State.FINAL);
         }
         return c;
     }
@@ -2049,7 +2049,7 @@ addURIs:    for (int i=0; ; i++) {
                 }
                 if (description != null || bbox != null) {
                     DefaultExtent extent = new DefaultExtent(description, bbox, null, null);
-                    extent.freeze();
+                    extent.transition(DefaultExtent.State.FINAL);
                     returnValue = ensureSingleton(extent, returnValue, code);
                 }
             }
diff --git a/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
b/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
index 1d99247..2e2e142 100644
--- a/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
+++ b/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
@@ -980,7 +980,7 @@ final class LandsatReader {
                 }
             }
             result.setMetadataStandards(Citations.ISO_19115);
-            result.apply(DefaultMetadata.State.FINAL);
+            result.transition(DefaultMetadata.State.FINAL);
         }
         return result;
     }
diff --git a/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java
b/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java
index e32b6bd..2428e8a 100644
--- a/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java
+++ b/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java
@@ -257,7 +257,7 @@ public class Proj4Factory extends GeodeticAuthorityFactory implements
CRSAuthori
             if (release != null) {
                 final DefaultCitation df = new DefaultCitation(c);
                 df.setEdition(new SimpleInternationalString(release));
-                df.freeze();
+                df.transition(DefaultCitation.State.FINAL);
                 c = df;
             }
             authority = c;
diff --git a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
index b9c5597..d946f82 100644
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
@@ -150,7 +150,7 @@ public class NetcdfStore extends DataStore implements Aggregate {
             final MetadataReader reader = new MetadataReader(decoder);
             metadata = reader.read();
             if (metadata instanceof ModifiableMetadata) {
-                ((ModifiableMetadata) metadata).apply(ModifiableMetadata.State.FINAL);
+                ((ModifiableMetadata) metadata).transition(ModifiableMetadata.State.FINAL);
             }
         } catch (IOException e) {
             throw new DataStoreException(e);
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractFeatureSet.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractFeatureSet.java
index afecc91..8cd92d9 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractFeatureSet.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractFeatureSet.java
@@ -92,7 +92,7 @@ public abstract class AbstractFeatureSet extends AbstractResource implements
Fea
                 }
             }
             // No geographic extent - see above javadoc.
-            metadata.apply(DefaultMetadata.State.FINAL);
+            metadata.transition(DefaultMetadata.State.FINAL);
             this.metadata = metadata;
         }
         return metadata;
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
index 7b1eac6..f7bffd2 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
@@ -2876,7 +2876,7 @@ parse:      for (int i = 0; i < length;) {
         final DefaultMetadata md = metadata;
         metadata = null;
         if (freeze && md != null) {
-            md.apply(DefaultMetadata.State.FINAL);
+            md.transition(DefaultMetadata.State.FINAL);
         }
         return md;
     }


Mime
View raw message