Reviewing #45389 I noticed that OptionalParameter
isn't documented and is quite hidden compared to the check that exists in OperationMethodParameter
. Trying to get rid of the predicate explained why this was done this way:
Architecture Violation [Priority: MEDIUM] - Rule 'slices matching '(**)' should be free of cycles' was violated (1 times):
Cycle detected: Slice org.springframework.boot.actuate.endpoint.annotation ->
Slice org.springframework.boot.actuate.endpoint.invoke.reflect ->
Slice org.springframework.boot.actuate.endpoint.annotation
I don't know if we can get rid of the cycle but the complexity of the code that results from avoiding it is worse than doing a lookup by a FQN, IMO.
I am going to push what I have and then we can discuss what we want to do to move forward.
Comment From: philwebb
I've opened #47136 to completely drop support for @Nullable
, but I think we should keep the predicate. IMO, the org.springframework.boot.actuate.endpoint.invoke.reflect
package should not know about org.springframework.boot.actuate.endpoint.annotation
(event if it's with a Stringly typed lookup).
I have made OperationMethod
abstract to make it a bit more obvious that we expect a subclass to exist.
I think it's probably fine that the annotation processor only effectively supports DiscoveredOperationMethod
. I suspect in reality we won't have any other OperationMethod
implementations.