My project invokes javac with -Werror, which treats warnings as errors and blocks compilations. When an AutoValue carries a parameterized Parcelable, like:
public static final Parcelable.Creator<AutoValue_Foo<?>> CREATOR = new Parcelable.Creator<AutoValue_Foo<?>> {
@Override
public AutoValue_Foo<?> createFromParcel(Parcel in) {
return (AutoValue_Foo<?>) new AutoValue_Foo(
(Bar<?>) in.readParcelable(Bar.class.getClassLoader()) );
}
@Override
public AutoValue_Test<? extends String, ? extends System>[] newArray(int size) {
return new AutoValue_Test[size];
}
};
Where both createFromParcel and newArray raise unchecked (from the typecast) and rawtypes (from calling the constructor without specifying the template type) warnings.
This CL the proper suppression so that such code will compile even with -Werror.
My project invokes
javac
with-Werror
, which treats warnings as errors and blocks compilations. When anAutoValue
carries a parameterizedParcelable
, like:Then it yields:
Where both
createFromParcel
andnewArray
raiseunchecked
(from the typecast) andrawtypes
(from calling the constructor without specifying the template type) warnings.This CL the proper suppression so that such code will compile even with
-Werror
.