parispurchase / json-io

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

Feature request: optionally allow skipping of transient fields #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Would you consider an option to the JsonWriter to skip transient fields? I'm 
happy to send a patch.

Original issue reported on code.google.com by mathewmi...@gmail.com on 1 Feb 2013 at 6:12

GoogleCodeExporter commented 9 years ago
I'd appreciate a patch to skip transient fields!

Martyn

Original comment by martynwe...@gmail.com on 7 Feb 2013 at 3:30

GoogleCodeExporter commented 9 years ago
Version 2.0.1, JsonWriter.java line 1628:

                    if ((field.getModifiers() & Modifier.STATIC) == 0 && (field.getModifiers() & Modifier.TRANSIENT) == 0)

Original comment by edsum...@gmail.com on 14 Feb 2013 at 3:11

Attachments:

GoogleCodeExporter commented 9 years ago
Today that was exactly what I was looking for as I came around one cannot 
exclude transient fields. Many thanks @edsum. Works as expected.

Original comment by KodyReco...@gmail.com on 15 Feb 2013 at 3:51

GoogleCodeExporter commented 9 years ago
i have tried the modification by edsum but with the edit i get a stackOF, 
writeObject, writeImpl over & over again. Without the modification the class 
serialized fine to json, but will not deserialize.

Original comment by Jug6ern...@gmail.com on 14 Mar 2013 at 2:13

GoogleCodeExporter commented 9 years ago
Damn ur right. I came back as I had exactly the same stack overflow.

Original comment by KodyReco...@gmail.com on 26 Mar 2013 at 12:04

GoogleCodeExporter commented 9 years ago
This is fixed.

The proposed change excludes transient fields from being considered during the 
reference trace, which is will not work.  Instead, all fields must be 
considered during the reference trace, but the writeObject() API when walking 
fields, skips writing fields that are transient.

Original comment by jdereg@gmail.com on 7 Sep 2013 at 4:45

GoogleCodeExporter commented 9 years ago
this is fixed, tested, and closed.

Original comment by jdereg@gmail.com on 29 Sep 2013 at 1:51