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)

Reply via email to