Skip to content

2.x: GroupedObservable#getKey is annotated as Nullable #5448

@ajarl

Description

@ajarl

(RxJava 2.1.0)
The GroupedObservable's key that the group was created with is annotated as Nullable (in both the return type and in the constructor parameter).

However, the key is only ever created from the keySelector (in ObservableGroupBy), which is declared as a Function (and hence has @NonNull return type). It should therefore be considered a warning to return a null key for a group.

I propose that RxJava actively verifies that the returned key is non-null and then change the Nullable annotations in GroupedObservable to NonNull correspondingly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions