-
Notifications
You must be signed in to change notification settings - Fork 575
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
[FIX] custom fix when xml adapter has names #3052
Conversation
Jenkins retest this please |
|
||
XmlElements elements = findAnnotation(XmlElements.class, a, false, false, false); | ||
if (elements != null) { | ||
for (XmlElement elem : elements.value()) { |
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.
can't we check jsonHandleXmlAnyElementsNames before the loop, so we can avoid unnecessary processing (I know that over time JIT will do the job... but still)
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.
it won't give the same outcome.
@@ -1160,4 +1171,8 @@ public void setClassLoader(ClassLoader classLoader) { | |||
public ClassLoader getClassLoader() { | |||
return classLoader; | |||
} | |||
|
|||
public void setXmlAnyElementsNames(boolean jsonHandleXmlAnyElementsNames) { |
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.
is this method used only for testing purposes? if yes... maybe there's a better way to do so.... I personally like Anonymous classes for hack the tested class... but I also understand that it might not be the most popular design choice.
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.
Excellent work @elguardian
Co-authored-by: Enrique <[email protected]>
Co-authored-by: Enrique <[email protected]>
The performance problem was related to the polymorphic feature of jackson. it computes the subtypes of a given types.
Before the patch we were saying that all classes contained in the kjar/project where subtypes of every class causing a huge impact in performance
That performance problem was causing another problem, it was overwriting the proper names for types
Every class when you are serializing you have the full qualified name and the name used for serialized and deserialized
So before the patch we were overwriting that information making this feature not working properly
Now because the subtypes are being computed properly we are not overwriting the names therefore now the name is being taken from the annotation like it should be