[ 
https://issues.apache.org/jira/browse/LOG4J2-3448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17514030#comment-17514030
 ] 

Volkan Yazici commented on LOG4J2-3448:
---------------------------------------

I totally support this initiative. I'd say, copy [@Nullable from 
Spring|https://github.com/spring-projects/spring-framework/blob/main/spring-core/src/main/java/org/springframework/lang/Nullable.java]
 and be done with it. The insight IDEs provide in the presence of such an 
annotation is really valuable. That said, since they don't actually perform any 
protection but mere hints, not-nullable arguments in public methods still need 
to be checked explicitly.

> Add nullability-related annotations for better documentation and static 
> analysis
> --------------------------------------------------------------------------------
>
>                 Key: LOG4J2-3448
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3448
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: API
>            Reporter: Matt Sicker
>            Priority: Major
>
> Nullability annotations can be used by static analysis tools, IDEs, and even 
> Kotlin, to better check for potential NullPointerException errors or 
> redundant null checks. To avoid introducing an additional dependency here, 
> these annotations can be defined in the API. At minimum, some form of 
> {{@Nonnull}} and {{@Nullable}} should be added.
> Alternatively, as these are compile-time annotations anyways, it may be 
> possible to use a third-party annotation library here as long as it's also 
> compile-time only.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to