Skip to content

Commit 01125b5

Browse files
committed
Merge branch '2.12'
2 parents be0af8d + 71444f1 commit 01125b5

File tree

14 files changed

+30
-43
lines changed

14 files changed

+30
-43
lines changed

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/deser/AvroReaderFactory.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,23 @@ public ScalarDecoder createScalarValueDecoder(Schema type)
6666
case FLOAT:
6767
return READER_FLOAT;
6868
case INT:
69-
if (AvroSchemaHelper.getTypeId(type) != null) {
70-
return new IntReader(AvroSchemaHelper.getTypeId(type));
69+
{
70+
final String typeId = AvroSchemaHelper.getTypeId(type);
71+
return (typeId != null) ? new IntReader(typeId) : READER_INT;
7172
}
72-
return READER_INT;
7373
case LONG:
7474
return READER_LONG;
7575
case NULL:
7676
return READER_NULL;
7777
case STRING:
78-
if (AvroSchemaHelper.getTypeId(type) != null) {
79-
return new StringReader(AvroSchemaHelper.getTypeId(type));
78+
{
79+
final String typeId = AvroSchemaHelper.getTypeId(type);
80+
return (typeId != null) ? new StringReader(typeId) : READER_STRING;
8081
}
81-
return READER_STRING;
8282
case UNION:
83-
/* Union is a "scalar union" if all the alternative types
84-
* are scalar. One common type is that of "nullable" one,
85-
* but general handling should work just fine.
86-
*/
83+
// Union is a "scalar union" if all the alternative types
84+
// are scalar. One common type is that of "nullable" one,
85+
// but general handling should work just fine.
8786
List<Schema> types = type.getTypes();
8887
{
8988
ScalarDecoder[] readers = new ScalarDecoder[types.size()];

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/AmbiguousUnionWriteTest.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
package com.fasterxml.jackson.dataformat.avro;
22

3-
import com.fasterxml.jackson.dataformat.avro.AvroMapper;
4-
import com.fasterxml.jackson.dataformat.avro.AvroSchema;
5-
6-
/* 23-Aug-2017, tatu: There was some confusion on whether potential ambiguity
7-
* might be problematic (compared to actual one) -- this test verifies
8-
* it should not be.
9-
*/
3+
// 23-Aug-2017, tatu: There was some confusion on whether potential ambiguity
4+
// might be problematic (compared to actual one) -- this test verifies
5+
// it should not be.
106
public class AmbiguousUnionWriteTest extends AvroTestBase
117
{
128
protected final String SCHEMA_WITH_AMBIGUITY = aposToQuotes("{\n"

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/NestedMapTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
import com.fasterxml.jackson.databind.ObjectMapper;
99

10-
import com.fasterxml.jackson.dataformat.avro.AvroMapper;
11-
import com.fasterxml.jackson.dataformat.avro.AvroSchema;
1210
import com.fasterxml.jackson.dataformat.avro.schema.AvroSchemaGenerator;
1311

1412
public class NestedMapTest extends AvroTestBase

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/RootEmptyRecord177Test.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
import com.fasterxml.jackson.annotation.JsonAutoDetect;
44

5-
import com.fasterxml.jackson.dataformat.avro.AvroMapper;
6-
import com.fasterxml.jackson.dataformat.avro.AvroSchema;
7-
85
public class RootEmptyRecord177Test extends AvroTestBase
96
{
107
private final AvroMapper MAPPER = getMapper();

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/SerializeGeneratedTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package com.fasterxml.jackson.dataformat.avro;
22

33
import com.fasterxml.jackson.databind.ObjectMapper;
4-
import com.fasterxml.jackson.dataformat.avro.AvroMapper;
5-
import com.fasterxml.jackson.dataformat.avro.AvroSchema;
4+
65
import com.fasterxml.jackson.dataformat.avro.gen.Event35;
76
import com.fasterxml.jackson.dataformat.avro.gen.Event35Id;
87

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/SimpleGenerationTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import com.fasterxml.jackson.core.StreamWriteFeature;
1010
import com.fasterxml.jackson.databind.JsonMappingException;
1111
import com.fasterxml.jackson.databind.ObjectMapper;
12-
import com.fasterxml.jackson.dataformat.avro.AvroFactory;
1312

1413
public class SimpleGenerationTest extends AvroTestBase
1514
{

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/interop/InteropTestBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public static ParameterizedType type(Class<?> baseClass, Type... parameters) {
5050
return new ParameterizedTypeImpl(baseClass, parameters);
5151
}
5252

53-
private static class ParameterizedTypeImpl implements ParameterizedType {
53+
static class ParameterizedTypeImpl implements ParameterizedType {
5454
private final Class<?> rawType;
5555
private final Type[] typeBindings;
5656

57-
private ParameterizedTypeImpl(Class<?> rawType, Type[] typeBindings) {
57+
ParameterizedTypeImpl(Class<?> rawType, Type[] typeBindings) {
5858
this.rawType = rawType;
5959
this.typeBindings = typeBindings;
6060
}

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/interop/annotations/AvroEncodeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static class CustomComponent {
5353
public Long longValue;
5454

5555
@AvroEncode(using = UuidAsBytesAvroEncoding.class)
56-
private UUID uuidValue;
56+
UUID uuidValue;
5757

5858
protected CustomComponent() { }
5959
}

ion/src/test/java/com/fasterxml/jackson/dataformat/ion/failing/PolymorphicRoundtripTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
2929

3030
import com.fasterxml.jackson.core.Version;
31+
3132
import com.fasterxml.jackson.databind.DatabindContext;
3233
import com.fasterxml.jackson.databind.JavaType;
3334
import com.fasterxml.jackson.databind.JsonMappingException;
@@ -39,6 +40,7 @@
3940
import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
4041
import com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver;
4142
import com.fasterxml.jackson.databind.module.SimpleModule;
43+
4244
import com.fasterxml.jackson.dataformat.ion.IonObjectMapper;
4345
import com.fasterxml.jackson.dataformat.ion.polymorphism.IonAnnotationIntrospector;
4446
import com.fasterxml.jackson.dataformat.ion.polymorphism.IonAnnotationTypeResolverBuilder;
@@ -173,9 +175,9 @@ public String selectId(String[] ids) {
173175
* ClassNameIonAnnotationIntrospector, and MultipleClassNameIdResolver (where they actually get used). I think
174176
* this is (a little) easier to understand.
175177
*/
176-
private boolean resolveAllTypes = false; // apply resolver under test to all types, not just annotated ones
177-
private String preferredTypeId = null; // if asked to resolve from multiple ids, choose this one.
178-
private IonSystem ionSystem = IonSystemBuilder.standard().build();
178+
boolean resolveAllTypes = false; // apply resolver under test to all types, not just annotated ones
179+
String preferredTypeId = null; // if asked to resolve from multiple ids, choose this one.
180+
IonSystem ionSystem = IonSystemBuilder.standard().build();
179181

180182
@Before
181183
public void reset() {

ion/src/test/java/com/fasterxml/jackson/dataformat/ion/polymorphism/IonAnnotationTypeDeserializerWithClassNameAnnotationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ protected TypeIdResolver defaultIdResolver(MapperConfig<?> config, JavaType base
109109
}
110110
}
111111

112-
private static class ClassA {
112+
static class ClassA {
113113
public int value;
114114
}
115115

116-
private static class ClassB<T> {
116+
static class ClassB<T> {
117117
public T content;
118118
}
119119
}

0 commit comments

Comments
 (0)