diff options
author | Julien Desprez <jdesprez@google.com> | 2017-08-30 00:28:25 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-08-30 00:28:25 +0000 |
commit | a1b6cc809863a9a9a2bd9e01620c435d27bb46b6 (patch) | |
tree | 9a530f7701fd7f59ae1d257fe14eb6e684fe0cdf | |
parent | 4fd6b272e5edc993eb7617e555114104f43c0ec6 (diff) | |
parent | 064dc68f6a8e3dffe7b550a842f214d5d89f9f41 (diff) | |
download | tradefederation-a1b6cc809863a9a9a2bd9e01620c435d27bb46b6.tar.gz |
Merge "Conserve order of keys in device build map" into oc-dev am: 49b8ba806d
am: 064dc68f6a
Change-Id: I53afa37ba6128bdde16f7cf6ff271875eb6736ab
-rw-r--r-- | src/com/android/tradefed/invoker/InvocationContext.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/tradefed/invoker/InvocationContext.java b/src/com/android/tradefed/invoker/InvocationContext.java index f8a4be437..0ebe25c31 100644 --- a/src/com/android/tradefed/invoker/InvocationContext.java +++ b/src/com/android/tradefed/invoker/InvocationContext.java @@ -29,7 +29,6 @@ import com.android.tradefed.util.UniqueMultiMap; import java.io.IOException; import java.io.ObjectInputStream; import java.util.ArrayList; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -61,7 +60,7 @@ public class InvocationContext implements IInvocationContext { * Creates a {@link BuildInfo} using default attribute values. */ public InvocationContext() { - mAllocatedDeviceAndBuildMap = new HashMap<ITestDevice, IBuildInfo>(); + mAllocatedDeviceAndBuildMap = new LinkedHashMap<ITestDevice, IBuildInfo>(); // Use LinkedHashMap to ensure key ordering by insertion order mNameAndDeviceMap = new LinkedHashMap<String, ITestDevice>(); mNameAndBuildinfoMap = new LinkedHashMap<String, IBuildInfo>(); @@ -298,7 +297,7 @@ public class InvocationContext implements IInvocationContext { // our "pseudo-constructor" in.defaultReadObject(); // now we are a "live" object again, so let's init the transient field - mAllocatedDeviceAndBuildMap = new HashMap<ITestDevice, IBuildInfo>(); + mAllocatedDeviceAndBuildMap = new LinkedHashMap<ITestDevice, IBuildInfo>(); mNameAndDeviceMap = new LinkedHashMap<String, ITestDevice>(); } } |