osundblad / intellij-annotations-instrumenter-maven-plugin

IntelliJ IDEA annotations instrumenter maven plugin
Other
38 stars 11 forks source link

Handle java.lang.Void return type in implicit mode #47

Closed jkaving closed 4 years ago

jkaving commented 4 years ago

Since null is the only allowed return value for a method declared with java.lang.Void return type, it doesn't make much sense to throw an IllegalStateException for these in implicit mode.

Fixes #46

jkaving commented 4 years ago

Note that this will affect explicit mode as well. If you declare a method like this:

@NotNull
Void call() {
    return null;
}

you will no longer get an exception thrown.

But adding @NotNull to a method that returns Void doesn't make much sense anyway (since null is the only allowed return value), so I think that's ok.