Conversation
isComplexType uses type >= CORE_ARRAY || type <= CORE_OBJECT, which incorrectly returns true for nearly all types; basic types are misclassified as complex, leading to incorrect serialization/deserialization flow for most values. Change || to &&
mondain
left a comment
There was a problem hiding this comment.
I think this may not be quite right, but if && is used instead of ||, the type could never be equal to CORE_ARRAY "or" CORE_OBJECT
|
What is the correct behavior here? I'm a little blurry on what it's trying to accomplish. With it changed to && this is the truth table for this function:
How is this supposed to work? |
This is where we'll run into dragons, with this being legacy AMF, I can only look a the statement to discern what was implied. The way I read the original it looks like only these 4 types would pass, but the way its written is confusing and sub-optimal IMHO; if I were to do this today, I'd probably use a static array and check for membership or being lazy use a few "||" in a row. |
Commit from kdkd fork
e514d5fio/object/DataTypes.java:
isComplexType uses type >= CORE_ARRAY || type <= CORE_OBJECT, which
incorrectly returns true for nearly all types; basic types are misclassified
as complex, leading to incorrect serialization/deserialization flow for most
values.
Change || to &&