diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2015-05-13 12:40:23 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2015-05-15 09:43:26 +0000 |
commit | a8094a8c86876aa26eb3d02aafd792bcda3c3850 (patch) | |
tree | 3185e3252881501b9095073258a828dafcec5cc3 /src/main/java/com | |
parent | a7f4851146fb41ca03f294d74a93dcde005906ee (diff) |
Use a LinkedHashMap do the addition of dictionnaries
Previously, the resulting map was using a HashMap as an intermediate
map to construct the final map then converted to an ImmutableMap.
HashMap iteration or is non-deterministic and can even vary between
execution of the same binary.
--
MOS_MIGRATED_REVID=93512467
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/syntax/BinaryOperatorExpression.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/BinaryOperatorExpression.java b/src/main/java/com/google/devtools/build/lib/syntax/BinaryOperatorExpression.java index 3d6b593a93..ff7c322633 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/BinaryOperatorExpression.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/BinaryOperatorExpression.java @@ -300,7 +300,8 @@ public final class BinaryOperatorExpression extends Expression { if (lval instanceof Map<?, ?> && rval instanceof Map<?, ?>) { Map<?, ?> ldict = (Map<?, ?>) lval; Map<?, ?> rdict = (Map<?, ?>) rval; - Map<Object, Object> result = Maps.newHashMapWithExpectedSize(ldict.size() + rdict.size()); + Map<Object, Object> result = + Maps.newLinkedHashMapWithExpectedSize(ldict.size() + rdict.size()); result.putAll(ldict); result.putAll(rdict); return ImmutableMap.copyOf(result); |