You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wave-commits@incubator.apache.org by yu...@apache.org on 2016/11/11 16:34:07 UTC
[23/50] [abbrv] incubator-wave git commit: Fix bad casting in
StringMap
Fix bad casting in StringMap
Project: http://git-wip-us.apache.org/repos/asf/incubator-wave/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-wave/commit/a9dfc216
Tree: http://git-wip-us.apache.org/repos/asf/incubator-wave/tree/a9dfc216
Diff: http://git-wip-us.apache.org/repos/asf/incubator-wave/diff/a9dfc216
Branch: refs/heads/swellrt
Commit: a9dfc2164a91ccab2051479c2e72cb88ba1ab408
Parents: 481fe1f
Author: Pablo Ojanguren <pa...@gmail.com>
Authored: Thu Sep 8 18:19:32 2016 +0200
Committer: Pablo Ojanguren <pa...@gmail.com>
Committed: Thu Sep 8 18:19:32 2016 +0200
----------------------------------------------------------------------
.../wave/model/util/CollectionUtils.java | 31 ++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/a9dfc216/wave/src/main/java/org/waveprotocol/wave/model/util/CollectionUtils.java
----------------------------------------------------------------------
diff --git a/wave/src/main/java/org/waveprotocol/wave/model/util/CollectionUtils.java b/wave/src/main/java/org/waveprotocol/wave/model/util/CollectionUtils.java
index f35595e..9f251d1 100644
--- a/wave/src/main/java/org/waveprotocol/wave/model/util/CollectionUtils.java
+++ b/wave/src/main/java/org/waveprotocol/wave/model/util/CollectionUtils.java
@@ -19,6 +19,7 @@
package org.waveprotocol.wave.model.util;
+import org.waveprotocol.wave.client.common.util.JsoStringSet;
import org.waveprotocol.wave.model.util.ReadableStringMap.ProcV;
import java.util.ArrayList;
@@ -515,12 +516,38 @@ public class CollectionUtils {
@Override
public void addAll(ReadableStringSet set) {
- backend.addAll(((StringSetAdapter) set).backend);
+
+ if (set instanceof StringSetAdapter) {
+ backend.addAll(((StringSetAdapter) set).backend);
+ } else if (set instanceof JsoStringSet) {
+ JsoStringSet jsoSet = (JsoStringSet) set;
+ jsoSet.each(new Proc() {
+
+ @Override
+ public void apply(String element) {
+ backend.add(element);
+ }
+
+ });
+ }
}
@Override
public void removeAll(ReadableStringSet set) {
- backend.removeAll(((StringSetAdapter) set).backend);
+
+ if (set instanceof StringSetAdapter) {
+ backend.removeAll(((StringSetAdapter) set).backend);
+ } else if (set instanceof JsoStringSet) {
+ JsoStringSet jsoSet = (JsoStringSet) set;
+ jsoSet.each(new Proc() {
+
+ @Override
+ public void apply(String element) {
+ backend.remove(element);
+ }
+
+ });
+ }
}
@Override