We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have an @AutoValue class that uses Gson's @SerializedName annotation in a Android Project.
@AutoValue
@SerializedName
On method annotated with @DefensiveCopy and @SerializedName, an error happens in generated class, where @SerializedName's value is not copied.
@DefensiveCopy
Follows the code:
@AutoValue public abstract class UserResponse { public static TypeAdapter<UserResponse> typeAdapter(Gson gson) { return new AutoValue_UserResponse.GsonTypeAdapter(gson); } @SerializedName("cod_usuario") public abstract String codUsuario(); @Nullable @SerializedName("codigo_motorista") public abstract String codMotorista(); @SerializedName("codigo_veiculo") public abstract String codVeiculo(); @SerializedName("nome_usuario") public abstract String nomeDoUsuario(); @DefensiveCopy @SerializedName("grupos") public abstract List<String> grupos(); }
abstract class $AutoValue_UserResponse extends $$AutoValue_UserResponse { $AutoValue_UserResponse(String codUsuario, @Nullable String codMotorista, String codVeiculo, String nomeDoUsuario, List<String> grupos) { super(codUsuario, codMotorista, codVeiculo, nomeDoUsuario, grupos); } @DefensiveCopy @SerializedName // <- Here the error. The value "groups" is not copied. @Override public List<String> grupos() { return java.util.Collections.unmodifiableList(super.grupos()); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have an
@AutoValue
class that uses Gson's@SerializedName
annotation in a Android Project.On method annotated with
@DefensiveCopy
and@SerializedName
, an error happens in generated class, where@SerializedName
's value is not copied.Follows the code:
The text was updated successfully, but these errors were encountered: