-
Notifications
You must be signed in to change notification settings - Fork 555
feat: add fastjson2-extension-vertx module #4002
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
Open
jujn
wants to merge
10
commits into
alibaba:main
Choose a base branch
from
jujn:feat_3994
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+15,286
−40
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e50d110
build: add fastjson2-extension-vertx module scaffolding
jujn 93c0bd4
feat: init SPI loader, add compatible readers/writers, implement Fast…
jujn 466b678
test: add unit tests from Vertx official built-in
jujn aa54dda
test: add compatibility test and JMH performance test
jujn de7bfe4
test: move benchmark tests to extension-vertx(need jdk17)
jujn 63052e5
fix: allow custom ByteArrayWriter
jujn 790e33b
fix: when creator=reflect, alphabetic=false does not take effect
jujn 1253dfa
Merge remote-tracking branch 'upstream/main' into feat_3994
jujn 48e869a
optimize: add URL Safe (no padding) Base64 parsing feature
jujn 88a523b
update
jujn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -451,17 +451,18 @@ boolean record = BeanUtils.isRecord(objectClass); | |
| } | ||
|
|
||
| long writerFieldFeatures = features | beanFeatures; | ||
| boolean fieldBased = (writerFieldFeatures & JSONWriter.Feature.FieldBased.mask) != 0; | ||
| boolean fieldBased = ((writerFieldFeatures & JSONWriter.Feature.FieldBased.mask) != 0 && !objectClass.isInterface()) | ||
| || !beanInfo.alphabetic; | ||
|
Comment on lines
-454
to
+455
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里修复 creator=reflect 时,设置 alphabetic=false(序列化对象字段的输出顺序)不生效的问题;同时调整了其它地方,与 creator=asm 保持一致 |
||
|
|
||
| if (fieldBased && (record || objectClass.isInterface())) { | ||
| if (fieldBased && record) { | ||
| fieldBased = false; | ||
| } | ||
|
|
||
| List<FieldWriter> fieldWriters; | ||
| Map<String, FieldWriter> fieldWriterMap = new LinkedHashMap<>(); | ||
| final FieldInfo fieldInfo = new FieldInfo(); | ||
|
|
||
| if (fieldBased) { | ||
| Map<String, FieldWriter> fieldWriterMap = new TreeMap<>(); | ||
| BeanUtils.declaredFields(objectClass, field -> { | ||
| fieldInfo.init(); | ||
| FieldWriter fieldWriter = createFieldWriter(objectClass, writerFieldFeatures, provider, beanInfo, fieldInfo, field); | ||
|
|
@@ -484,8 +485,6 @@ boolean record = BeanUtils.isRecord(objectClass); | |
| } | ||
|
|
||
| if (!fieldWritersCreated) { | ||
| Map<String, FieldWriter> fieldWriterMap = new LinkedHashMap<>(); | ||
|
|
||
| if (!record) { | ||
| BeanUtils.declaredFields(objectClass, field -> { | ||
| fieldInfo.init(); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.