Reviewers: zundel,
Message:
This is causing PersistentUnitCache to never re-use generated types.
The deserialized ContentId hashCodes don't match the in-memory ContentId
hashCodes because getClass().hashCode() isn't stable across VM
instances.
Please review this at http://gwt-code-reviews.appspot.com/1435801/
Affected files:
M dev/core/src/com/google/gwt/dev/util/StringKey.java
Index: dev/core/src/com/google/gwt/dev/util/StringKey.java
diff --git a/dev/core/src/com/google/gwt/dev/util/StringKey.java
b/dev/core/src/com/google/gwt/dev/util/StringKey.java
index
c7ac19aeb4393adeeb615a332dc2827c8d14701e..5236ca2fd3e274802e3ba50a47a8efb56061236b
100644
--- a/dev/core/src/com/google/gwt/dev/util/StringKey.java
+++ b/dev/core/src/com/google/gwt/dev/util/StringKey.java
@@ -38,7 +38,7 @@ public abstract class StringKey implements
Comparable<StringKey>, Serializable {
*/
protected StringKey(String value) {
this.value = value;
- this.hashCode = getClass().hashCode() * 13
+ this.hashCode = getClass().getName().hashCode() * 13
+ (value == null ? 0 : value.hashCode());
}
@@ -66,9 +66,6 @@ public abstract class StringKey implements
Comparable<StringKey>, Serializable {
if (o == null) {
return false;
}
- if (getClass() != o.getClass()) {
- return false;
- }
return compareTo((StringKey) o) == 0 ? true : false;
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors