Improve documentation of nullability on LoggingEvent interface#446
Improve documentation of nullability on LoggingEvent interface#446hermannm wants to merge 1 commit intoqos-ch:masterfrom
Conversation
Signed-off-by: hermannm <hermann.morkrid@gmail.com>
8d551b7 to
d3e1c8c
Compare
|
It would be probably useful to annotate SLF4J with JSpecify. Unlike all the previous nullability annotations, JSpecify is actually supported by a long list of vendors and it is becoming the de facto standard. |
Agreed that JSpecify would be better! But adopting that seems like a greater effort, that should be a project-wide decision (correct me if I'm wrong). Until we decide to adopt JSpecify, I thought it would be useful to at least document nullability like this. |
I recently worked with the SLF4J
LoggingEventinterface, and found myself having to dig through theDefaultLoggingEventimplementation to see which methods onLoggingEventcould actually returnnull. I saw that there is an existing docstring documenting the nullability ofLoggingEvent.getMarkers(), but none for the other methods. I figured it would be useful to document this on all methods, to make the interface contract clearer.The existing
LoggingEvent.getMarkers()docstring duplicated its text in the main doc and in@return. This seemed redundant to me, but if you prefer this format I'll change over to it.I figured that for a small change like this it would be easiest to submit a PR directly, so I didn't go through the mailing list/bug report. But I'll do that if you prefer strictly following the contributor guidelines.