theigl commented on PR #1093:
URL: https://github.com/apache/wicket/pull/1093#issuecomment-2639200126

   > Let me know if you decide you would like to use JSpecify instead of the 
Jakarta annotations. I will close this PR and create a new one.
   
   I prefer the JSpecify branch because of the advantages you mentioned!
   
   > Another remark about which annotations to use. I think the annotations 
should be added incrementally, and both annotations (nullable and not nullable) 
must be added. Once everything is annotated (which can take quite some time), 
the decision to switch to package-level (or some other level) annotations can 
be made. It is then also easy to determine which of the 2 annotations results 
in the least amount of code. The most occurring annotation can be changed to 
higher-level annotations.
   
   What I did in my project is this:
   
   1. Mark a package as `@NullMarked` in `package-info.java`
   2. For each class in the package:
       - Mark all parameters as `@Nullable` that IntelliJ reported as null 
being passed or that is null-checked inside the method
       - Mark all return values as `@Nullable` that IntelliJ reported as 
possibly returning null
   3. Repeat until almost all packages are marked and IntelliJ shows no more 
warnings
   4. Optional: Remove all `package-info.java` files and place a single 
`@NullMarked` annotation in the `module-info.java`. 
   
   This is basically the incremental strategy that JSpecify 
[recommends](https://jspecify.dev/docs/applying/).
   
   What approach we take will mostly depend on how much time we want to spend.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to