Skip to content

Commit

Permalink
chore: bump jackson-databind from 2.9.10.8 to 2.15.2 in /addon (#639)
Browse files Browse the repository at this point in the history
Also add implementations for new Jackson API and reset changed defaults.
  • Loading branch information
Ansku authored Aug 3, 2023
1 parent 731b11b commit c0ab702
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 10 deletions.
7 changes: 6 additions & 1 deletion addon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.8</version>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
import com.fasterxml.jackson.databind.ser.impl.BeanAsArraySerializer;
import com.fasterxml.jackson.databind.ser.impl.ObjectIdWriter;
import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase;
Expand All @@ -46,14 +47,29 @@ public BeanSerializerDelegator(BeanSerializerBase source,
super(source, objectIdWriter);
}

public BeanSerializerDelegator(BeanSerializerBase source, String[] toIgnore) {
@Deprecated
public BeanSerializerDelegator(BeanSerializerBase source,
String[] toIgnore) {
super(source, toIgnore);
}

protected BeanSerializerDelegator(BeanSerializerBase source, Set<String> toIgnore) {
@Deprecated
protected BeanSerializerDelegator(BeanSerializerBase source,
Set<String> toIgnore) {
super(source, toIgnore);
}

protected BeanSerializerDelegator(BeanSerializerBase source,
Set<String> toIgnore, Set<String> toInclude) {
super(source, toIgnore, toInclude);
}

protected BeanSerializerDelegator(BeanSerializerBase source,
BeanPropertyWriter[] properties,
BeanPropertyWriter[] filteredProperties) {
super(source, properties, filteredProperties);
}

public BeanSerializerDelegator(BeanSerializerBase source, Object filterId) {
super(source, null, filterId);
}
Expand All @@ -66,23 +82,39 @@ public BeanSerializerDelegator(BeanSerializerBase source,
}

@Override
public BeanSerializerBase withObjectIdWriter(ObjectIdWriter objectIdWriter) {
return new BeanSerializerDelegator(this, objectIdWriter);
public BeanSerializerBase withObjectIdWriter(
ObjectIdWriter objectIdWriter) {
return new BeanSerializerDelegator<>(this, objectIdWriter);
}

@Override
@Deprecated
protected BeanSerializerBase withIgnorals(String[] toIgnore) {
return new BeanSerializerDelegator(this, toIgnore);
return new BeanSerializerDelegator<>(this, toIgnore);
}

@Override
@Deprecated
protected BeanSerializerBase withIgnorals(Set<String> toIgnore) {
return new BeanSerializerDelegator(this, toIgnore);
return new BeanSerializerDelegator<>(this, toIgnore);
}

@Override
public BeanSerializerBase withFilterId(Object filterId) {
return new BeanSerializerDelegator(this, filterId);
return new BeanSerializerDelegator<>(this, filterId);
}

@Override
protected BeanSerializerBase withByNameInclusion(Set<String> toIgnore,
Set<String> toInclude) {
return new BeanSerializerDelegator<>(this, toIgnore, toInclude);
}

@Override
protected BeanSerializerBase withProperties(BeanPropertyWriter[] properties,
BeanPropertyWriter[] filteredProperties) {
return new BeanSerializerDelegator<>(this, properties,
filteredProperties);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
import com.fasterxml.jackson.databind.ser.impl.BeanAsArraySerializer;
import com.fasterxml.jackson.databind.ser.impl.ObjectIdWriter;
import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase;
Expand All @@ -44,16 +45,29 @@ public ThemeGradientColorBeanSerializer(BeanSerializerBase source,
super(source, objectIdWriter);
}

@Deprecated
public ThemeGradientColorBeanSerializer(BeanSerializerBase source,
String[] toIgnore) {
super(source, toIgnore);
}

@Deprecated
protected ThemeGradientColorBeanSerializer(BeanSerializerBase source,
Set<String> toIgnore) {
super(source, toIgnore);
}

protected ThemeGradientColorBeanSerializer(BeanSerializerBase source,
Set<String> toIgnore, Set<String> toInclude) {
super(source, toIgnore, toInclude);
}

protected ThemeGradientColorBeanSerializer(BeanSerializerBase source,
BeanPropertyWriter[] properties,
BeanPropertyWriter[] filteredProperties) {
super(source, properties, filteredProperties);
}

public ThemeGradientColorBeanSerializer(BeanSerializerBase source,
Object filterId) {
super(source, null, filterId);
Expand All @@ -65,11 +79,13 @@ public BeanSerializerBase withObjectIdWriter(ObjectIdWriter objectIdWriter) {
}

@Override
@Deprecated
protected BeanSerializerBase withIgnorals(String[] toIgnore) {
return new ThemeGradientColorBeanSerializer(this, toIgnore);
}

@Override
@Deprecated
protected BeanSerializerBase withIgnorals(Set<String> toIgnore) {
return new ThemeGradientColorBeanSerializer(this, toIgnore);
}
Expand All @@ -79,6 +95,19 @@ public BeanSerializerBase withFilterId(Object filterId) {
return new ThemeGradientColorBeanSerializer(this, filterId);
}

@Override
protected BeanSerializerBase withByNameInclusion(Set<String> toIgnore,
Set<String> toInclude) {
return new ThemeGradientColorBeanSerializer(this, toIgnore, toInclude);
}

@Override
protected BeanSerializerBase withProperties(BeanPropertyWriter[] properties,
BeanPropertyWriter[] filteredProperties) {
return new ThemeGradientColorBeanSerializer(this, properties,
filteredProperties);
}

@Override
protected BeanSerializerBase asArraySerializer() {
// copied from BeanSerializer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.vaadin.addon.charts.ChartOptions;
import com.vaadin.addon.charts.model.AbstractConfigurationObject;
import com.vaadin.addon.charts.model.serializers.AxisListSerializer;
Expand All @@ -35,10 +37,10 @@
import com.vaadin.addon.charts.model.serializers.DefaultBeanSerializerModifier;
import com.vaadin.addon.charts.model.serializers.GradientColorStopsSerializer;
import com.vaadin.addon.charts.model.serializers.InstantSerializer;
import com.vaadin.addon.charts.model.serializers.StringSerializer;
import com.vaadin.addon.charts.model.serializers.PaneListSerializer;
import com.vaadin.addon.charts.model.serializers.SolidColorSerializer;
import com.vaadin.addon.charts.model.serializers.StopSerializer;
import com.vaadin.addon.charts.model.serializers.StringSerializer;
import com.vaadin.addon.charts.model.serializers.TimeUnitMultiplesSerializer;

/**
Expand Down Expand Up @@ -87,7 +89,9 @@ public static ObjectMapper createObjectMapper(BeanSerializerModifier modifier) {
.registerModule(PaneListSerializer.getModule())
.registerModule(DateSerializer.getModule())
.registerModule(InstantSerializer.getModule())
.registerModule(StringSerializer.getModule());
.registerModule(StringSerializer.getModule())
.registerModule(new JavaTimeModule()).disable(
SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS);

// serializer modifier used when basic serializer isn't enough
return mapper.setSerializerFactory(mapper.getSerializerFactory()
Expand Down

0 comments on commit c0ab702

Please sign in to comment.