[ 
https://issues.apache.org/jira/browse/AVRO-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13924134#comment-13924134
 ] 

Doug Cutting commented on AVRO-1476:
------------------------------------

The question is, if we made it serializable, would we want to serialize this 
field?  I'd suggest not.  What application is harmed by this declaration?

Avro reflect ignores fields that are declared as transient.  I suspect the 
origin of this declaration is that I was looking at the schema that reflect 
generated for Schema.  However there are now a number of other fields in 
Schema.java which should also be declared transient and are not.  For example, 
RecordSchema#fieldMap, Name#full, etc.  These, like Field#position, are 
computed from other fields and cached, but were added after Field#position and 
not declared transient.

Since we're not consistent about transient declarations in Schema.java, 
removing this one should be harmless.

> Make position field of org.apache.avro.Schema not transient.
> ------------------------------------------------------------
>
>                 Key: AVRO-1476
>                 URL: https://issues.apache.org/jira/browse/AVRO-1476
>             Project: Avro
>          Issue Type: Task
>          Components: java
>    Affects Versions: 1.8.0, 1.7.7
>            Reporter: Robert Chu
>            Priority: Minor
>         Attachments: AVRO-1476.patch
>
>
> Referring to: 
> https://github.com/apache/avro/blob/trunk/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L358
> [~kryzthov] did some research into possible causes/reasons for this field to 
> be marked as transient but was unable to find any reason. The 
> org.apache.avro.Schema class is not marked as serializable so this transient 
> field serves no purpose. This transient field can cause odd behaviors with 
> external serialization frameworks (and the built-in java serialization 
> framework) when trying to serialize schemas.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to