You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Smile reader doesn’t do well with a map with an empty String key.
Map map = new HashMap();
map.put("foo", Collections.singletonMap("", "bar"));
ObjectMapper smileMapper = new ObjectMapper(new SmileFactory());
byte[] bytes = smileMapper.writer().writeValueAsBytes(map);
smileMapper.reader().readTree(new ByteArrayInputStream(bytes));
I get this exception:
Exception in thread "main" com.fasterxml.jackson.core.JsonParseException: Invalid shared name reference 2; only got 1 names in buffer (invalid content)
at [Source: java.io.ByteArrayInputStream@30c7da1e; line: -1, column: 12]
The text was updated successfully, but these errors were encountered:
So this is a regression from 2.5, due to rewrite of nextFieldName() method; it does not update state properly for the case of empty String (which has its dedicated token byte, separate from others).
The reason it had gone undetected is probably because:
Use of empty String as JSON Object key is not very common AND
This only caused problems with nextFieldName() but NOT with nextToken().
(problem reported by user via email)
Smile reader doesn’t do well with a map with an empty String key.
I get this exception:
Exception in thread "main" com.fasterxml.jackson.core.JsonParseException: Invalid shared name reference 2; only got 1 names in buffer (invalid content)
at [Source: java.io.ByteArrayInputStream@30c7da1e; line: -1, column: 12]
The text was updated successfully, but these errors were encountered: