-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.jsiiThis issue originates in jsii, or this feature must be implemented in jsii.This issue originates in jsii, or this feature must be implemented in jsii.language/javaRelated to Java bindingsRelated to Java bindings
Description
Please add the @Nullable / @NotNull annotations as appropriate when generating the Java CDK bindings from typescript constructs that are marked as optional or as not optional.
Use Case
While Java has no native way of saying "this can be null" / "this is not expected to be null", the @Nullable / @NotNull annotations are a way of doing that, enabling
- Developers working on IDEs such as IntelliJ to get helpful messages when they don't check for
null - Tools such as FindBugs to find problematic usages in a codebase
and even better in my case
Proposed Solution
Add the annotations when generating Java code.
Other
There's also a feature request asking for this in the AWS Java SDK, which unfortunately has not been addressed yet.
- 👋 I may be able to implement this feature request
-
⚠️ This feature might incur a breaking change
This is a 🚀 Feature Request
babangsund, lambrospetrou, isaac-jordan, RomainMuller, jrehwaldt and 1 morebabangsund and dsvensson
Metadata
Metadata
Assignees
Labels
effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.jsiiThis issue originates in jsii, or this feature must be implemented in jsii.This issue originates in jsii, or this feature must be implemented in jsii.language/javaRelated to Java bindingsRelated to Java bindings