[ 
https://issues.apache.org/jira/browse/SIS-567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martin Desruisseaux updated SIS-567:
------------------------------------
    Affects Version/s: 1.3
                       1.2
                       1.1
                       1.0
                       0.8
                       0.7
                       0.6
                       0.5
                       0.4
                       0.3

> Resolve serialization compiler warnings
> ---------------------------------------
>
>                 Key: SIS-567
>                 URL: https://issues.apache.org/jira/browse/SIS-567
>             Project: Spatial Information Systems
>          Issue Type: Task
>          Components: Metadata, Referencing, Storage, Utilities
>    Affects Versions: 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 1.0, 1.1, 1.2, 1.3
>            Reporter: Martin Desruisseaux
>            Assignee: Martin Desruisseaux
>            Priority: Minor
>             Fix For: 1.4
>
>
> Since Java 18, the compiler emit the following warnings on many fields, 
> especially in metadata and referencing modules:
> {quote}
> Non-transient instance field of a serializable class declared with a 
> non-serializable type.
> {quote}
> In a lot of cases, the field type is an interface where all implementations 
> used in practice are serializable. We resolve those warnings with the 
> following annotation:
> {code:java}
> @SuppressWarnings("serial")         // Most SIS implementations are 
> serializable.
> {code}
> In a few cases the value can be anything (e.g. type of values in a 
> collection). We use the following annotation for them.
> {code:java}
> @SuppressWarnings("serial")         // Not statically typed as Serializable.
> {code}
> Finally there is a few classes where we could not yet resolve the warning:
> * {{org.apache.sis.internal.util.StandardDateFormat}} has a 
> {{java.time.format.DateTimeFormatter}} field, which is not serializable.
> * {{org.apache.sis.internal.referencing.provider.DatumShiftGridFile}} has a 
> {{java.nio.file.Path}} field.
> * {{org.apache.sis.gui.dataset.ResourceEvent}} has a {{java.nio.file.Path}} 
> field.
> For the later two, maybe {{Path}} could be replaced by {{URI}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to