Closed GoogleCodeExporter closed 9 years ago
Working as intended.
If the age fields can be different, use @SerializedName() on one or more of
them to give it an unambiguous name. If they're the same, remove the age field
declaration on 'b'.
http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/a
nnotations/SerializedName.html
Original comment by limpbizkit
on 11 Jan 2012 at 4:50
What if Class A is an abstract parent class? The error still happens. I
shouldn't have to put an annotation on an abstract class that would never be
used with gson should I?
Original comment by ianwal...@gmail.com
on 15 Aug 2012 at 11:47
I just bumped into this issue. Where the parent class were abstract. And I
cannot modify that class since I'm not the author but I need to serialize it.
Original comment by lajvbuti...@gmail.com
on 10 Nov 2012 at 8:30
What steps will reproduce the problem?
1.class A declared a field age
2.class B extends A and also declared a field age
3.new an instance of class B
4.convert the newed B instance to json
5.java.lang.IllegalArgumentException: class B declares multiple JSON fields
named age
Original comment by atsakthi...@gmail.com
on 27 Mar 2013 at 12:52
I have posted a question on stackoverflow with same problem. Can anybody answer
it?
Question can be found at:
http://stackoverflow.com/questions/15756551/solr-java-error-class-com-restfb-typ
es-post-declares-multiple-json-fields-named
Original comment by ndthokar...@gmail.com
on 2 Apr 2013 at 2:29
Original issue reported on code.google.com by
jackydu1...@gmail.com
on 11 Jan 2012 at 3:50