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

Doug Cutting commented on AVRO-171:
-----------------------------------

> It might be nice to have a one-line comment about what "Names" is intended 
> for in its javadoc.

Names is not a publicly visible class, so it needs no javadoc.  That said, more 
comments for Schema.java's internal classes might be good, but that's a 
separate issue, I think.  This patch doesn't make that any worse.

> I think you're pushing the no-braces legibility with two lines inside the 
> for-loop.

Indentation tells the story pretty clearly, I think.  Personally, I rely more 
on indentation when reading code than on braces.  Unneeded braces just consume 
lines, reducing the amount of logic on the screen at a time, making the code 
harder to understand.


> Protocol Introspection can produce invalid forward references
> -------------------------------------------------------------
>
>                 Key: AVRO-171
>                 URL: https://issues.apache.org/jira/browse/AVRO-171
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.2.0
>         Environment: java
>            Reporter: Mr Fish
>            Assignee: Doug Cutting
>             Fix For: 1.3.0
>
>         Attachments: AVRO-171.patch
>
>
> Take a look at this code which is what happens in the SpecificResponder 
> handshake.
>         // server side
>         final Protocol protocol = 
> ReflectData.get().getProtocol(MyServiceIface.class);
>         final String string = protocol.toString();
>         // client side
>         Protocol.parse(string);
> If you have a compound object made of 
> class A {
>     B1 b1;
>     B2 b2;
> }
> class B1 {
>     X x;
> }
> class B2 {
>     X x;
> }
> class X {
>  int i;
> }
> Then the types will be built up by RefectData.createSchema()
> A, B1, X, B2
> This is then reversed by RefectData.getProtocol() so B1 has no forward 
> reference
> B2, X, B1, A.
> But this breaks B2
> org.apache.avro.SchemaParseException: Undefined name: "X"
>   

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to