Skip to content

Commit e998ecd

Browse files
committed
Bit cleanup, update release notes (wrt avro)
1 parent 1306810 commit e998ecd

File tree

6 files changed

+8
-23
lines changed

6 files changed

+8
-23
lines changed

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/AvroGenerator.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ public void close() throws IOException
363363

364364
@Override
365365
public final void writeStartArray() throws IOException {
366-
_avroContext = _avroContext.createChildArrayContext();
366+
_avroContext = _avroContext.createChildArrayContext(null);
367367
_complete = false;
368368
}
369369

@@ -389,11 +389,6 @@ public final void writeStartObject() throws IOException {
389389
public void writeStartObject(Object forValue) throws IOException {
390390
_avroContext = _avroContext.createChildObjectContext(forValue);
391391
_complete = false;
392-
if(this._writeContext != null && forValue != null) {
393-
this._writeContext.setCurrentValue(forValue);
394-
}
395-
396-
this.setCurrentValue(forValue);
397392
}
398393

399394
@Override

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/ser/ArrayWriteContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class ArrayWriteContext
1313
public ArrayWriteContext(AvroWriteContext parent, AvroGenerator generator,
1414
GenericArray<Object> array, Object currValue)
1515
{
16-
super(TYPE_ARRAY, parent, generator, array.getSchema());
16+
super(TYPE_ARRAY, parent, generator, array.getSchema(), currValue);
1717
_array = array;
1818
}
1919

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/ser/AvroWriteContext.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,6 @@ public abstract class AvroWriteContext
4444
/* Life-cycle
4545
/**********************************************************
4646
*/
47-
48-
protected AvroWriteContext(int type, AvroWriteContext parent,
49-
AvroGenerator generator, Schema schema)
50-
{
51-
super();
52-
_type = type;
53-
_parent = parent;
54-
_generator = generator;
55-
_schema = schema;
56-
}
5747

5848
protected AvroWriteContext(int type, AvroWriteContext parent,
5949
AvroGenerator generator, Schema schema, Object currValue)
@@ -81,10 +71,6 @@ public static AvroWriteContext nullContext() {
8171
return NullContext.instance;
8272
}
8373

84-
public final AvroWriteContext createChildArrayContext() throws JsonMappingException {
85-
return createChildArrayContext(null);
86-
}
87-
8874
public abstract AvroWriteContext createChildArrayContext(Object currValue) throws JsonMappingException;
8975

9076
public AvroWriteContext createChildObjectContext() throws JsonMappingException {
@@ -533,7 +519,7 @@ private final static class NullContext
533519
public final static NullContext instance = new NullContext();
534520

535521
private NullContext() {
536-
super(TYPE_ROOT, null, null, null);
522+
super(TYPE_ROOT, null, null, null, null);
537523
}
538524

539525
@Override

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/ser/RootContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class RootContext
3232
private NonBSGenericDatumWriter<Object> _writer;
3333

3434
public RootContext(AvroGenerator generator, Schema schema, BinaryEncoder encoder) {
35-
super(TYPE_ROOT, null, generator, schema);
35+
super(TYPE_ROOT, null, generator, schema, null);
3636
_encoder = encoder;
3737
}
3838

release-notes/CREDITS-2.x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ Juliana Amorim (amorimjuliana@github)
102102
Marcos Passos (marcospassos@github)
103103
* Contributed fix for #168: (avro) `JsonMappingException` for union types with multiple Record types
104104
(2.10.0)
105+
* Contributed fix for #173: (Avro) Improve Union type serialization performance
106+
(2.10.0)
105107

106108

107109

release-notes/VERSION-2.x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Project: jackson-datatypes-binaryModules:
1212

1313
#168: (avro) `JsonMappingException` for union types with multiple Record types
1414
(reported by Juliana A; fix contributed by Marcos P)
15+
#173: (Avro) Improve Union type serialization performance
16+
(fix contributed by Marcos P)
1517

1618
2.10.0.pr1 (19-Jul-2019)
1719

0 commit comments

Comments
 (0)