[ 
https://issues.apache.org/jira/browse/GEODE-10076?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17538923#comment-17538923
 ] 

ASF GitHub Bot commented on GEODE-10076:
----------------------------------------

albertogpz opened a new pull request, #973:
URL: https://github.com/apache/geode-native/pull/973

   The Geode C++ native client library serializes strings of PdxSerializable 
objects with DSCode CacheableString.
   Nevertheless, the Java client, in order to serialize Strings, it analyzes 
them and different DSCodes are assigned depending on the contents (only ASCII 
vs not only ASCII chars) and length. In the native client, it's always set to 
CacheableString, whenever for example in the case of an ASCII string should be 
CacheableASCIIString.
   
   This can provoke that two objects with the same contents created one by the 
native client and the other by the Java classes return false when compared with 
the equals method.
   
   The writeString() method of the DataOutput() class of the Geode C++ native 
client library has been aligned with its counterpart in the Java library so 
that the serialization is the same in both cases.
   




> Fix string codepoint detection
> ------------------------------
>
>                 Key: GEODE-10076
>                 URL: https://issues.apache.org/jira/browse/GEODE-10076
>             Project: Geode
>          Issue Type: Improvement
>          Components: native client
>            Reporter: Mario Salazar de Torres
>            Assignee: Mario Salazar de Torres
>            Priority: Major
>
> *GIVEN* a PdxSerializable implementation with a string field
> *WHEN* an ASCII string is written
> *THEN* the string is serialized with the DSCode CacheableString
> ----
> *Additional information.* In the Java client, whenever writing an string, the 
> string is parsed and the DSCode is assigned depending on the string 
> codification. In the native client, it's always set to CacheableString, 
> whenever for example in the case of an ASCII string should be 
> CacheableASCIIString
> Also I've noticed the following scenario requires to fix the codepoint 
> detection:
> # From a native client, I create an object using a PdxSerializable 
> implementation, which has an String field. 
> # After that, we are reading this object from a java client which cache has 
> readPdxSerialized=true and comparing it with a PdxInstance created locally 
> inside the Java client.
> # As PdxInstanceImpl.equals method uses rawBytes for strings, if the string 
> is serialized using different DSCodes, the comparison will fail, even if the 
> length and content are the same.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to