Exclude LocalVariableTableParameterNameDiscoverer based on native image check
See gh-29531
This commit is contained in:
parent
d32027df92
commit
7816c9e411
|
|
@ -16,13 +16,11 @@
|
|||
|
||||
package org.springframework.core;
|
||||
|
||||
import org.springframework.aot.AotDetector;
|
||||
|
||||
/**
|
||||
* Default implementation of the {@link ParameterNameDiscoverer} strategy interface,
|
||||
* using the Java 8 standard reflection mechanism (if available), and falling back
|
||||
* to the ASM-based {@link LocalVariableTableParameterNameDiscoverer} (when not using
|
||||
* AOT-processed optimizations) for checking debug information in the class file.
|
||||
* to the ASM-based {@link LocalVariableTableParameterNameDiscoverer} (when not in
|
||||
* a native image) for checking debug information in the class file.
|
||||
*
|
||||
* <p>If a Kotlin reflection implementation is present,
|
||||
* {@link KotlinReflectionParameterNameDiscoverer} is added first in the list and
|
||||
|
|
@ -45,7 +43,7 @@ public class DefaultParameterNameDiscoverer extends PrioritizedParameterNameDisc
|
|||
addDiscoverer(new KotlinReflectionParameterNameDiscoverer());
|
||||
}
|
||||
addDiscoverer(new StandardReflectionParameterNameDiscoverer());
|
||||
if (!AotDetector.useGeneratedArtifacts()) {
|
||||
if (!NativeDetector.inNativeImage()) {
|
||||
addDiscoverer(new LocalVariableTableParameterNameDiscoverer());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue