-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=81367572
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,17 +148,16 @@ public void trimToSize() { | |
@GwtIncompatible("java.io.ObjectOutputStream") | ||
private void writeObject(ObjectOutputStream stream) throws IOException { | ||
stream.defaultWriteObject(); | ||
stream.writeInt(expectedValuesPerKey); | ||
Serialization.writeMultimap(this, stream); | ||
} | ||
|
||
@GwtIncompatible("java.io.ObjectOutputStream") | ||
private void readObject(ObjectInputStream stream) | ||
throws IOException, ClassNotFoundException { | ||
stream.defaultReadObject(); | ||
expectedValuesPerKey = stream.readInt(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jbduncan
Contributor
|
||
expectedValuesPerKey = DEFAULT_VALUES_PER_KEY; | ||
int distinctKeys = Serialization.readCount(stream); | ||
Map<K, Collection<V>> map = Maps.newHashMapWithExpectedSize(distinctKeys); | ||
Map<K, Collection<V>> map = Maps.newHashMap(); | ||
setMap(map); | ||
Serialization.populateMultimap(this, stream, distinctKeys); | ||
} | ||
|
1 comment
on commit a70f009
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beware: officially guava doesn't care about serialization compatibility, but that change broke it.
This change and the other changes like that in this commit have completely broken the serialization.
This behaviour is not documented. Can we rely on serialize this kind of objects between guava versions? I think no, watching this commit.