File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
avro/src/main/java/com/fasterxml/jackson/dataformat/avro/deser Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff 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 ()];
You can’t perform that action at this time.
0 commit comments