From b4619f31ee791213260b30df5e4ef62de534c5a6 Mon Sep 17 00:00:00 2001 From: BELHAKEL Ammar Date: Mon, 23 Dec 2019 23:55:32 +0100 Subject: [PATCH] Fix return type AbstractConfiguredSecurityBuilder.objectPostProcessor() should cast to B, the type of SecurityBuilder, instead of O, the type of object being built. Without this change, calls like http.objectPostProcessor(...).getFilters() will fail with a ClassCastException. --- .../config/annotation/AbstractConfiguredSecurityBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java b/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java index 55ed97f240..34fe85cb2c 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java +++ b/config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java @@ -286,10 +286,10 @@ public abstract class AbstractConfiguredSecurityBuilder objectPostProcessor) { + public B objectPostProcessor(ObjectPostProcessor objectPostProcessor) { Assert.notNull(objectPostProcessor, "objectPostProcessor cannot be null"); this.objectPostProcessor = objectPostProcessor; - return (O) this; + return (B) this; } /**