Skip to content

Commit

Permalink
Do not use LocalVariableTableParameterNameDiscoverer in native images
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Nov 20, 2022
1 parent da12481 commit f8fa9d6
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -19,8 +19,9 @@
/**
* 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} for checking
* debug information in the class file.
* on the JVM (not in native images) to the ASM-based
* {@link LocalVariableTableParameterNameDiscoverer} 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
Expand All @@ -43,7 +44,9 @@ public DefaultParameterNameDiscoverer() {
addDiscoverer(new KotlinReflectionParameterNameDiscoverer());
}
addDiscoverer(new StandardReflectionParameterNameDiscoverer());
addDiscoverer(new LocalVariableTableParameterNameDiscoverer());
if (!NativeDetector.inNativeImage()) {
addDiscoverer(new LocalVariableTableParameterNameDiscoverer());
}
}

}

0 comments on commit f8fa9d6

Please sign in to comment.