Spring Security 7.1.2, compiling OldSecurity.java
src/compat/OldSecurity.java:11: error: cannot find symbol
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
                                                    ^
  symbol:   class AntPathRequestMatcher
  location: package org.springframework.security.web.util.matcher
src/compat/OldSecurity.java:16: warning: [deprecation] EnableGlobalMethodSecurity in org.springframework.security.config.annotation.method.configuration has been deprecated
@EnableGlobalMethodSecurity(prePostEnabled = true)
 ^
src/compat/OldSecurity.java:20: error: cannot find symbol
        http.authorizeRequests(a -> a.anyRequest().authenticated());
            ^
  symbol:   method authorizeRequests((a)->a.any[...]ted())
  location: variable http of type HttpSecurity
src/compat/OldSecurity.java:24: error: method csrf in class HttpSecurity cannot be applied to given types;
        http.csrf().disable().headers().frameOptions().sameOrigin();
            ^
  required: Customizer<CsrfConfigurer<HttpSecurity>>
  found:    no arguments
  reason: actual and formal argument lists differ in length
src/compat/OldSecurity.java:28: error: cannot find symbol
        return new AntPathRequestMatcher("/api/**");
                   ^
  symbol:   class AntPathRequestMatcher
  location: class OldSecurity
src/compat/OldSecurity.java:32: error: constructor DaoAuthenticationProvider in class DaoAuthenticationProvider cannot be applied to given types;
        DaoAuthenticationProvider p = new DaoAuthenticationProvider();
                                      ^
  required: UserDetailsService
  found:    no arguments
  reason: actual and formal argument lists differ in length
src/compat/OldSecurity.java:33: error: cannot find symbol
        p.setUserDetailsService(users);
         ^
  symbol:   method setUserDetailsService(UserDetailsService)
  location: variable p of type DaoAuthenticationProvider
src/compat/OldSecurity.java:38: error: cannot find symbol
        return AuthorizationGrantType.PASSWORD;
                                     ^
  symbol:   variable PASSWORD
  location: class AuthorizationGrantType
src/compat/OldSecurity.java:41: error: CustomManager is not abstract and does not override abstract method authorize(Supplier<? extends Authentication>,RequestAuthorizationContext) in AuthorizationManager
    static class CustomManager implements AuthorizationManager<RequestAuthorizationContext> {
           ^
src/compat/OldSecurity.java:42: error: method does not override or implement a method from a supertype
        @Override
        ^
9 errors
1 warning
javac exit status: 1
