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

Reflection free serializers ArrayIndexOutOfBoundsException #44433

Closed
burl21 opened this issue Nov 12, 2024 · 4 comments · Fixed by #44457
Closed

Reflection free serializers ArrayIndexOutOfBoundsException #44433

burl21 opened this issue Nov 12, 2024 · 4 comments · Fixed by #44457
Labels
area/jackson Issues related to Jackson (JSON library) kind/bug Something isn't working
Milestone

Comments

@burl21
Copy link
Contributor

burl21 commented Nov 12, 2024

Describe the bug

When updating from version 3.15.1 to 3.16.2, the build fails due to the property:

quarkus.rest.jackson.optimization.enable-reflection-free-serializers=true.

In JacksonCodeGenerator at line 284, the check passes, but set is the name of a field rather than a method prefix.

record ExampleRequestBody(boolean required, boolean set) {}

Stack Trace

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
        at org.jboss.jandex.MethodInfo.parameterType(MethodInfo.java:180)
        at io.quarkus.resteasy.reactive.jackson.deployment.processor.JacksonCodeGenerator$FieldSpecs.fieldType(JacksonCodeGenerator.java:285)
        at io.quarkus.resteasy.reactive.jackson.deployment.processor.JacksonCodeGenerator$FieldSpecs.<init>(JacksonCodeGenerator.java:271)
        at io.quarkus.resteasy.reactive.jackson.deployment.processor.JacksonCodeGenerator.fieldSpecsFromField(JacksonCodeGenerator.java:235)
        at io.quarkus.resteasy.reactive.jackson.deployment.processor.JacksonSerializerFactory.serializeFields(JacksonSerializerFactory.java:224)
        at io.quarkus.resteasy.reactive.jackson.deployment.processor.JacksonSerializerFactory.serializeObjectData(JacksonSerializerFactory.java:217)
        at io.quarkus.resteasy.reactive.jacployment.processor.JacksonSerializerFactory.create(JacksonSerializerFactory.java:138)actory.java:200)
        at io.quarkus.resteasy.reactive.jackson.deployment.processor.ResteasyReactiveJacksonProcessor.handleEndpointParams(ResteasyReactiveJacksonProcessor.java:419)
        at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
        at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
        at java.base/java.lang.Thread.run(Thread.java:1575)
        at org.jboss.threads.JBossThread.run(JBossThread.java:499)

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

openjdk version "23.0.1" 2024-10-15 OpenJDK Runtime Environment Homebrew (build 23.0.1) OpenJDK 64-Bit Server VM Homebrew (build 23.0.1, mixed mode, sharing)

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@burl21 burl21 added the kind/bug Something isn't working label Nov 12, 2024
@gsmet gsmet added area/jackson Issues related to Jackson (JSON library) and removed triage/needs-triage labels Nov 12, 2024
Copy link

quarkus-bot bot commented Nov 12, 2024

/cc @geoand (jackson), @mariofusco (jackson)

@geoand
Copy link
Contributor

geoand commented Nov 12, 2024

@burl21 thank you for reporting!

As you have already analyzed the code, would you be willing to contribute a fix?

@burl21
Copy link
Contributor Author

burl21 commented Nov 12, 2024

@geoand yes

@geoand
Copy link
Contributor

geoand commented Nov 12, 2024

🙏🏽

burl21 added a commit to burl21/quarkus that referenced this issue Nov 13, 2024
gsmet added a commit that referenced this issue Nov 13, 2024
Support for short and uncommon field names like set, get, and is
@quarkus-bot quarkus-bot bot added this to the 3.18 - main milestone Nov 13, 2024
@gsmet gsmet modified the milestones: 3.18 - main, 3.16.4 Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/jackson Issues related to Jackson (JSON library) kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants