opwvhk commented on a change in pull request #985:
URL: https://github.com/apache/avro/pull/985#discussion_r733513111



##########
File path: 
lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj
##########
@@ -1296,20 +1300,11 @@ private void SchemaProperty(Map<String, JsonNode> 
properties):
 void FieldDeclaration(List<Field> fields):
 {
   Schema type;
-  Map<String, JsonNode> props = new LinkedHashMap<String, JsonNode>();
 }
 {
-  // TODO should we be able to specify properties on any Type?
-  // or just on field declarations as done here
-
-  ( SchemaProperty(props) )*
   type = Type()
   VariableDeclarator(type, fields) ( "," VariableDeclarator(type, fields) )*
   ";"
-  {
-    for (String key : props.keySet())
-      Accessor.addProp(type, key, props.get(key));

Review comment:
       The code here applied schema properties on the type. Which the Type() 
declaration does as well.
   It was basically doing the same thing twice.

##########
File path: lang/java/compiler/src/test/idl/input/simple.avdl
##########
@@ -60,6 +60,7 @@ protocol Simple {
     time_ms t = 0;
 
     @foo.bar("bar.foo") long l = 0;
+    @foo.bar.bar("foo.bar2") array<string> a = [];

Review comment:
       The code here applied schema properties on the type. Which the `Type()` 
declaration does as well.
   It was basically doing the same thing twice.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to