You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working with version 0.45, the ImmutableMultimapSerializer read method does not properly handle the class EmptyImmutableSetMultimap. It fails the statement at line 43.
The following statement always fails when the type is class com.google.common.collect.EmptyImmutableSetMultimap
else if (type.equals (ImmutableSetMultimap.class)) {
The if statement evaluates to false and the result is that an instance of EmptyImmutableListMultimap is returned instead, which does not match the datatype of ImmutableSetMultimap. This only occurs with an empty ImmutableSetMultimap.
If it were changed to the following: if(ImmutableSetMultimap.class.isAssignableFrom(type)) {
then it would pass and handle the type correctly.
I'm attaching a unit test that exhibits this behavior.
Working with version 0.45, the ImmutableMultimapSerializer read method does not properly handle the class EmptyImmutableSetMultimap. It fails the statement at line 43.
The following statement always fails when the type is class com.google.common.collect.EmptyImmutableSetMultimap
else if (type.equals (ImmutableSetMultimap.class)) {
The if statement evaluates to false and the result is that an instance of EmptyImmutableListMultimap is returned instead, which does not match the datatype of ImmutableSetMultimap. This only occurs with an empty ImmutableSetMultimap.
If it were changed to the following:
if(ImmutableSetMultimap.class.isAssignableFrom(type)) {
then it would pass and handle the type correctly.
I'm attaching a unit test that exhibits this behavior.
`
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.Kryo.DefaultInstantiatorStrategy;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.SetMultimap;
import de.javakaffee.kryoserializers.guava.ImmutableMultimapSerializer;
import org.junit.Before;
import org.junit.Test;
import org.objenesis.strategy.StdInstantiatorStrategy;
import java.io.Serializable;
import java.util.Map;
import static org.junit.Assert.assertEquals;
public class ImmutableSetMultimapTestU {
private Kryo kryo;
}`
The text was updated successfully, but these errors were encountered: