dfmotty / google-gson

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

DateTypeAdapter, others unnecessarily final #587

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
com.google.gson.internal.bind.DateTypeAdapter is final. Why?

It would be very useful to be able to subclass it. As it is, you're locked into 
using the output format "enUsFormat". It's not even configurable. The only 
option is to rewrite the whole class from scratch.

There are lots of other "final" classes in the library. There might be cases 
where it's warranted but usually it's just a hindrance to usage.

Original issue reported on code.google.com by nlev...@gmail.com on 8 Aug 2014 at 12:40

GoogleCodeExporter commented 9 years ago
This is an internal class and prone to API breakage at any time. The right 
approach is just to copy the implementation to your project and modify as 
needed.

https://groups.google.com/d/msg/google-gson/5qJK9nUynPY/ge-nI7s-CHIJ

Original comment by j...@squareup.com on 9 Aug 2014 at 6:33