Skip to content

Add nullability annotations to code base for better tooling assistance #741

@mkobit

Description

@mkobit

Overview

Context: When implementing extensions in Kotlin I noticed that when generating the members in IntelliJ the method signatures had nullable types like ContainerExtensionContext?:

class MyExtension : BeforeAllCallback {
  override fun beforeAll(context: ContainerExtensionContext?) {
    TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
  }
}

The desired behavior when implementing something like this is to have the generated type represent what the documentation says. I would like the generated parameter to be ContainerExtensionContext instead of ContainerExtensionContext?.

It is also useful to have when looking at Javadoc or implementation as well as when using some static code analysis tools.

An overview of the support Kotlin compiler annotations can be found here, but these can benefit authors in other languages as well.

Deliverables

  • nullable library chosen
  • @NonNull and @Nullable (or other annotations) are applied to method parameters

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