Fixed
Status Update
Comments
ku...@google.com <ku...@google.com>
ku...@google.com <ku...@google.com>
su...@google.com <su...@google.com>
su...@google.com <su...@google.com> #2
since these are in public API (:/) we need to do this in 1.2
Description
Version used: 1.0.0-alpha02
Theme used: N/A
Devices/Android versions reproduced on: N/A
- Relevant code to trigger the issue. N/A
- A screenrecord or screenshots showing the issue (if UI related). N/A
WorkManager has nullability annotations for input parameters, but not for return types. Consumers, especially those using Kotlin, are more likely to make bad assumptions about whether a return value is null or not, leading to potential crashes.
Example:
```
/**
* Gets a {@link LiveData} of the {@link WorkStatus} for a given work id.
*
* @param id The id of the work
* @return A {@link LiveData} of the {@link WorkStatus} associated with {@code id}
*/
public abstract LiveData<WorkStatus> getStatusById(@NonNull UUID id);
```
If the given id is not found, what is returned? A LiveData that immediately emits a Failure WorkStatus? A null LiveData? Or is an exception thrown?