Archived
This forum has been archived. Please start a new discussion on GitHub.
slice2freeze: warning: use of sequences
Andrew
in Help Center
Hi,
after the update to ice 3.3.0 I receive that warning:
slice2freeze: warning: use of sequences in dictionary keys has been deprecated
why I can't use of sequences in dictionary?
Andrew
after the update to ice 3.3.0 I receive that warning:
slice2freeze: warning: use of sequences in dictionary keys has been deprecated
why I can't use of sequences in dictionary?
Andrew
0
Comments
-
Hi Andrew,
This warning is actually not Freeze-specific; you'll also get it if you try to use a sequence as a key in a regular Slice dictionary.
Out of curiosity, could you post the Slice definition for this key? Also, which language mapping do you use?
We decided to deprecate sequences in dictionary keys because their language mapping is problematic, and sometimes very error-prone. One obvious issue is in Java, where by default a Slice sequence is mapped to a Java array. The default equals() for array objects is reference equality, which is not appropriate when comparing the keys of a map.
Best regards,
Bernard0 -
There is currently no alternative.
Since this sequence-in-keys feature is deprecated, but still there, you could still use it for now. In Java, I recommend to map the sequence(s) in your keys to something other than the default (array), since array equals is just Object equality, which is not desirable or correct.
See Customizing the Java Mapping - Ice 3.5 - ZeroC
Best regards,
Bernard0
