Skip to content

Commit 7816c9e

Browse files
committed
Exclude LocalVariableTableParameterNameDiscoverer based on native image check
See gh-29531
1 parent d32027d commit 7816c9e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

spring-core/src/main/java/org/springframework/core/DefaultParameterNameDiscoverer.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616

1717
package org.springframework.core;
1818

19-
import org.springframework.aot.AotDetector;
20-
2119
/**
2220
* Default implementation of the {@link ParameterNameDiscoverer} strategy interface,
2321
* using the Java 8 standard reflection mechanism (if available), and falling back
24-
* to the ASM-based {@link LocalVariableTableParameterNameDiscoverer} (when not using
25-
* AOT-processed optimizations) for checking debug information in the class file.
22+
* to the ASM-based {@link LocalVariableTableParameterNameDiscoverer} (when not in
23+
* a native image) for checking debug information in the class file.
2624
*
2725
* <p>If a Kotlin reflection implementation is present,
2826
* {@link KotlinReflectionParameterNameDiscoverer} is added first in the list and
@@ -45,7 +43,7 @@ public DefaultParameterNameDiscoverer() {
4543
addDiscoverer(new KotlinReflectionParameterNameDiscoverer());
4644
}
4745
addDiscoverer(new StandardReflectionParameterNameDiscoverer());
48-
if (!AotDetector.useGeneratedArtifacts()) {
46+
if (!NativeDetector.inNativeImage()) {
4947
addDiscoverer(new LocalVariableTableParameterNameDiscoverer());
5048
}
5149
}

0 commit comments

Comments
 (0)