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


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new 2e251092f4 Document `StandardDateFormat` has not intended for 
serialization. We verified that it was not used as non-transient field in a 
serialiable class.
2e251092f4 is described below

commit 2e251092f4db61a9fd13ff04213f229bca8e6ce6
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Sun Jan 15 11:06:35 2023 +0100

    Document `StandardDateFormat` has not intended for serialization.
    We verified that it was not used as non-transient field in a serialiable 
class.
    
    https://issues.apache.org/jira/browse/SIS-567
---
 .../org/apache/sis/internal/util/StandardDateFormat.java    | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
 
b/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
index 8664a042b7..db27b990a7 100644
--- 
a/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
+++ 
b/core/sis-utility/src/main/java/org/apache/sis/internal/util/StandardDateFormat.java
@@ -62,16 +62,17 @@ import org.apache.sis.util.CharSequences;
  * only hours, or only hours and minutes, <i>etc</i>. ISO 19162 said that the 
timezone is restricted to UTC
  * but nevertheless allows to specify a timezone.</p>
  *
+ * <h2>Serialization</h2>
+ * Despite inheriting the {@link java.io.Serializable} interface, this class 
is actually not serializable
+ * because the {@link #format} field is not serializable (a constraint of 
{@link java.time.format}).
+ * All usages in Apache SIS should be either in transient fields or in 
non-serializable classes.
+ *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 1.1
+ * @version 1.4
  * @since   0.6
  */
+@SuppressWarnings("serial")     // Not intended to be serialized.
 public final class StandardDateFormat extends DateFormat {
-    /**
-     * For cross-version compatibility.
-     */
-    private static final long serialVersionUID = 2764313272939921664L;
-
     /**
      * The {@value} timezone ID.
      *

Reply via email to