Request: add nullable annotations, to know what can return null
For example, I've noticed there is some case that "findMatch" can return null:
private ContentInfo findMatch(byte[] bytes, List<MagicEntry> entryList) {
....
if (partialMatchInfo == null) {
logger.trace("returning no match");
return null;z
I'm not sure I understand your question. It is returning null because it found no match to the bytes. Are you asking for partial match information or something? Can you provide an example and what output you would like?
If I understand the title correctly, it is a request to annotate public methods with JSR 305 @Nullable and @Nonnull
@j256 Nullability annotations help both the IDE and us to understand which functions can return null and which function should never return null. This helps with prevention of NPE, helps the IDE to offer various optimizations, helps to remove useless nullability checks, and also provides better support for Kotlin which forces developers to declare what can have a null value and what cannot.