mirror of https://github.com/apache/jclouds.git
Upgrade to gson 2.2.4
https://issues.apache.org/jira/browse/JCLOUDS-117
This commit is contained in:
parent
98230e60a4
commit
1178f47cd7
|
@ -85,7 +85,7 @@
|
|||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.2.2</version>
|
||||
<version>2.2.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
|
|
|
@ -65,6 +65,7 @@ import com.google.gson.FieldAttributes;
|
|||
import com.google.gson.FieldNamingStrategy;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.InstanceCreator;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.TypeAdapterFactory;
|
||||
import com.google.gson.internal.ConstructorConstructor;
|
||||
|
@ -123,7 +124,7 @@ public class GsonModule extends AbstractModule {
|
|||
ImmutableSet.of(ConstructorProperties.class, Inject.class), ImmutableSet.of(new ExtractNamed()));
|
||||
|
||||
builder.registerTypeAdapterFactory(new DeserializationConstructorAndReflectiveTypeAdapterFactory(
|
||||
new ConstructorConstructor(), serializationPolicy, Excluder.DEFAULT, deserializationPolicy));
|
||||
new ConstructorConstructor(ImmutableMap.<Type, InstanceCreator<?>>of()), serializationPolicy, Excluder.DEFAULT, deserializationPolicy));
|
||||
|
||||
// complicated (serializers/deserializers as they need context to operate)
|
||||
builder.registerTypeHierarchyAdapter(Enum.class, new EnumTypeAdapterThatReturnsFromValue());
|
||||
|
|
|
@ -23,6 +23,7 @@ import static org.testng.Assert.assertNull;
|
|||
|
||||
import java.beans.ConstructorProperties;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -36,12 +37,14 @@ import org.testng.annotations.Test;
|
|||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.gson.FieldNamingStrategy;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.InstanceCreator;
|
||||
import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.internal.ConstructorConstructor;
|
||||
import com.google.gson.internal.Excluder;
|
||||
|
@ -65,7 +68,7 @@ public final class DeserializationConstructorAndReflectiveTypeAdapterFactoryTest
|
|||
NamingStrategies.AnnotationConstructorNamingStrategy deserializationPolicy = new NamingStrategies.AnnotationConstructorNamingStrategy(
|
||||
ImmutableSet.of(ConstructorProperties.class, Inject.class), ImmutableSet.of(new ExtractNamed()));
|
||||
|
||||
return new DeserializationConstructorAndReflectiveTypeAdapterFactory(new ConstructorConstructor(),
|
||||
return new DeserializationConstructorAndReflectiveTypeAdapterFactory(new ConstructorConstructor(ImmutableMap.<Type, InstanceCreator<?>>of()),
|
||||
serializationPolicy, Excluder.DEFAULT, deserializationPolicy);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue