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

Fail to compile Records with non-boolean fields prefixed with is #281

Open
daniel-b2c2 opened this issue Nov 22, 2024 · 2 comments
Open

Comments

@daniel-b2c2
Copy link

daniel-b2c2 commented Nov 22, 2024

The following 'bad' snippet:

@CompiledJson
public record MyClass(
        @JsonAttribute(name = "issuer") String issuer){}

This fails with

error: Unable to find matching property: 'issuer' used in constructor. Either use annotation processor on source code, on bytecode with -parameters flag (to enable parameter names) or manually create an instance via converter
@CompiledJson
^

But in the following 'good' snippet, if you change the name to notissuer, then this works fine.

@CompiledJson
public record MyClass(
        @JsonAttribute(name = "issuer") String notissuer){}

Anybody else see this? Is this some weird interaction with boolean-style boolean isSuer() style fields? For clarity, the field is issuer as in getIssuer not suer as in isSuer

@daniel-b2c2 daniel-b2c2 changed the title Bug with non-boolean fields prefixed with is Bug with non-boolean fields prefixed with is in records Nov 22, 2024
@daniel-b2c2 daniel-b2c2 changed the title Bug with non-boolean fields prefixed with is in records Bug with non-boolean fields prefixed with is in Records Nov 22, 2024
@daniel-b2c2 daniel-b2c2 changed the title Bug with non-boolean fields prefixed with is in Records Fail to compile Records with non-boolean fields prefixed with is Nov 22, 2024
@zapov
Copy link
Member

zapov commented Dec 3, 2024

Tnx for the report.
It seems the bean name detection was buggy.
I've pushed a fix to master to fix it.

@daniel-b2c2
Copy link
Author

daniel-b2c2 commented Dec 7, 2024

Many thanks for the rapid fix. Will await a new version in maven central 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants