[jira] [Commented] (AVRO-2808) Java: ReflectData incorrectly handles hidden fields

2020-05-19 Thread Hudson (Jira)


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

Hudson commented on AVRO-2808:
--

SUCCESS: Integrated in Jenkins build AvroJava #876 (See 
[https://builds.apache.org/job/AvroJava/876/])
AVRO-2808: provide details while encountering non-static inner classes (github: 
[https://github.com/apache/avro/commit/efd6cda8bf9a025ca2847fe8900ac590305facf6])
* (edit) lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectData.java
* (edit) 
lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflectData.java


> Java: ReflectData incorrectly handles hidden fields
> ---
>
> Key: AVRO-2808
> URL: https://issues.apache.org/jira/browse/AVRO-2808
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Andy Le
>Assignee: Andy Le
>Priority: Major
> Fix For: 1.10.0
>
>
> Hi guys,
> I've got the following test:
> {code:java}
> public ReflectTest{
>   public class Definition {
> public Map tokens;
>   }
>   public enum Type {
> A,
> B,
> C
>   }
>   @Test
>   public void testAvro2805() {
> Schema schema = ReflectData.get().getSchema(Definition.class);
> final String schemaString = schema.toString(true);
> System.out.println(schemaString);
>   }
> }
> {code}
> When I ran the test, an exception is raised:
> {noformat}
> org.apache.avro.SchemaParseException: Illegal character in: this$0
>   at org.apache.avro.Schema.validateName(Schema.java:1530)
>   at org.apache.avro.Schema.access$400(Schema.java:87)
>   at org.apache.avro.Schema$Field.(Schema.java:518)
>   at org.apache.avro.Schema$Field.(Schema.java:557)
>   at 
> org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:683)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:335)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:332)
> {noformat}
> From the log, you may see that: we should not handle Java hidden field 
> `this$0` which is used to hold reference to outer class instances.
> This issue is somehow related to [this 
> one|https://issues.apache.org/jira/browse/AVRO-2805]



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


[jira] [Commented] (AVRO-2808) Java: ReflectData incorrectly handles hidden fields

2020-05-06 Thread Ryan Skraba (Jira)


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

Ryan Skraba commented on AVRO-2808:
---

Ah!  Yes, that sounds like a good change to clarify what is wrong to the user.

> Java: ReflectData incorrectly handles hidden fields
> ---
>
> Key: AVRO-2808
> URL: https://issues.apache.org/jira/browse/AVRO-2808
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Andy Le
>Priority: Major
>
> Hi guys,
> I've got the following test:
> {code:java}
> public ReflectTest{
>   public class Definition {
> public Map tokens;
>   }
>   public enum Type {
> A,
> B,
> C
>   }
>   @Test
>   public void testAvro2805() {
> Schema schema = ReflectData.get().getSchema(Definition.class);
> final String schemaString = schema.toString(true);
> System.out.println(schemaString);
>   }
> }
> {code}
> When I ran the test, an exception is raised:
> {noformat}
> org.apache.avro.SchemaParseException: Illegal character in: this$0
>   at org.apache.avro.Schema.validateName(Schema.java:1530)
>   at org.apache.avro.Schema.access$400(Schema.java:87)
>   at org.apache.avro.Schema$Field.(Schema.java:518)
>   at org.apache.avro.Schema$Field.(Schema.java:557)
>   at 
> org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:683)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:335)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:332)
> {noformat}
> From the log, you may see that: we should not handle Java hidden field 
> `this$0` which is used to hold reference to outer class instances.
> This issue is somehow related to [this 
> one|https://issues.apache.org/jira/browse/AVRO-2805]



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


[jira] [Commented] (AVRO-2808) Java: ReflectData incorrectly handles hidden fields

2020-05-06 Thread Andy Le (Jira)


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

Andy Le commented on AVRO-2808:
---

[~rskraba] nice to see you here.

> I think this should be the expected behaviour for non-static inner classes!

Fine for me. The question is: should we customize the exception to display a 
more meaningful message to users?

> Java: ReflectData incorrectly handles hidden fields
> ---
>
> Key: AVRO-2808
> URL: https://issues.apache.org/jira/browse/AVRO-2808
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Andy Le
>Priority: Major
>
> Hi guys,
> I've got the following test:
> {code:java}
> public ReflectTest{
>   public class Definition {
> public Map tokens;
>   }
>   public enum Type {
> A,
> B,
> C
>   }
>   @Test
>   public void testAvro2805() {
> Schema schema = ReflectData.get().getSchema(Definition.class);
> final String schemaString = schema.toString(true);
> System.out.println(schemaString);
>   }
> }
> {code}
> When I ran the test, an exception is raised:
> {noformat}
> org.apache.avro.SchemaParseException: Illegal character in: this$0
>   at org.apache.avro.Schema.validateName(Schema.java:1530)
>   at org.apache.avro.Schema.access$400(Schema.java:87)
>   at org.apache.avro.Schema$Field.(Schema.java:518)
>   at org.apache.avro.Schema$Field.(Schema.java:557)
>   at 
> org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:683)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:335)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:332)
> {noformat}
> From the log, you may see that: we should not handle Java hidden field 
> `this$0` which is used to hold reference to outer class instances.
> This issue is somehow related to [this 
> one|https://issues.apache.org/jira/browse/AVRO-2805]



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


[jira] [Commented] (AVRO-2808) Java: ReflectData incorrectly handles hidden fields

2020-05-06 Thread Ryan Skraba (Jira)


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

Ryan Skraba commented on AVRO-2808:
---

I think this should be the expected behaviour for non-static inner classes!

Unless I misunderstand the issue, there's no way to "reconstitute" an instance 
of a non-static inner class without having a reference to the parent.

Would this be useful for serializing a {{ReflectTest$Definition}} instance and 
then deserializing it as a {{GenericRecord}}?

Or for doing a round-trip to-and-from {{ReflectTest$Definition}} in the context 
of the parent instance, somehow?

> Java: ReflectData incorrectly handles hidden fields
> ---
>
> Key: AVRO-2808
> URL: https://issues.apache.org/jira/browse/AVRO-2808
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Andy Le
>Priority: Major
>
> Hi guys,
> I've got the following test:
> {code:java}
> public ReflectTest{
>   public class Definition {
> public Map tokens;
>   }
>   public enum Type {
> A,
> B,
> C
>   }
>   @Test
>   public void testAvro2805() {
> Schema schema = ReflectData.get().getSchema(Definition.class);
> final String schemaString = schema.toString(true);
> System.out.println(schemaString);
>   }
> }
> {code}
> When I ran the test, an exception is raised:
> {noformat}
> org.apache.avro.SchemaParseException: Illegal character in: this$0
>   at org.apache.avro.Schema.validateName(Schema.java:1530)
>   at org.apache.avro.Schema.access$400(Schema.java:87)
>   at org.apache.avro.Schema$Field.(Schema.java:518)
>   at org.apache.avro.Schema$Field.(Schema.java:557)
>   at 
> org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:683)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:335)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:332)
> {noformat}
> From the log, you may see that: we should not handle Java hidden field 
> `this$0` which is used to hold reference to outer class instances.
> This issue is somehow related to [this 
> one|https://issues.apache.org/jira/browse/AVRO-2805]



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


[jira] [Commented] (AVRO-2808) Java: ReflectData incorrectly handles hidden fields

2020-04-19 Thread Andy Le (Jira)


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

Andy Le commented on AVRO-2808:
---

I think we can ignore fields `this$0`. Should I make a PR against this issue?

> Java: ReflectData incorrectly handles hidden fields
> ---
>
> Key: AVRO-2808
> URL: https://issues.apache.org/jira/browse/AVRO-2808
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Andy Le
>Priority: Major
>
> Hi guys,
> I've got the following test:
> {code:java}
> public ReflectTest{
>   public class Definition {
> public Map tokens;
>   }
>   public enum Type {
> A,
> B,
> C
>   }
>   @Test
>   public void testAvro2805() {
> Schema schema = ReflectData.get().getSchema(Definition.class);
> final String schemaString = schema.toString(true);
> System.out.println(schemaString);
>   }
> }
> {code}
> When I ran the test, an exception is raised:
> {noformat}
> org.apache.avro.SchemaParseException: Illegal character in: this$0
>   at org.apache.avro.Schema.validateName(Schema.java:1530)
>   at org.apache.avro.Schema.access$400(Schema.java:87)
>   at org.apache.avro.Schema$Field.(Schema.java:518)
>   at org.apache.avro.Schema$Field.(Schema.java:557)
>   at 
> org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:683)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:335)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:332)
> {noformat}
> From the log, you may see that: we should not handle Java hidden field 
> `this$0` which is used to hold reference to outer class instances.
> This issue is somehow related to [this 
> one|https://issues.apache.org/jira/browse/AVRO-2805]



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


[jira] [Commented] (AVRO-2808) Java: ReflectData incorrectly handles hidden fields

2020-04-19 Thread Andy Le (Jira)


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

Andy Le commented on AVRO-2808:
---

[~cutting] [~sekikn] PATL

> Java: ReflectData incorrectly handles hidden fields
> ---
>
> Key: AVRO-2808
> URL: https://issues.apache.org/jira/browse/AVRO-2808
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.9.2
>Reporter: Andy Le
>Priority: Major
>
> Hi guys,
> I've got the following test:
> {code:java}
> public ReflectTest{
>   public class Definition {
> public Map tokens;
>   }
>   public enum Type {
> A,
> B,
> C
>   }
>   @Test
>   public void testAvro2805() {
> Schema schema = ReflectData.get().getSchema(Definition.class);
> final String schemaString = schema.toString(true);
> System.out.println(schemaString);
>   }
> }
> {code}
> When I ran the test, an exception is raised:
> {noformat}
> org.apache.avro.SchemaParseException: Illegal character in: this$0
>   at org.apache.avro.Schema.validateName(Schema.java:1530)
>   at org.apache.avro.Schema.access$400(Schema.java:87)
>   at org.apache.avro.Schema$Field.(Schema.java:518)
>   at org.apache.avro.Schema$Field.(Schema.java:557)
>   at 
> org.apache.avro.reflect.ReflectData.createSchema(ReflectData.java:683)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:335)
>   at 
> org.apache.avro.specific.SpecificData$3.computeValue(SpecificData.java:332)
> {noformat}
> From the log, you may see that: we should not handle Java hidden field 
> `this$0` which is used to hold reference to outer class instances.
> This issue is somehow related to [this 
> one|https://issues.apache.org/jira/browse/AVRO-2805]



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