mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 21:27:31 +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:
11
tests/dictionary_lookup.fbs
Normal file
11
tests/dictionary_lookup.fbs
Normal file
@@ -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