alibaba / alibaba/fastjson2

[BUG] APT codegen optimization

Open
#2,784 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

### Problem Description
ObjectReaderCreatorASM has optimization branch for field name length between 5 and 7.

https://github.com/alibaba/fastjson2/blob/88a4f7c508fe010d1c5eb38124d92f58d62c23fa/core/src/main/java/com/alibaba/fastjson2/reader/ObjectReaderCreatorASM.java#L1621-L1660

But JSONCompiledAnnotationProcessor is missing corresponding branch.

https://github.com/alibaba/fastjson2/blob/88a4f7c508fe010d1c5eb38124d92f58d62c23fa/codegen/src/main/java/com/alibaba/fastjson2/internal/processor/JSONCompiledAnnotationProcessor.java#L833-L836

### Environment Information
- Fastjson2 2.0.52-SNAPSHOT

Contributor guide

Open the contributing guide

Research direction

Compare the field-name-length branches in core/src/main/java/com/alibaba/fastjson2/reader/ObjectReaderCreatorASM.java around lines 1621-1660 with codegen/src/main/java/com/alibaba/fastjson2/internal/processor/JSONCompiledAnnotationProcessor.java around lines 833-836. Trace the existing generated-reader validation entry points, then confirm that annotation-processor output handles field names of length 5 through 7 with the corresponding optimization.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.