Skip to content
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

Unnecessary warning for repositories (Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection) #29896

Closed
Vlad-Logvin opened this issue Jan 29, 2023 · 1 comment
Labels
for: stackoverflow A question that's better suited to stackoverflow.com in: data Issues in data modules (jdbc, orm, oxm, tx) status: invalid An issue that we don't feel is valid

Comments

@Vlad-Logvin
Copy link

I'm not sure, if this is a bug or not.

After switching spring boot version from 2.7.2 to 3.0.2, I started getting messages "Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection" for some of my repositories.

I created TestRepository and made sure that this method is the cause of my problem.

public interface TestRepository extends Repository<TestEntity, Long> {

    List<TestEntity> findByIdIn(List<Long> ids);
}

Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: by.logvin.test.TestRepository



When I tried to add @param with any text, the warning disappeared.

public interface TestRepository extends Repository<TestEntity, Long> {

    List<TestEntity> findByIdIn(@Param("anytext") List<Long> ids);
}

Does it make sense to have @param in this method?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 29, 2023
@bclozel
Copy link
Member

bclozel commented Jan 30, 2023

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.

Enforcing the name attribute in annotations might be challenging in entire projects. 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!

@bclozel bclozel added for: stackoverflow A question that's better suited to stackoverflow.com in: data Issues in data modules (jdbc, orm, oxm, tx) status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 30, 2023
@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: stackoverflow A question that's better suited to stackoverflow.com in: data Issues in data modules (jdbc, orm, oxm, tx) status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants