Details
-
Task
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 1.0, 1.1, 1.2, 1.3
-
None
Description
Since Java 18, the compiler emit the following warnings on many fields, especially in metadata and referencing modules:
Non-transient instance field of a serializable class declared with a non-serializable type.
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:
@SuppressWarnings("serial") // Most SIS implementations are serializable.
In a few cases the value can be anything (e.g. type of values in a collection). We use the following annotation for them.
@SuppressWarnings("serial") // Not statically typed as Serializable.
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.
Attachments
Issue Links
- depends upon
-
SIS-569 Replace Path by URI for datum shift grid files
- Closed