summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-02-05 13:16:35 +0200
committerVaadin Code Review <review@vaadin.com>2013-02-06 14:30:15 +0000
commitf4cc386e915407ca4f7eed0441c4a44468a0e4fe (patch)
tree7c7881840944e35f38eb0628734d2b9c0b5060bc
parentc011e166e102c95a5ad4848bba7833ce18830a6b (diff)
downloadvaadin-framework-f4cc386e915407ca4f7eed0441c4a44468a0e4fe.tar.gz
vaadin-framework-f4cc386e915407ca4f7eed0441c4a44468a0e4fe.zip
Use native collections in AbstractConnector
Change-Id: I027cd296e5014d38e908915d537c58f87ebefc50
-rw-r--r--client/src/com/vaadin/client/ui/AbstractConnector.java13
1 files changed, 7 insertions, 6 deletions
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<HandlerManager> statePropertyHandlerManagers;
- private Map<String, Collection<ClientRpc>> rpcImplementations;
+ private FastStringMap<Collection<ClientRpc>> 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<Class<?>, ServerRpc> rpcProxyMap = new HashMap<Class<?>, ServerRpc>();
+ private FastStringMap<ServerRpc> 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<String, Collection<ClientRpc>>();
+ rpcImplementations = FastStringMap.create();
}
if (null == rpcImplementations.get(rpcInterfaceId)) {
rpcImplementations.put(rpcInterfaceId, new ArrayList<ClientRpc>());
@@ -182,10 +182,11 @@ public abstract class AbstractConnector implements ServerConnector,
* server.
*/
protected <T extends ServerRpc> T getRpcProxy(Class<T> 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