Closed GoogleCodeExporter closed 9 years ago
How is that better than simply marking the method @deprecated?
Can you list some specific use-cases where @NotSince will be better than
@deprecated?
Original comment by inder123
on 26 Sep 2008 at 7:39
Maybe I'm misunderstanding Gson's functionality. Assume the following example:
public class Person {
private int age;
@Since(1.1) private int birthYear;
}
new GsonBuilder().setVersion(1.0).create().toJson(new Person()) => "{age: 0}"
new GsonBuilder().setVersion(1.1).create().toJson(new Person()) => "{age: 0,
birthYear: 0}"
I would like to replace the field, as in (renaming @NotSince to @Until):
public class Person {
@Until(1.1) private int age;
@Since(1.1) private int birthYear;
}
So that:
new GsonBuilder().setVersion(1.0).create().toJson(new Person()) => "{age: 0}"
new GsonBuilder().setVersion(1.1).create().toJson(new Person()) => "{birthYear:
0}"
Original comment by ch...@gmail.com
on 27 Sep 2008 at 12:22
Inderjeet and I have discussed that we needed some way to "version" field
deletions
from classes, but have not put much thought into it. The above proposal seems
like a
pretty good solution.
I prefer "Until" as it fits well with the "Since" annotation.
Original comment by joel.leitch@gmail.com
on 27 Sep 2008 at 6:38
Original comment by joel.leitch@gmail.com
on 13 Oct 2008 at 7:13
Enhancement submitted in r322.
Original comment by joel.leitch@gmail.com
on 1 Dec 2008 at 12:10
Original issue reported on code.google.com by
ch...@gmail.com
on 26 Sep 2008 at 7:28