[http-nio-8090-exec-7] WARN org.springframework.core.LocalVariableTableParameterNameDiscoverer - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.octoperf.analysis.rest.server.controller.BenchReportsController
[http-nio-8090-exec-1] WARN org.springframework.core.LocalVariableTableParameterNameDiscoverer - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.octoperf.design.rest.spring.ProjectFilesController
[http-nio-8090-exec-2] WARN org.springframework.core.LocalVariableTableParameterNameDiscoverer - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.octoperf.analysis.rest.server.controller.GraphsController
[http-nio-8090-exec-4] WARN org.springframework.core.LocalVariableTableParameterNameDiscoverer - Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: com.octoperf.analysis.rest.server.controller.MetricsController
Using Spring Boot 3.0.2 with Spring 6.0.4.
Example Controller:
@RestController
@RequestMapping("/analysis/bench-reports")
@AllArgsConstructor(access = PACKAGE)
@FieldDefaults(level = PRIVATE, makeFinal = true)
class BenchReportsController extends AbstractUserCrudController<BenchReport> {
@NonNull
BenchReportCrudService benchReports;
....
}
We don't use any parameter name in autowired constructors.
Comment From: bclozel
This is a deliberate behavior change introduced in #29531. This fallback will be removed in the future so a configuration change is required in your projects.
This warning is not about constructor injection, but in this case the fact that Spring MVC will look at controller method parameters for injection (for example, @RequestParam
arguments). I would suggest following the advice here and enable the "-parameters" compilation flag in your build file as it's easy to apply and doesn't require any code change.
Thanks!
Comment From: jloisel
The problem is, we use code obfuscation in later stage which removes the parameter names from the byte-code. It's not as simple as it seems, but thanks anyway.
Since we cannot use "-parameters" in compiler args, what are our other options to avoid this issue? We always annotate controller method parameters with @RequestParam, @PathVariable or @P.