diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-07-25 12:43:44 +0000 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-07-25 12:43:44 +0000 |
commit | b0004167abaa8874f94556da83cb6d0aa0b5e3e6 (patch) | |
tree | 45330d63b15beca2167add40d88a481d54a7dd6b /src/com | |
parent | 7edff2dad305481601cdd6c876d24fd7a4f3f9a3 (diff) | |
download | vaadin-framework-b0004167abaa8874f94556da83cb6d0aa0b5e3e6.tar.gz vaadin-framework-b0004167abaa8874f94556da83cb6d0aa0b5e3e6.zip |
Fix typo preventing StreamVariable cleanup (#9171)
svn changeset:24025/svn branch:6.8
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/CommunicationManager.java | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/CommunicationManager.java b/src/com/vaadin/terminal/gwt/server/CommunicationManager.java index 9c67a03bb3..9f6e0a8aaa 100644 --- a/src/com/vaadin/terminal/gwt/server/CommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/CommunicationManager.java @@ -233,8 +233,8 @@ public class CommunicationManager extends AbstractCommunicationManager { String variableName = parts[1]; String paintableId = parts[0]; - StreamVariable streamVariable = pidToNameToStreamVariable.get( - paintableId).get(variableName); + StreamVariable streamVariable = getStreamVariable(paintableId, + variableName); String secKey = streamVariableToSeckey.get(streamVariable); if (secKey.equals(parts[2])) { @@ -263,6 +263,28 @@ public class CommunicationManager extends AbstractCommunicationManager { } /** + * Gets a stream variable based on paintable id and variable name. Returns + * <code>null</code> if no matching variable has been registered. + * + * @param paintableId + * id of paintable to get variable for + * @param variableName + * name of the stream variable + * @return the corresponding stream variable, or <code>null</code> if not + * found + */ + public StreamVariable getStreamVariable(String paintableId, + String variableName) { + Map<String, StreamVariable> nameToStreamVariable = pidToNameToStreamVariable + .get(paintableId); + if (nameToStreamVariable == null) { + return null; + } + StreamVariable streamVariable = nameToStreamVariable.get(variableName); + return streamVariable; + } + + /** * Handles UIDL request * * TODO document @@ -359,7 +381,7 @@ public class CommunicationManager extends AbstractCommunicationManager { private Map<StreamVariable, String> streamVariableToSeckey; @Override - String getStreamVariableTargetUrl(VariableOwner owner, String name, + public String getStreamVariableTargetUrl(VariableOwner owner, String name, StreamVariable value) { /* * We will use the same APP/* URI space as ApplicationResources but @@ -402,10 +424,10 @@ public class CommunicationManager extends AbstractCommunicationManager { } @Override - protected void cleanStreamVariable(VariableOwner owner, String name) { + public void cleanStreamVariable(VariableOwner owner, String name) { Map<String, StreamVariable> nameToStreamVar = pidToNameToStreamVariable .get(getPaintableId((Paintable) owner)); - nameToStreamVar.remove("name"); + nameToStreamVar.remove(name); if (nameToStreamVar.isEmpty()) { pidToNameToStreamVariable.remove(getPaintableId((Paintable) owner)); } |