[ 
https://issues.apache.org/jira/browse/FINERACT-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Adam Saghy updated FINERACT-2267:
---------------------------------
    Description: 
As of today, there are 3 different kind of “not-null” annotations are used in 
Fineract, and unfortunately, not always the correct one:
 * jakarta.validation.constraints.NotNull

 * org.springframework.lang.NonNull

 * org.jetbrains.annotations.NotNull

 
 
 
||Feature||jakarta.validation.constraints.NotNull||org.springframework.lang.NonNull||org.jetbrains.annotations.NotNull||
|*Runtime validation*|✅ Yes|❌ No|❌ No|
|*Static analysis support*|✅ Limited|✅ Yes (IDE, static tools)|✅ Strong (IDE, 
static tools)|
|*Framework dependency*|Jakarta EE / Bean Validation (Hibernate)|Spring 
Framework|JetBrains (IDE, language tools)|
|*Primary Use Case*|DTO/entity validation|Internal Spring code 
clarity|IDE-enhanced static analysis & Kotlin-Java interop|

 
 
*Recommended changes*
 * *API / Validation* → Use jakarta.validation.constraints.NotNull

 * *Spring internal APIs* → Use org.springframework.lang.NonNull

 * *Remove* org.jetbrains.annotations.NotNull *completely*
 ** *Use one of the above, based on usage!*
 *** *API/Validation - > Jakarta NotNull*
 *** *Spring internal APIs / Services -> Spring NonNull*

  was:
As of today, there are 3 different kind of “not-null” annotations are used in 
Fineract, and unfortunately, not always the correct one:
 * jakarta.validation.constraints.NotNull

 * org.springframework.lang.NonNull

 * org.jetbrains.annotations.NotNull

 
 
 
||Feature||jakarta.validation.constraints.NotNull||org.springframework.lang.NonNull||org.jetbrains.annotations.NotNull||
|*Runtime validation*|✅ Yes|❌ No|❌ No|
|*Static analysis support*|✅ Limited|✅ Yes (IDE, static tools)|✅ Strong (IDE, 
static tools)|
|*Framework dependency*|Jakarta EE / Bean Validation (Hibernate)|Spring 
Framework|JetBrains (IDE, language tools)|
|*Primary Use Case*|DTO/entity validation|Internal Spring code 
clarity|IDE-enhanced static analysis & Kotlin-Java interop|
 
 
*Recommended changes*
 * *API / Validation* → Use jakarta.validation.constraints.NotNull

 * *Spring internal APIs* → Use org.springframework.lang.NonNull

 * *Remove* org.jetbrains.annotations.NotNull *completely!*


> Use the proper not-null annotation in Fineract code base
> --------------------------------------------------------
>
>                 Key: FINERACT-2267
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2267
>             Project: Apache Fineract
>          Issue Type: Improvement
>            Reporter: Adam Saghy
>            Priority: Minor
>
> As of today, there are 3 different kind of “not-null” annotations are used in 
> Fineract, and unfortunately, not always the correct one:
>  * jakarta.validation.constraints.NotNull
>  * org.springframework.lang.NonNull
>  * org.jetbrains.annotations.NotNull
>  
>  
>  
> ||Feature||jakarta.validation.constraints.NotNull||org.springframework.lang.NonNull||org.jetbrains.annotations.NotNull||
> |*Runtime validation*|✅ Yes|❌ No|❌ No|
> |*Static analysis support*|✅ Limited|✅ Yes (IDE, static tools)|✅ Strong (IDE, 
> static tools)|
> |*Framework dependency*|Jakarta EE / Bean Validation (Hibernate)|Spring 
> Framework|JetBrains (IDE, language tools)|
> |*Primary Use Case*|DTO/entity validation|Internal Spring code 
> clarity|IDE-enhanced static analysis & Kotlin-Java interop|
>  
>  
> *Recommended changes*
>  * *API / Validation* → Use jakarta.validation.constraints.NotNull
>  * *Spring internal APIs* → Use org.springframework.lang.NonNull
>  * *Remove* org.jetbrains.annotations.NotNull *completely*
>  ** *Use one of the above, based on usage!*
>  *** *API/Validation - > Jakarta NotNull*
>  *** *Spring internal APIs / Services -> Spring NonNull*



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to