Skip to content

Make SDK explicit about nullability in parameters and returned values - Kotlin friendly #225

@kkocel

Description

@kkocel

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[X] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Expected Behavior

When passing parameters to API I should know if I can pass null safely.
When I get parameters from API (eg. by implementing it's interfaces, extending classes) I want to be sure wether received object will be null or not.

Current Behavior

Possible Solution

Make use of Nullability annotations - eg. JSR-305 (as runtime dependency)
Annotate appropriate elements with relevant annotations, or even mark whole packages using package-info.java.

Context

Now SDK does not indicate in clear way wether objects can be or can't be null. Such approach forces SDK consumers to write tons of boilerplate defensive code which can turn out to be useless (but consumer does not know that)

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