Uploaded image for project: 'Spatial Information Systems'
  1. Spatial Information Systems
  2. SIS-410

More stable MathTransform.Inverse serialization

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.5, 0.6, 0.7, 0.8
    • 1.0
    • Referencing
    • None

    Description

      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.

      Attachments

        Activity

          People

            desruisseaux Martin Desruisseaux
            desruisseaux Martin Desruisseaux
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: