-
Notifications
You must be signed in to change notification settings - Fork 257
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
feat(java): add deserial object with feature deserializeNonexistentClassNotWriteFullClassInfo feature #1932
base: main
Are you sure you want to change the base?
Conversation
@@ -193,6 +194,7 @@ public Object read(MemoryBuffer buffer) { | |||
ClassFieldsInfo fieldsInfo = getClassFieldsInfo(classDef); | |||
ObjectSerializer.FinalTypeField[] finalFields = fieldsInfo.finalFields; | |||
boolean[] isFinal = fieldsInfo.isFinal; | |||
Config config = fury.getConfig(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd better get the option here, and pass that flag to getFileName
method
if (index < 0) { | ||
return qualifiedFieldName; | ||
} | ||
return qualifiedFieldName.substring(index + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will create a new string everytime for deserialization, which is very slow. A better method is rename fieldInfo#qualifiedFieldName
into fieldInfo#fieldName
, and build it as qualified based on the option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we should skip duplicated field name in super class if this option is enabled
@shuyufang Seems we can refactor |
…ullClassInfo
What does this PR do?
we has some scene , after the class with the upstream system serialized, the downstream system can not deserialize without the class object, but current .withDeserializeNonexistentClass write the full class info. we want fury support deserialize object when none local class can deserializeNonexistentClassNotWriteFullClassInfo feature
Related issues
Does this PR introduce any user-facing change?
Benchmark