[jira] [Commented] (AVRO-2419) Generate private attribute in Java

2020-05-21 Thread Hudson (Jira)


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

Hudson commented on AVRO-2419:
--

SUCCESS: Integrated in Jenkins build AvroJava #881 (See 
[https://builds.apache.org/job/AvroJava/881/])
AVRO-2419:Avro-tools should support fieldvisibility settings like (dkulp: 
[https://github.com/apache/avro/commit/acce806f68282a2b02f07e06ab304d2ae3fc308e])
* (edit) 
lang/java/tools/src/main/java/org/apache/avro/tool/SpecificCompilerTool.java
* (edit) 
lang/java/tools/src/test/java/org/apache/avro/tool/TestSpecificCompilerTool.java
* (edit) pom.xml
* (add) lang/java/tools/src/test/compiler/input/fieldvisibilitytest.avsc
* (add) lang/java/tools/src/test/compiler/output/FieldVisibilityTest.java


> Generate private attribute in Java
> --
>
> Key: AVRO-2419
> URL: https://issues.apache.org/jira/browse/AVRO-2419
> Project: Apache Avro
>  Issue Type: Wish
>  Components: java
>Affects Versions: 1.7.7
>Reporter: khuynhthanhchiluyen
>Assignee: Zezeng Wang
>Priority: Major
> Fix For: 1.10.0
>
>
> I used file user.avsc like below:
> {  
>     "namespace":"example.avro",
>     "type":"record",
>     "name":"User",
>     "fields":[  
>    
> {    "name":"name",  "type":"string"   }
> ,
>    
> {    "name":"favorite_number",  "type":[   "int", 
> "null"  ]   }
> ,
>    
> {    "name":"favorite_color",  "type":[   
> "string", "null"  ]   }
>    ]
>  }
>  
> And I used avro-1.7.7.jar to generate my Java code:
> java -jar java -jar avro-tools-1.7.7.jar compile -string schema user.avsc 
> D:\result
>  
> But all attributes of User class (name, favorite_number, favorite_color) 
> appear to be "public". Where did I miss to make them private (for 
> encapsulation). Thank you very much.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2419) Generate private attribute in Java

2020-05-21 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on AVRO-2419:
---

Commit acce806f68282a2b02f07e06ab304d2ae3fc308e in avro's branch 
refs/heads/master from zeshuai007
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=acce806 ]

AVRO-2419:Avro-tools should support fieldvisibility settings like 
avro-maven-plugin
AVRO-2419:pom.xml exclude FieldVisibilityTest.java
Update SpecificCompilerTool.java
Import Locale package
Closes #678


> Generate private attribute in Java
> --
>
> Key: AVRO-2419
> URL: https://issues.apache.org/jira/browse/AVRO-2419
> Project: Apache Avro
>  Issue Type: Wish
>  Components: java
>Affects Versions: 1.7.7
>Reporter: khuynhthanhchiluyen
>Assignee: Zezeng Wang
>Priority: Major
>
> I used file user.avsc like below:
> {  
>     "namespace":"example.avro",
>     "type":"record",
>     "name":"User",
>     "fields":[  
>    
> {    "name":"name",  "type":"string"   }
> ,
>    
> {    "name":"favorite_number",  "type":[   "int", 
> "null"  ]   }
> ,
>    
> {    "name":"favorite_color",  "type":[   
> "string", "null"  ]   }
>    ]
>  }
>  
> And I used avro-1.7.7.jar to generate my Java code:
> java -jar java -jar avro-tools-1.7.7.jar compile -string schema user.avsc 
> D:\result
>  
> But all attributes of User class (name, favorite_number, favorite_color) 
> appear to be "public". Where did I miss to make them private (for 
> encapsulation). Thank you very much.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2419) Generate private attribute in Java

2020-05-21 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on AVRO-2419:
---

Commit acce806f68282a2b02f07e06ab304d2ae3fc308e in avro's branch 
refs/heads/master from zeshuai007
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=acce806 ]

AVRO-2419:Avro-tools should support fieldvisibility settings like 
avro-maven-plugin
AVRO-2419:pom.xml exclude FieldVisibilityTest.java
Update SpecificCompilerTool.java
Import Locale package
Closes #678


