Benjamin Zikarsky created AVRO-2372:
---------------------------------------
Summary: Compiler can gerade breaking code when there are
cross-namespace type references
Key: AVRO-2372
URL: https://issues.apache.org/jira/browse/AVRO-2372
Project: Apache Avro
Issue Type: Bug
Components: java
Affects Versions: 1.9.0
Reporter: Benjamin Zikarsky
*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:
# Type A (e.g. {{foo.A}}) references Type B from a different namespace (e.g.
{{bar.B}})
# 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*
# Change the {{isCustomCodeable}} criteria in such a way that it fails for
namespace-crossing type-references
# Open up access to customCode/customDecode. This may expose internals though.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)