Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2372

Compiler can generate breaking code when there are cross-namespace type references

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.9.0
    • None
    • java
    • None

    Description

      Problem

      With the current version of 1.9.0-SNAPSHOT (as of 9th of April 2019) the java compiler generates broken code under 2 circumstances:

      1. Type A (e.g. foo.A) references Type B from a different namespace (e.g. bar.B)
      2. Both types fulfill the criteria of SpecificCompiler.isCustomCodable(..)

      This generates code where foo.A is generated with a protected customCode(...) which calls out to bar.B's protected customCode(...). This breaks as A cannot access B's protected methods.

       Possible solutions

      1. Change the isCustomCodeable criteria in such a way that it fails for namespace-crossing type-references
      2. Open up access to customCode/customDecode. This may expose internals though.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bzikarsky.jaumo Benjamin Zikarsky
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: