discomarathon / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Using excludeFieldsWithoutExposeAnnotation can write empty objects #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build a Gson object using GsonBuilder.excludeFieldsWithoutExposeAnnotation()
2. Annotate a class variable with @Expose
3. Write an instance of the class with the variable that was exposed null

What is the expected output? What do you see instead?
I expected to see nothing written for that object, since it should be
empty, instead, I see an empty object.

What version of the product are you using? On what operating system?
1.1.1

Please provide any additional information below.
I have attached a unit test that demonstrates this issue.

Original issue reported on code.google.com by ericmu...@gmail.com on 6 Aug 2008 at 6:16

Attachments:

GoogleCodeExporter commented 9 years ago
This issue is discussed in the following thread: 

http://groups.google.com/group/google-gson/browse_thread/thread/a9933f2ea9d43ad5
?hl=en

Original comment by inder123 on 7 Aug 2008 at 5:22

GoogleCodeExporter commented 9 years ago
As per the conclusion in the discussion thread, we will not be supporting this
features since it alters the semantics of a list. 

Original comment by inder123 on 8 Aug 2008 at 6:22