Merge "Add “@throws BadParcelableException” to the JavaDoc of new API methods that throw the exception." am: d6f306117a am: ce08bacce0 am: 956294ef72

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1857934

Change-Id: I234e7606d9e2f948df596dd75aa7664a878bfa69
This commit is contained in:
Hao Ke
2021-10-14 18:17:38 +00:00
committed by Automerger Merge Worker

View File

@@ -2891,9 +2891,11 @@ public final class Parcel {
/** /**
* Same as {@link #readList(List, ClassLoader)} but accepts {@code clazz} parameter as * Same as {@link #readList(List, ClassLoader)} but accepts {@code clazz} parameter as
* the type required for each item. If the item to be deserialized is not an instance * the type required for each item.
* of that class or any of its children class *
* a {@link BadParcelableException} will be thrown. * @throws BadParcelableException Throws BadParcelableException if the item to be deserialized
* is not an instance of that class or any of its children classes or there was an error
* trying to instantiate an element.
*/ */
public <T> void readList(@NonNull List<? super T> outVal, public <T> void readList(@NonNull List<? super T> outVal,
@Nullable ClassLoader loader, @NonNull Class<T> clazz) { @Nullable ClassLoader loader, @NonNull Class<T> clazz) {
@@ -3894,8 +3896,11 @@ public final class Parcel {
/** /**
* Same as {@link #readParcelable(ClassLoader)} but accepts {@code clazz} parameter as the type * Same as {@link #readParcelable(ClassLoader)} but accepts {@code clazz} parameter as the type
* required for each item. If the item to be deserialized is not an instance of that class or * required for each item.
* any of its children classes a {@link BadParcelableException} will be thrown. *
* @throws BadParcelableException Throws BadParcelableException if the item to be deserialized
* is not an instance of that class or any of its children classes or there was an error
* trying to instantiate an element.
*/ */
@Nullable @Nullable
public <T extends Parcelable> T readParcelable(@Nullable ClassLoader loader, public <T extends Parcelable> T readParcelable(@Nullable ClassLoader loader,
@@ -3961,8 +3966,11 @@ public final class Parcel {
/** /**
* Same as {@link #readParcelableCreator(ClassLoader)} but accepts {@code clazz} parameter * Same as {@link #readParcelableCreator(ClassLoader)} but accepts {@code clazz} parameter
* as the required type. If the item to be deserialized is not an instance of that class * as the required type.
* or any of its children classes a {@link BadParcelableException} will be thrown. *
* @throws BadParcelableException Throws BadParcelableException if the item to be deserialized
* is not an instance of that class or any of its children class or there there was an error
* trying to read the {@link Parcelable.Creator}.
*/ */
@Nullable @Nullable
public <T> Parcelable.Creator<T> readParcelableCreator( public <T> Parcelable.Creator<T> readParcelableCreator(