From 490b5b9764d7d76fd42b4ea133ac5642fca6f95b Mon Sep 17 00:00:00 2001 From: Jamie Doornbos Date: Tue, 29 Apr 2008 19:02:13 +0000 Subject: [PATCH] Bureaucracy: Fixed my TODO about using google's Maps and Sets utils git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5031 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../bureau/server/BureauRegistry.java | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/java/com/threerings/bureau/server/BureauRegistry.java b/src/java/com/threerings/bureau/server/BureauRegistry.java index d7a020bad..4fb4f3d15 100644 --- a/src/java/com/threerings/bureau/server/BureauRegistry.java +++ b/src/java/com/threerings/bureau/server/BureauRegistry.java @@ -23,9 +23,6 @@ package com.threerings.bureau.server; import java.util.Map; import java.util.Set; -import java.util.HashMap; -import java.util.HashSet; - import com.threerings.bureau.data.AgentObject; import com.threerings.bureau.data.BureauCodes; import com.threerings.presents.data.ClientObject; @@ -35,7 +32,8 @@ import com.threerings.presents.dobj.ObjectDestroyedEvent; import com.threerings.presents.server.InvocationManager; import com.samskivert.util.StringUtil; import com.samskivert.util.ProcessLogger; - +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; import com.threerings.bureau.Log; /** @@ -251,7 +249,7 @@ public class BureauRegistry ", launching pending agents"); // find all pending agents - Set pending = new HashSet(); + Set pending = Sets.newHashSet(); for (Map.Entry entry : bureau.agentStates.entrySet()) { @@ -480,8 +478,7 @@ public class BureauRegistry ClientObject clientObj; // The states of the various agents allocated to this bureau - Map agentStates = - new HashMap(); + Map agentStates = Maps.newHashMap(); boolean ready () { @@ -515,16 +512,9 @@ public class BureauRegistry } } - // More readable generic map creation - // TODO: add to library or use existing - protected static HashMap hashMap () - { - return new HashMap(); - } - protected String _serverNameAndPort; protected InvocationManager _invmgr; protected RootDObjectManager _omgr; - protected Map _generators = hashMap(); - protected Map _bureaus = hashMap(); + protected Map _generators = Maps.newHashMap(); + protected Map _bureaus = Maps.newHashMap(); }