-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
generatorIssues binding a Java library (generator, class-parse, etc.)Issues binding a Java library (generator, class-parse, etc.)
Description
Context: #912 (comment)
Some of the nullable annotations we look for do support string?[]?, like Lorg/jetbrains/annotations/NotNull;:
package org.jetbrains.annotations;
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE})
public @interface NotNull { ... }(source)
(My understanding is it's the ElementType.TYPE_USE that allows specifying string?[].)
However the Android ones we primarily use only support string[]?:
package androidx.annotation;
@Target({METHOD, PARAMETER, FIELD, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE})
public @interface NonNull { ... }(source)
Our tools do not currently support specifying the array element nullability.
While we probably wouldn't gain much by adding support to our tools since the primary Android annotations don't support it, we probably should update generator to always emit nullable array elements, since the default should be nullable unless specified @NotNull.
That is, we should always emit string?[] or string?[]? when NRT is turned on.
Metadata
Metadata
Assignees
Labels
generatorIssues binding a Java library (generator, class-parse, etc.)Issues binding a Java library (generator, class-parse, etc.)