sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Desruisseaux (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SIS-410) More stable MathTransform.Inverse serialization
Date Mon, 05 Mar 2018 13:58:00 GMT
Martin Desruisseaux created SIS-410:
---------------------------------------

             Summary: More stable MathTransform.Inverse serialization
                 Key: SIS-410
                 URL: https://issues.apache.org/jira/browse/SIS-410
             Project: Spatial Information Systems
          Issue Type: New Feature
          Components: Referencing
    Affects Versions: 0.8, 0.7, 0.6, 0.5
            Reporter: Martin Desruisseaux
            Assignee: Martin Desruisseaux
             Fix For: 1.0


The {{AbstractMathTransform.Inverse}} class is non-static. This cause the compiler to generate
a {{this$0}} private field. But this synthetic fields may not be the same across implementations
of different Java compilers. Consequently reading a class serialized with an Apache SIS library
compiled with a different compiler may not recognize the fields that are named differently
(see http://developer.java.sun.com/developer/bugParade/bugs/4211550.html). We should use static
inner class with a named field (e.g. {{"forward"}})instead. This is an incompatible change,
but {{AbstractMathTransform.Inverse}} is protected rather than public.

In the particular case of {{AbstractMathTransform.Inverse}}, it also avoid a minor strangeness.
Since we extends {{Inverse}} in different classes, we saw the synthetic {{this$0}} field duplicated
in each subclass. Using a named field instead will avoid that.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message