Deprecate LocalVariableTableParameterNameDiscoverer completely
LocalVariableTableParameterNameDiscoverer is not registered by default anymore now. Java sources should be compiled with `-parameters` instead (available since Java 8). Also retaining standard Java parameter names for all of Spring's Kotlin sources now. Closes gh-29531
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,7 +26,7 @@ import java.util.Locale;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.annotation.SynthesizingMethodParameter;
|
||||
import org.springframework.messaging.Message;
|
||||
@@ -81,7 +81,7 @@ public class PayloadMethodArgumentResolverTests {
|
||||
this.paramAnnotatedRequired = new SynthesizingMethodParameter(payloadMethod, 2);
|
||||
this.paramWithSpelExpression = new SynthesizingMethodParameter(payloadMethod, 3);
|
||||
this.paramValidated = new SynthesizingMethodParameter(payloadMethod, 4);
|
||||
this.paramValidated.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());
|
||||
this.paramValidated.initParameterNameDiscovery(new DefaultParameterNameDiscoverer());
|
||||
this.paramValidatedNotAnnotated = new SynthesizingMethodParameter(payloadMethod, 5);
|
||||
this.paramNotAnnotated = new SynthesizingMethodParameter(payloadMethod, 6);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,7 +39,7 @@ import org.springframework.cglib.proxy.Callback;
|
||||
import org.springframework.cglib.proxy.Enhancer;
|
||||
import org.springframework.cglib.proxy.Factory;
|
||||
import org.springframework.cglib.proxy.MethodProxy;
|
||||
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
|
||||
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||
import org.springframework.core.MethodIntrospector;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.ParameterNameDiscoverer;
|
||||
@@ -131,7 +131,7 @@ public class ResolvableMethod {
|
||||
|
||||
private static final SpringObjenesis objenesis = new SpringObjenesis();
|
||||
|
||||
private static final ParameterNameDiscoverer nameDiscoverer = new LocalVariableTableParameterNameDiscoverer();
|
||||
private static final ParameterNameDiscoverer nameDiscoverer = new DefaultParameterNameDiscoverer();
|
||||
|
||||
// Matches ValueConstants.DEFAULT_NONE (spring-web and spring-messaging)
|
||||
private static final String DEFAULT_VALUE_NONE = "\n\t\t\n\t\t\n\uE000\uE001\uE002\n\t\t\t\t\n";
|
||||
|
||||
Reference in New Issue
Block a user