From f4cc386e915407ca4f7eed0441c4a44468a0e4fe Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 5 Feb 2013 13:16:35 +0200 Subject: Use native collections in AbstractConnector Change-Id: I027cd296e5014d38e908915d537c58f87ebefc50 --- client/src/com/vaadin/client/ui/AbstractConnector.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'client/src') diff --git a/client/src/com/vaadin/client/ui/AbstractConnector.java b/client/src/com/vaadin/client/ui/AbstractConnector.java index 2791cfddd9..f9c74cc5c9 100644 --- a/client/src/com/vaadin/client/ui/AbstractConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractConnector.java @@ -58,7 +58,7 @@ public abstract class AbstractConnector implements ServerConnector, private HandlerManager handlerManager; private FastStringMap statePropertyHandlerManagers; - private Map> rpcImplementations; + private FastStringMap> rpcImplementations; private final boolean debugLogging = false; private SharedState state; @@ -68,7 +68,7 @@ public abstract class AbstractConnector implements ServerConnector, * A map from client-to-server RPC interface class to the RPC proxy that * sends outgoing RPC calls for that interface. */ - private Map, ServerRpc> rpcProxyMap = new HashMap, ServerRpc>(); + private FastStringMap rpcProxyMap = FastStringMap.create(); /** * Temporary storage for last enabled state to be able to see if it has @@ -145,7 +145,7 @@ public abstract class AbstractConnector implements ServerConnector, T implementation) { String rpcInterfaceId = rpcInterface.getName().replaceAll("\\$", "."); if (null == rpcImplementations) { - rpcImplementations = new HashMap>(); + rpcImplementations = FastStringMap.create(); } if (null == rpcImplementations.get(rpcInterfaceId)) { rpcImplementations.put(rpcInterfaceId, new ArrayList()); @@ -182,10 +182,11 @@ public abstract class AbstractConnector implements ServerConnector, * server. */ protected T getRpcProxy(Class rpcInterface) { - if (!rpcProxyMap.containsKey(rpcInterface)) { - rpcProxyMap.put(rpcInterface, RpcProxy.create(rpcInterface, this)); + String name = rpcInterface.getName(); + if (!rpcProxyMap.containsKey(name)) { + rpcProxyMap.put(name, RpcProxy.create(rpcInterface, this)); } - return (T) rpcProxyMap.get(rpcInterface); + return (T) rpcProxyMap.get(name); } @Override -- cgit v1.2.3