> Generate private attribute in Java
> --
>
> Key: AVRO-2419
> URL: https://issues.apache.org/jira/browse/AVRO-2419
> Project: Apache Avro
>  Issue Type: Wish
>  Components: java
>Affects Versions: 1.7.7
>Reporter: khuynhthanhchiluyen
>Assignee: Zezeng Wang
>Priority: Major
>
> I used file user.avsc like below:
> {  
>     "namespace":"example.avro",
>     "type":"record",
>     "name":"User",
>     "fields":[  
>    
> {    "name":"name",  "type":"string"   }
> ,
>    
> {    "name":"favorite_number",  "type":[   "int", 
> "null"  ]   }
> ,
>    
> {    "name":"favorite_color",  "type":[   
> "string", "null"  ]   }
>    ]
>  }
>  
> And I used avro-1.7.7.jar to generate my Java code:
> java -jar java -jar avro-tools-1.7.7.jar compile -string schema user.avsc 
> D:\result
>  
> But all attributes of User class (name, favorite_number, favorite_color) 
> appear to be "public". Where did I miss to make them private (for 
> encapsulation). Thank you very much.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2419) Generate private attribute in Java

2019-10-12 Thread Zezeng Wang (Jira)


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

Zezeng Wang commented on AVRO-2419:
---

[~khuynhthanhchiluyen]
Hey, huslsls, have you found a solution?
I suggest you raise the avro version to 1.9.0, because after avro-1.9.0, the 
generated java class attribute has defaulted to private, but unfortunately, if 
you use avro-tools, it does not support setting fieldvisibility. Value function


> Generate private attribute in Java
> --
>
> Key: AVRO-2419
> URL: https://issues.apache.org/jira/browse/AVRO-2419
> Project: Apache Avro
>  Issue Type: Wish
>  Components: java
>Affects Versions: 1.7.7
>Reporter: khuynhthanhchiluyen
>Priority: Major
>
> I used file user.avsc like below:
> {  
>     "namespace":"example.avro",
>     "type":"record",
>     "name":"User",
>     "fields":[  
>    
> {    "name":"name",  "type":"string"   }
> ,
>    
> {    "name":"favorite_number",  "type":[   "int", 
> "null"  ]   }
> ,
>    
> {    "name":"favorite_color",  "type":[   
> "string", "null"  ]   }
>    ]
>  }
>  
> And I used avro-1.7.7.jar to generate my Java code:
> java -jar java -jar avro-tools-1.7.7.jar compile -string schema user.avsc 
> D:\result
>  
> But all attributes of User class (name, favorite_number, favorite_color) 
> appear to be "public". Where did I miss to make them private (for 
> encapsulation). Thank you very much.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (AVRO-2419) Generate private attribute in Java

2019-09-29 Thread Zezeng Wang (Jira)


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

Zezeng Wang commented on AVRO-2419:
---

[~khuynhthanhchiluyen]
If you pass in the fieldVisibility=private parameter then  your fields will be 
private.
E.g:

${project.basedir}/src/main/avro
${project.basedir}/src/main/java
PRIVATE

However, I think it should be private by default.

> Generate private attribute in Java
> --
>
> Key: AVRO-2419
> URL: https://issues.apache.org/jira/browse/AVRO-2419
> Project: Apache Avro
>  Issue Type: Wish
>  Components: java
>Affects Versions: 1.7.7
>Reporter: khuynhthanhchiluyen
>Priority: Major
>
> I used file user.avsc like below:
> {  
>     "namespace":"example.avro",
>     "type":"record",
>     "name":"User",
>     "fields":[  
>    
> {    "name":"name",  "type":"string"   }
> ,
>    
> {    "name":"favorite_number",  "type":[   "int", 
> "null"  ]   }
> ,
>    
> {    "name":"favorite_color",  "type":[   
> "string", "null"  ]   }
>    ]
>  }
>  
> And I used avro-1.7.7.jar to generate my Java code:
> java -jar java -jar avro-tools-1.7.7.jar compile -string schema user.avsc 
> D:\result
>  
> But all attributes of User class (name, favorite_number, favorite_color) 
> appear to be "public". Where did I miss to make them private (for 
> encapsulation). Thank you very much.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)