Iteration order of HashSet/Map changes between JRE 7 and JRE 8, breaking tests. Switch to LinkedHashSet/Map.

This commit is contained in:
Adrian Cole 2014-10-25 10:17:51 -07:00 committed by Adrian Cole
parent 354fee9c42
commit 143b5e7e1d
2 changed files with 2 additions and 2 deletions

View File

@ -161,7 +161,7 @@ public class GoogleComputeEngineService extends BaseComputeService {
}
};
Set<AtomicReference<Operation>> operations = Sets.newHashSet();
Set<AtomicReference<Operation>> operations = Sets.newLinkedHashSet();
for (Firewall firewall : firewallApi.list().concat().filter(firewallBelongsToNetwork)) {
operations.add(new AtomicReference<Operation>(firewallApi.delete(firewall.getName())));
}

View File

@ -150,7 +150,7 @@ public class CreateNodesWithGroupEncodedIntoNameThenAddToSet extends
String projectName = userProject.get();
FirewallApi firewallApi = api.getFirewallApiForProject(projectName);
Set<AtomicReference<Operation>> operations = Sets.newHashSet();
Set<AtomicReference<Operation>> operations = Sets.newLinkedHashSet();
for (Integer port : templateOptions.getInboundPorts()) {
String name = naming.name(port);