-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile sources with '-parameters' to retain method parameter names #3776
Conversation
Signed-off-by: Yanming Zhou <[email protected]>
It'd be good to understand when/why this is happening. It may be that Spring should not even be doing introspection in this case. Compiling with |
@SpringBootTest
@ExtendWith(OutputCaptureExtension.class)
public class ApplicationTests {
@Test
void shouldNotOutputDeprecatedLogging(CapturedOutput output){
assertThat(output).doesNotContain("Compile the affected code with '-parameters' instead or avoid its introspection: io.micrometer.core.aop.CountedAspect"); // failed
}
} plugins {
id 'java'
id 'org.springframework.boot' version '3.0.5'
id 'io.spring.dependency-management' version '1.1.0'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
} |
It's weird that |
Thank you for the quick response and the reproducer. I'm asking someone from the Spring Framework team to take a look to determine if there is something to fix on the framework side.
I agree, and I'm not sure why it's different. |
It triggered by micrometer/micrometer-core/src/main/java/io/micrometer/core/aop/CountedAspect.java Lines 185 to 186 in 9b61c23
|
Thank you for the analysis. I think we can change the aspect code so that referencing a named parameter is not necessary. I don't see any reason why we needed to do it that way. Edit: I opened #3780 which should avoid the issue whether we compile with |
Superseded by #3780 |
Fix warning raised by spring