OF-2814: Ensure that multi-byte characters in the XMPP data are parsed properly
Prioer to this change, parsing errors occurred when multi-byte characters where provided to the parser byte-by-byte (or in byte arrays where a multi-byte character was split over more than one byte array).
This commit re-introduces the fix for this problem that was created under OF-458. It uses a CharsetDecoder that will only read 'enough' bytes from an array, leaving bytes that form an incomplete character in the byte array (to be processed in the next iteration, when hopefully more data was added).
The original fix is refactored a little to account for the different API that is provided by Netty (as compared to the old MINA based code), and to facilitate unit testing (of which a couple are added).
OF-2833: Fix serialization of User when date properties are null
Since OF-2768, various 'date'-based properties of the User class are more likely to be null (especially in context of LDAP/AD).
In this commit, a serialization issue is fixed that is triggered by these null-values.
OF-2832: When merging data, handle null values
When merging VCard data, if either the left-hand or right-hand side data is null, simply return the other bit. The code already did this in one direction, but now does it for the other direction too.
This allows a VCard for a non-existing user to be set (which fixes setting avatars for MUC rooms).