From 7162046144a09bf4b5b23072c177bc2708ca43c8 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Fri, 22 Mar 2024 14:33:23 -0600 Subject: [PATCH] Remove Reference to MethodInvocationResult Closes gh-14794 --- .../authorization/AuthorizationObservationConvention.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/springframework/security/authorization/AuthorizationObservationConvention.java b/core/src/main/java/org/springframework/security/authorization/AuthorizationObservationConvention.java index c011835aab..1fb819cd49 100644 --- a/core/src/main/java/org/springframework/security/authorization/AuthorizationObservationConvention.java +++ b/core/src/main/java/org/springframework/security/authorization/AuthorizationObservationConvention.java @@ -21,8 +21,6 @@ import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationConvention; import org.aopalliance.intercept.MethodInvocation; -import org.springframework.security.authorization.method.MethodInvocationResult; - /** * An {@link ObservationConvention} for translating authorizations into {@link KeyValues}. * @@ -85,10 +83,10 @@ public final class AuthorizationObservationConvention if (context.getObject() instanceof MethodInvocation) { return "method"; } - if (context.getObject() instanceof MethodInvocationResult) { + String className = context.getObject().getClass().getSimpleName(); + if (className.contains("Method")) { return "method"; } - String className = context.getObject().getClass().getSimpleName(); if (className.contains("Request")) { return "request"; }