Skip to content

Commit edb7a64

Browse files
ronodhirSoumikjzheaux
authored andcommitted
Removed deprecated class ObjectPostProcessor
Issue gh-17309 Signed-off-by: Soumik Sarker <[email protected]>
1 parent dff5780 commit edb7a64

16 files changed

+11
-209
lines changed

config/src/main/java/org/springframework/security/config/annotation/AbstractConfiguredSecurityBuilder.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -79,15 +79,6 @@ protected AbstractConfiguredSecurityBuilder(ObjectPostProcessor<Object> objectPo
7979
this(objectPostProcessor, false);
8080
}
8181

82-
/**
83-
* @deprecated
84-
*/
85-
@Deprecated(since = "6.4", forRemoval = true)
86-
protected AbstractConfiguredSecurityBuilder(
87-
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor) {
88-
this(objectPostProcessor, false);
89-
}
90-
9182
/***
9283
* Creates a new instance with the provided {@link ObjectPostProcessor}. This post
9384
* processor must support Object since there are many types of objects that may be
@@ -103,18 +94,6 @@ protected AbstractConfiguredSecurityBuilder(ObjectPostProcessor<Object> objectPo
10394
this.allowConfigurersOfSameType = allowConfigurersOfSameType;
10495
}
10596

106-
/**
107-
* @deprecated
108-
*/
109-
@Deprecated(since = "6.4", forRemoval = true)
110-
protected AbstractConfiguredSecurityBuilder(
111-
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor,
112-
boolean allowConfigurersOfSameType) {
113-
Assert.notNull(objectPostProcessor, "objectPostProcessor cannot be null");
114-
this.objectPostProcessor = objectPostProcessor;
115-
this.allowConfigurersOfSameType = allowConfigurersOfSameType;
116-
}
117-
11897
/**
11998
* Similar to {@link #build()} and {@link #getObject()} but checks the state to
12099
* determine if {@link #build()} needs to be called first.

config/src/main/java/org/springframework/security/config/annotation/ObjectPostProcessor.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

config/src/main/java/org/springframework/security/config/annotation/SecurityConfigurerAdapter.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -81,15 +81,6 @@ public void addObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor) {
8181
this.objectPostProcessor.addObjectPostProcessor(objectPostProcessor);
8282
}
8383

84-
/**
85-
* @deprecated
86-
*/
87-
@Deprecated(since = "6.4", forRemoval = true)
88-
public void addObjectPostProcessor(
89-
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
90-
this.objectPostProcessor.addObjectPostProcessor(objectPostProcessor);
91-
}
92-
9384
/**
9485
* Sets the {@link SecurityBuilder} to be used. This is automatically set when using
9586
* {@link AbstractConfiguredSecurityBuilder#apply(SecurityConfigurerAdapter)}

config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -73,15 +73,6 @@ public AuthenticationManagerBuilder(ObjectPostProcessor<Object> objectPostProces
7373
super(objectPostProcessor, true);
7474
}
7575

76-
/**
77-
* @deprecated
78-
*/
79-
@Deprecated(since = "6.4", forRemoval = true)
80-
public AuthenticationManagerBuilder(
81-
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor) {
82-
super(objectPostProcessor, true);
83-
}
84-
8576
/**
8677
* Allows providing a parent {@link AuthenticationManager} that will be tried if this
8778
* {@link AuthenticationManager} was unable to attempt to authenticate the provided

config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -133,16 +133,6 @@ public LdapAuthenticationProviderConfigurer<B> withObjectPostProcessor(ObjectPos
133133
return this;
134134
}
135135

136-
/**
137-
* @deprecated
138-
*/
139-
@Deprecated(since = "6.4", forRemoval = true)
140-
public LdapAuthenticationProviderConfigurer<B> withObjectPostProcessor(
141-
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
142-
addObjectPostProcessor(objectPostProcessor);
143-
return this;
144-
}
145-
146136
/**
147137
* Gets the {@link LdapAuthoritiesPopulator} and defaults to
148138
* {@link DefaultLdapAuthoritiesPopulator}

config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/userdetails/AbstractDaoAuthenticationConfigurer.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,17 +63,6 @@ public C withObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor) {
6363
return (C) this;
6464
}
6565

66-
/**
67-
* @deprecated
68-
*/
69-
@Deprecated(since = "6.4", forRemoval = true)
70-
@SuppressWarnings("unchecked")
71-
public C withObjectPostProcessor(
72-
org.springframework.security.config.annotation.ObjectPostProcessor<?> objectPostProcessor) {
73-
addObjectPostProcessor(objectPostProcessor);
74-
return (C) this;
75-
}
76-
7766
/**
7867
* Allows specifying the {@link PasswordEncoder} to use with the
7968
* {@link DaoAuthenticationProvider}. The default is to use plain text.

config/src/main/java/org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -407,16 +407,6 @@ public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcess
407407
this.objectPostProcessor = objectPostProcessor;
408408
}
409409

410-
/**
411-
* @deprecated
412-
*/
413-
@Deprecated(since = "6.4", forRemoval = true)
414-
@Autowired(required = false)
415-
public void setObjectPostProcessor(
416-
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor) {
417-
this.objectPostProcessor = objectPostProcessor;
418-
}
419-
420410
@Autowired(required = false)
421411
public void setMethodSecurityExpressionHandler(List<MethodSecurityExpressionHandler> handlers) {
422412
if (handlers.size() != 1) {

config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -194,23 +194,6 @@ public HttpSecurity(ObjectPostProcessor<Object> objectPostProcessor,
194194
this.requestMatcherConfigurer = new RequestMatcherConfigurer(context);
195195
}
196196

197-
/**
198-
* @deprecated
199-
*/
200-
@Deprecated(since = "6.4", forRemoval = true)
201-
@SuppressWarnings("unchecked")
202-
public HttpSecurity(org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor,
203-
AuthenticationManagerBuilder authenticationBuilder, Map<Class<?>, Object> sharedObjects) {
204-
super(objectPostProcessor);
205-
Assert.notNull(authenticationBuilder, "authenticationBuilder cannot be null");
206-
setSharedObject(AuthenticationManagerBuilder.class, authenticationBuilder);
207-
for (Map.Entry<Class<?>, Object> entry : sharedObjects.entrySet()) {
208-
setSharedObject((Class<Object>) entry.getKey(), entry.getValue());
209-
}
210-
ApplicationContext context = (ApplicationContext) sharedObjects.get(ApplicationContext.class);
211-
this.requestMatcherConfigurer = new RequestMatcherConfigurer(context);
212-
}
213-
214197
private ApplicationContext getContext() {
215198
return getSharedObject(ApplicationContext.class);
216199
}

config/src/main/java/org/springframework/security/config/annotation/web/builders/WebSecurity.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -139,14 +139,6 @@ public WebSecurity(ObjectPostProcessor<Object> objectPostProcessor) {
139139
super(objectPostProcessor);
140140
}
141141

142-
/**
143-
* @deprecated
144-
*/
145-
@Deprecated(since = "6.4", forRemoval = true)
146-
public WebSecurity(org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor) {
147-
super(objectPostProcessor);
148-
}
149-
150142
/**
151143
* <p>
152144
* Allows adding {@link RequestMatcher} instances that Spring Security should ignore.

config/src/main/java/org/springframework/security/config/annotation/web/configuration/HttpSecurityConfiguration.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -180,17 +180,6 @@ static class DefaultPasswordEncoderAuthenticationManagerBuilder extends Authenti
180180
this.defaultPasswordEncoder = defaultPasswordEncoder;
181181
}
182182

183-
/**
184-
* @deprecated
185-
*/
186-
@Deprecated(since = "6.4", forRemoval = true)
187-
DefaultPasswordEncoderAuthenticationManagerBuilder(
188-
org.springframework.security.config.annotation.ObjectPostProcessor<Object> objectPostProcessor,
189-
PasswordEncoder defaultPasswordEncoder) {
190-
super(objectPostProcessor);
191-
this.defaultPasswordEncoder = defaultPasswordEncoder;
192-
}
193-
194183
@Override
195184
public InMemoryUserDetailsManagerConfigurer<AuthenticationManagerBuilder> inMemoryAuthentication()
196185
throws Exception {

0 commit comments

Comments
 (0)