[MDSAL-273] Binding Data Codec: Java Implementation is not compatible with Binding DataObject Proxy for binary type Created: 06/Jul/17 Updated: 09/Mar/18 Resolved: 26/Jan/18 |
|
| Status: | Resolved |
| Project: | mdsal |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Carbon |
| Type: | Bug | ||
| Reporter: | wu sandi | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 8806 |
| Description |
|
The java Implementation is not compatible with the corresponding binding dataObject proxy for binary type. The reason bebind this behavior is that the ValueTypeCodec for binay type is NOOP_CODEC, whose source code is below:
@Override @Override public Object deserialize(final Object input) { return input; } }; As shown above, all of number and binary and string type all use NOOP_CODEC, but number and string is invariant, but the representation of binary type is byte array which is variant. The bug is a back door to change the value of binary type? |
| Comments |
| Comment by wu sandi [ 06/Jul/17 ] |
|
In addition, although the byte array is changed for binay type, the hashCode of the NormalizedNode which owns the binary type is not changed. So its a little strange, the value changed but the hashCode not changed. |
| Comment by wu sandi [ 06/Jul/17 ] |
|
In addition, the java type of the container node is ImmutableContainerNode. It is immutable, but due to binary type, it seems to be mutable(real changed, but its hashcode is not changed). Much more strange! |
| Comment by Martin Ciglan [ 10/Jul/17 ] |
|
quite busy now, will check this out later on and respond... leaving UNCONFIRMED |
| Comment by Robert Varga [ 26/Jan/18 ] |
|
Fixed in yangtools via https://git.opendaylight.org/gerrit/61464. |