Skip to content

Commit

Permalink
Do not use LocalVariableTableParameterNameDiscoverer in AOT mode
Browse files Browse the repository at this point in the history
Closes gh-29531
  • Loading branch information
sdeleuze committed Nov 21, 2022
1 parent 04366f4 commit f4e23fe
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

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} for checking
* debug information in the class file.
* to the ASM-based {@link LocalVariableTableParameterNameDiscoverer} (when not using
* AOT-processed optimizations) 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 +45,9 @@ public DefaultParameterNameDiscoverer() {
addDiscoverer(new KotlinReflectionParameterNameDiscoverer());
}
addDiscoverer(new StandardReflectionParameterNameDiscoverer());
addDiscoverer(new LocalVariableTableParameterNameDiscoverer());
if (!AotDetector.useGeneratedArtifacts()) {
addDiscoverer(new LocalVariableTableParameterNameDiscoverer());
}
}

}

0 comments on commit f4e23fe

Please sign in to comment.