I’ve been looking at Function.java
from Microsoftjdk-17.0.11.9-hotspotlibsrc.zip!java.basejavautilfunctionFunction.java
It appears like this in IntelliJ IDEA 2024 :
I couldn’t help but notice that there’s an automated (inferred) @NotNull
added by IntelliJ in front of Function<...>
in the method prototype.
Where does the @NotNull
come from? In other words : What does this class have that my own classes don’t have? (None of my classes make IntelliJ add @NotNull
spontaneously even when the context makes it clear).
Note: I looked at annotation @FunctionalInterface
‘s inner workings but could not find a direct link between how it works and this @NotNull. Maybe it’s there, I just don’t see it.