Repository: incubator-wave
Updated Branches:
  refs/heads/master 1a4a7ff5d -> bdb8f24e1


Remove dep on Impl::getNextHashId() by Martin Letis

https://reviews.apache.org/r/38785/

As of
https://gwt.googlesource.com/gwt/+/6d27b4615004569c68c7bbf2b3d04a6c942cd493
the method is no longer available.

Calling Object#hashCode() should "Just Work (TM)" both for jso and java,
as the 'emul' implementation both before and after dankurka's change
default to the previous implementation in JsIdentity{Map,Set}.


Project: http://git-wip-us.apache.org/repos/asf/incubator-wave/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-wave/commit/bdb8f24e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-wave/tree/bdb8f24e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-wave/diff/bdb8f24e

Branch: refs/heads/master
Commit: bdb8f24e1cbcb3e5b1c98199c86632cabd2c8d84
Parents: 1a4a7ff
Author: Ali Lown <[email protected]>
Authored: Wed Sep 30 23:12:23 2015 +0100
Committer: Ali Lown <[email protected]>
Committed: Wed Sep 30 23:12:23 2015 +0100

----------------------------------------------------------------------
 .../wave/client/common/util/JsIdentityMap.java            | 10 +++-------
 .../wave/client/common/util/JsIdentitySet.java            | 10 +++-------
 2 files changed, 6 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/bdb8f24e/src/org/waveprotocol/wave/client/common/util/JsIdentityMap.java
----------------------------------------------------------------------
diff --git a/src/org/waveprotocol/wave/client/common/util/JsIdentityMap.java 
b/src/org/waveprotocol/wave/client/common/util/JsIdentityMap.java
index d321b1e..53e7dbe 100644
--- a/src/org/waveprotocol/wave/client/common/util/JsIdentityMap.java
+++ b/src/org/waveprotocol/wave/client/common/util/JsIdentityMap.java
@@ -93,14 +93,10 @@ public class JsIdentityMap<K, V> implements IdentityMap<K, 
V> {
 
   /**
    * Get the unique id for the object
-   *
-   * TODO(danilatos): See if just calling .hashCode() will "Just Work (TM)"
-   * both for jso and "java' objects at the same time. Then we won't need to
-   * do it manually.
    */
-  private native int getId(K key) /*-{
-    return key.x$h || (key.x$h = 
@com.google.gwt.core.client.impl.Impl::getNextHashId()());
-  }-*/;
+  private int getId(K key) {
+    return key.hashCode();
+  }
 
   /** {@inheritDoc} */
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-wave/blob/bdb8f24e/src/org/waveprotocol/wave/client/common/util/JsIdentitySet.java
----------------------------------------------------------------------
diff --git a/src/org/waveprotocol/wave/client/common/util/JsIdentitySet.java 
b/src/org/waveprotocol/wave/client/common/util/JsIdentitySet.java
index 9f7f6e1..da4300d 100644
--- a/src/org/waveprotocol/wave/client/common/util/JsIdentitySet.java
+++ b/src/org/waveprotocol/wave/client/common/util/JsIdentitySet.java
@@ -78,14 +78,10 @@ public final class JsIdentitySet<T> implements 
IdentitySet<T> {
 
   /**
    * Get the unique id for the object
-   *
-   * TODO(danilatos): See if just calling .hashCode() will "Just Work (TM)"
-   * both for jso and "real java" objects at the same time. Then we won't need
-   * to do it manually.
    */
-  private native int getId(T key) /*-{
-    return key.x$h || (key.x$h = 
@com.google.gwt.core.client.impl.Impl::getNextHashId()());
-  }-*/;
+  private int getId(T key) {
+    return key.hashCode();
+  }
 
   private final native void eachInner(IntMapJsoView<T> elements, Proc<? super 
T> proc) /*-{
     for (var k in elements) {

Reply via email to