5151import java .util .Collections ;
5252import java .util .HashMap ;
5353import java .util .HashSet ;
54- import java .util .IdentityHashMap ;
5554import java .util .List ;
5655import java .util .Map ;
5756import java .util .Optional ;
@@ -152,16 +151,14 @@ public MessageType convert(Schema avroSchema) {
152151 throw new IllegalArgumentException ("Avro schema must be a record." );
153152 }
154153 return new MessageType (
155- avroSchema .getFullName (),
156- convertFields (avroSchema .getFields (), "" , new HashSet <Schema >()));
154+ avroSchema .getFullName (), convertFields (avroSchema .getFields (), "" , new HashSet <Schema >()));
157155 }
158156
159157 private List <Type > convertFields (List <Schema .Field > fields , String schemaPath ) {
160158 return convertFields (fields , schemaPath , new HashSet <Schema >());
161159 }
162160
163- private List <Type > convertFields (
164- List <Schema .Field > fields , String schemaPath , Set <Schema > seenSchemas ) {
161+ private List <Type > convertFields (List <Schema .Field > fields , String schemaPath , Set <Schema > seenSchemas ) {
165162 List <Type > types = new ArrayList <Type >();
166163 for (Schema .Field field : fields ) {
167164 if (field .schema ().getType ().equals (Schema .Type .NULL )) {
@@ -176,8 +173,7 @@ private Type convertField(String fieldName, Schema schema, String schemaPath) {
176173 return convertField (fieldName , schema , Type .Repetition .REQUIRED , schemaPath );
177174 }
178175
179- private Type convertField (
180- String fieldName , Schema schema , String schemaPath , Set <Schema > seenSchemas ) {
176+ private Type convertField (String fieldName , Schema schema , String schemaPath , Set <Schema > seenSchemas ) {
181177 return convertField (fieldName , schema , Type .Repetition .REQUIRED , schemaPath , seenSchemas );
182178 }
183179
@@ -188,11 +184,7 @@ private Type convertField(String fieldName, Schema schema, Type.Repetition repet
188184
189185 @ SuppressWarnings ("deprecation" )
190186 private Type convertField (
191- String fieldName ,
192- Schema schema ,
193- Type .Repetition repetition ,
194- String schemaPath ,
195- Set <Schema > seenSchemas ) {
187+ String fieldName , Schema schema , Type .Repetition repetition , String schemaPath , Set <Schema > seenSchemas ) {
196188 Schema .Type type = schema .getType ();
197189 LogicalType logicalType = schema .getLogicalType ();
198190
@@ -287,11 +279,7 @@ private Type convertUnion(String fieldName, Schema schema, Type.Repetition repet
287279 }
288280
289281 private Type convertUnion (
290- String fieldName ,
291- Schema schema ,
292- Type .Repetition repetition ,
293- String schemaPath ,
294- Set <Schema > seenSchemas ) {
282+ String fieldName , Schema schema , Type .Repetition repetition , String schemaPath , Set <Schema > seenSchemas ) {
295283 List <Schema > nonNullSchemas = new ArrayList <Schema >(schema .getTypes ().size ());
296284 // Found any schemas in the union? Required for the edge case, where the union contains only a single type.
297285 boolean foundNullSchema = false ;
@@ -323,8 +311,7 @@ private Type convertUnion(
323311
324312 private Type convertUnionToGroupType (
325313 String fieldName , Type .Repetition repetition , List <Schema > nonNullSchemas , String schemaPath ) {
326- return convertUnionToGroupType (
327- fieldName , repetition , nonNullSchemas , schemaPath , new HashSet <Schema >());
314+ return convertUnionToGroupType (fieldName , repetition , nonNullSchemas , schemaPath , new HashSet <Schema >());
328315 }
329316
330317 private Type convertUnionToGroupType (
0 commit comments