Download Latest Version Gson 2.13.1 source code.tar.gz (465.2 kB)
Email in envelope

Get an email when there's a new version of Gson

Home / gson-parent-2.13.0
Name Modified Size InfoDownloads / Week
Parent folder
Gson 2.13.0 source code.tar.gz 2025-04-11 470.9 kB
Gson 2.13.0 source code.zip 2025-04-11 738.2 kB
README.md 2025-04-11 1.6 kB
Totals: 3 Items   1.2 MB 0

What's Changed

  • A bug in deserializing collections has been fixed. Previously, if you did something like this: gson.fromJson(jsonString, new TypeToken<ImmutableList<String>>() {}) then the inferred type would be ImmutableList<String>, but Gson actually gave you an ArrayList<String>. Usually that would lead to an immediate ClassCastException, but in some circumstances the code might sometimes succeed despite the wrong type. Now you will see an exception like this: com.google.gson.JsonIOException: Abstract classes can't be instantiated! Adjust the R8 configuration or register an InstanceCreator or a TypeAdapter for this type. Class name: com.google.common.collect.ImmutableList because Gson now really is trying to create an ImmutableList through its constructor, but that isn't possible. Either change the requested type (in the TypeToken) to List<String>, or register a TypeAdapter or JsonDeserializer for ImmutableList.

  • The internal classes $Gson$Types and $Gson$Preconditions have been renamed to remove the $ characters. Since these are internal classes (as signaled not only by the package name but by the $ characters), client code should not be affected. If your code was depending on these classes then we suggest making a copy of the class (subject to the license) rather than depending on the new names.

Full Changelog: https://github.com/google/gson/compare/gson-parent-2.12.1...gson-parent-2.13.0

Source: README.md, updated 2025-04-11