Closed 3flex closed 6 years ago
It's a general AutoValue issue with consumed properties. Get/is will only be removed from the name if all methods use them, but when AutoValue checks if that is the case it will see int describeContents()
. Therefor it thinks not all properties use get/is as prefix and doesn't strip them from the name.
As a workaround you can implement describeContents()
yourself:
public int describeContents() {
return 0;
}
Is this still an issue?
I have a class that has both AutoValue and your AutoValue Gson Extension enabled and working well. The class uses JavaBeans-style name prefixes.
When I try to make the class Parcelable the JavaBeans-style prefixes stop working. The GSON extension starts using the field name including the JavaBeans prefix (in generated source I see
jsonWriter.name("getName");
) instead of stripping it like it does without Parcelable (jsonWriter.name("name");
)Let me know if I can provide any additional information. It should be easy enough to see what's going on using this minimal class and toggling
implements Parcelable
on and off:From gradle.build: