mirror of
https://github.com/google/flatbuffers.git
synced 2026-08-06 22:29:34 +00:00
[Java] Fix key lookup returning null clashing with default value (#7236)
A field with key attribute must always be written on the message so it can be looked up by key. There is a edge case where inserting a key field with same value as default would prevent it to be written on the message and later cannot be found when searched by key.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
namespace DictionaryLookup;
|
||||
|
||||
table LongFloatEntry {
|
||||
key: long (key);
|
||||
value: float;
|
||||
}
|
||||
|
||||
table LongFloatMap {
|
||||
entries: [LongFloatEntry];
|
||||
}
|
||||
root_type LongFloatMap;
|
||||
Reference in New Issue
Block a user