• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc.  All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 //     * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //     * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 //     * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 package com.google.protobuf;
32 
33 import static com.google.protobuf.FieldInfo.forField;
34 import static com.google.protobuf.FieldInfo.forFieldWithEnumVerifier;
35 import static com.google.protobuf.FieldInfo.forMapField;
36 import static com.google.protobuf.FieldInfo.forOneofMemberField;
37 import static com.google.protobuf.FieldInfo.forProto2OptionalField;
38 import static com.google.protobuf.FieldInfo.forProto2RequiredField;
39 import static com.google.protobuf.FieldInfo.forRepeatedMessageField;
40 
41 import com.google.protobuf.testing.Proto2TestingLite;
42 import com.google.protobuf.testing.Proto2TestingLite.Proto2EmptyLite;
43 import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLite;
44 import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLite.FieldGroup49;
45 import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLite.FieldGroup69;
46 import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLite.FieldGroupList51;
47 import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLite.FieldRequiredGroup88;
48 import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLite.RequiredNestedMessage;
49 import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLite.TestEnum;
50 import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLiteWithExtensions;
51 import com.google.protobuf.testing.Proto2TestingLite.Proto2MessageLiteWithMaps;
52 import java.lang.reflect.Field;
53 
54 /** A factory that generates a hard-coded info for {@link Proto2MessageLite}. */
55 public final class Proto2MessageLiteInfoFactory implements MessageInfoFactory {
56   private static final Proto2MessageLiteInfoFactory instanceForRawMessageInfo =
57       new Proto2MessageLiteInfoFactory(true);
58   private static final Proto2MessageLiteInfoFactory instanceForStructuralMessageInfo =
59       new Proto2MessageLiteInfoFactory(false);
60 
getInstanceForRawMessageInfo()61   public static Proto2MessageLiteInfoFactory getInstanceForRawMessageInfo() {
62     return instanceForRawMessageInfo;
63   }
64 
getInstanceForStructuralMessageInfo()65   public static Proto2MessageLiteInfoFactory getInstanceForStructuralMessageInfo() {
66     return instanceForStructuralMessageInfo;
67   }
68 
69   private final boolean produceRawMessageInfo;
70 
Proto2MessageLiteInfoFactory(boolean produceRawMessageInfo)71   private Proto2MessageLiteInfoFactory(boolean produceRawMessageInfo) {
72     this.produceRawMessageInfo = produceRawMessageInfo;
73   }
74 
75   @Override
isSupported(Class<?> clazz)76   public boolean isSupported(Class<?> clazz) {
77     return true;
78   }
79 
80   @Override
messageInfoFor(Class<?> clazz)81   public MessageInfo messageInfoFor(Class<?> clazz) {
82     return produceRawMessageInfo ? rawMessageInfoFor(clazz) : structuralMessageInfoFor(clazz);
83   }
84 
rawMessageInfoFor(Class<?> clazz)85   private MessageInfo rawMessageInfoFor(Class<?> clazz) {
86     if (Proto2MessageLite.class.isAssignableFrom(clazz)) {
87       return newRawMessageInfoForProto2MessageLite();
88     } else {
89       throw new IllegalArgumentException("Unsupported class: " + clazz.getName());
90     }
91   }
92 
newRawMessageInfoForProto2MessageLite()93   private MessageInfo newRawMessageInfoForProto2MessageLite() {
94     java.lang.Object[] objects =
95         new java.lang.Object[] {
96           "testOneof_",
97           "testOneofCase_",
98           "bitField0_",
99           "bitField1_",
100           "fieldDouble1_",
101           "fieldFloat2_",
102           "fieldInt643_",
103           "fieldUint644_",
104           "fieldInt325_",
105           "fieldFixed646_",
106           "fieldFixed327_",
107           "fieldBool8_",
108           "fieldString9_",
109           "fieldMessage10_",
110           "fieldBytes11_",
111           "fieldUint3212_",
112           "fieldEnum13_",
113           Proto2MessageLite.TestEnum.internalGetVerifier(),
114           "fieldSfixed3214_",
115           "fieldSfixed6415_",
116           "fieldSint3216_",
117           "fieldSint6417_",
118           "fieldDoubleList18_",
119           "fieldFloatList19_",
120           "fieldInt64List20_",
121           "fieldUint64List21_",
122           "fieldInt32List22_",
123           "fieldFixed64List23_",
124           "fieldFixed32List24_",
125           "fieldBoolList25_",
126           "fieldStringList26_",
127           "fieldMessageList27_",
128           Proto2MessageLite.class,
129           "fieldBytesList28_",
130           "fieldUint32List29_",
131           "fieldEnumList30_",
132           Proto2MessageLite.TestEnum.internalGetVerifier(),
133           "fieldSfixed32List31_",
134           "fieldSfixed64List32_",
135           "fieldSint32List33_",
136           "fieldSint64List34_",
137           "fieldDoubleListPacked35_",
138           "fieldFloatListPacked36_",
139           "fieldInt64ListPacked37_",
140           "fieldUint64ListPacked38_",
141           "fieldInt32ListPacked39_",
142           "fieldFixed64ListPacked40_",
143           "fieldFixed32ListPacked41_",
144           "fieldBoolListPacked42_",
145           "fieldUint32ListPacked43_",
146           "fieldEnumListPacked44_",
147           Proto2MessageLite.TestEnum.internalGetVerifier(),
148           "fieldSfixed32ListPacked45_",
149           "fieldSfixed64ListPacked46_",
150           "fieldSint32ListPacked47_",
151           "fieldSint64ListPacked48_",
152           "fieldGroup49_",
153           "fieldGroupList51_",
154           Proto2MessageLite.FieldGroupList51.class,
155           Proto2MessageLite.class,
156           Proto2MessageLite.FieldGroup69.class,
157           "fieldRequiredDouble71_",
158           "fieldRequiredFloat72_",
159           "fieldRequiredInt6473_",
160           "fieldRequiredUint6474_",
161           "fieldRequiredInt3275_",
162           "fieldRequiredFixed6476_",
163           "fieldRequiredFixed3277_",
164           "fieldRequiredBool78_",
165           "fieldRequiredString79_",
166           "fieldRequiredMessage80_",
167           "fieldRequiredBytes81_",
168           "fieldRequiredUint3282_",
169           "fieldRequiredEnum83_",
170           Proto2MessageLite.TestEnum.internalGetVerifier(),
171           "fieldRequiredSfixed3284_",
172           "fieldRequiredSfixed6485_",
173           "fieldRequiredSint3286_",
174           "fieldRequiredSint6487_",
175           "fieldRequiredGroup88_",
176         };
177     // To update this after a proto change, run blaze build on proto2_message_lite.proto and copy
178     // over the String info from the proto2_message_lite_proto-lite-src.jar file in the
179     // blaze-genfiles directory.
180     java.lang.String info =
181         "\u0001U\u0001\u0002\u0001XU\u0000 \u0015\u0001\u1000\u0000\u0002\u1001\u0001\u0003"
182             + "\u1002\u0002\u0004\u1003\u0003\u0005\u1004\u0004\u0006\u1005\u0005\u0007\u1006\u0006\b\u1007\u0007"
183             + "\t\u1008\b\n"
184             + "\u1409\t\u000b\u100a\n"
185             + "\f\u100b\u000b\r"
186             + "\u100c\f\u000e\u100d\r"
187             + "\u000f\u100e\u000e\u0010\u100f\u000f\u0011\u1010\u0010\u0012\u0012\u0013\u0013"
188             + "\u0014\u0014\u0015\u0015\u0016\u0016\u0017\u0017\u0018\u0018\u0019\u0019\u001a\u001a\u001b\u041b\u001c\u001c\u001d\u001d\u001e\u001e\u001f\u001f"
189             + "  !!\"\"##$$%%&&\'\'"
190             + "(())**++,,--..//001\u1011\u0011315\u1033\u00006\u1034\u00007\u1035\u00008\u1036\u0000"
191             + "9\u1037\u0000:\u1038\u0000;\u1039\u0000<\u103a\u0000=\u103b\u0000>\u143c\u0000?\u103d"
192             + "\u0000@\u103e\u0000A\u1040\u0000B\u1041\u0000C\u1042\u0000D\u1043\u0000E\u1044\u0000"
193             + "G\u1500#H\u1501$I\u1502%J\u1503&K\u1504\'L\u1505(M\u1506)N\u1507*O\u1508+P\u1509"
194             + ",Q\u150a-R\u150b.S\u150c/T\u150d0U\u150e1V\u150f2W\u15103X\u15114";
195     return new RawMessageInfo(Proto2MessageLite.getDefaultInstance(), info, objects);
196   }
197 
structuralMessageInfoFor(Class<?> clazz)198   private MessageInfo structuralMessageInfoFor(Class<?> clazz) {
199     if (Proto2MessageLite.class.isAssignableFrom(clazz)) {
200       return newMessageInfoForProto2MessageLite();
201     } else if (FieldGroup49.class.isAssignableFrom(clazz)) {
202       return newMessageInfoForFieldGroup49();
203     } else if (FieldGroupList51.class.isAssignableFrom(clazz)) {
204       return newMessageInfoForFieldGroupList51();
205     } else if (FieldGroup69.class.isAssignableFrom(clazz)) {
206       return newMessageInfoForFieldGroup69();
207     } else if (FieldRequiredGroup88.class.isAssignableFrom(clazz)) {
208       return newMessageInfoForFieldRequiredGroup88();
209     } else if (RequiredNestedMessage.class.isAssignableFrom(clazz)) {
210       return newMessageInfoForRequiredNestedMessage();
211     } else if (Proto2EmptyLite.class.isAssignableFrom(clazz)) {
212       return newMessageInfoForProto2EmptyLite();
213     } else if (Proto2MessageLiteWithExtensions.class.isAssignableFrom(clazz)) {
214       return newMessageInfoForProto2MessageLiteWithExtensions();
215     } else if (Proto2TestingLite.FieldGroup49.class.isAssignableFrom(clazz)) {
216       return newMessageInfoForExtensionFieldGroup49();
217     } else if (Proto2TestingLite.FieldGroupList51.class.isAssignableFrom(clazz)) {
218       return newMessageInfoForExtensionFieldGroupList51();
219     } else if (Proto2TestingLite.Proto2MessageLiteWithMaps.class.isAssignableFrom(clazz)) {
220       return newMessageInfoForProto2MessageLiteWithMaps();
221     } else {
222       throw new IllegalArgumentException("Unsupported class: " + clazz.getName());
223     }
224   }
225 
226   /**
227    * Creates a new hard-coded info for {@link Proto2MessageLite}. Each time this is called, we
228    * manually go through the entire process of what a message would do if it self-registered its own
229    * info, including looking up each field by name. This is done for benchmarking purposes, so that
230    * we get a more accurate representation of the time it takes to perform this process.
231    */
newMessageInfoForProto2MessageLite()232   private static StructuralMessageInfo newMessageInfoForProto2MessageLite() {
233     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(48);
234     builder.withCheckInitialized(
235         new int[] {
236           10, 27, 62, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
237         });
238     lookupFieldsByName(builder);
239     return builder.build();
240   }
241 
lookupFieldsByName(StructuralMessageInfo.Builder builder)242   private static void lookupFieldsByName(StructuralMessageInfo.Builder builder) {
243     Field bitField0 = field(Proto2MessageLite.class, "bitField0_");
244 
245     builder.withDefaultInstance(Proto2MessageLite.getDefaultInstance());
246     builder.withSyntax(ProtoSyntax.PROTO2);
247     builder.withField(
248         forProto2OptionalField(
249             field(Proto2MessageLite.class, "fieldDouble1_"),
250             1,
251             FieldType.DOUBLE,
252             bitField0,
253             0x00000001,
254             false,
255             null));
256     builder.withField(
257         forProto2OptionalField(
258             field(Proto2MessageLite.class, "fieldFloat2_"),
259             2,
260             FieldType.FLOAT,
261             bitField0,
262             0x00000002,
263             false,
264             null));
265     builder.withField(
266         forProto2OptionalField(
267             field(Proto2MessageLite.class, "fieldInt643_"),
268             3,
269             FieldType.INT64,
270             bitField0,
271             0x00000004,
272             false,
273             null));
274     builder.withField(
275         forProto2OptionalField(
276             field(Proto2MessageLite.class, "fieldUint644_"),
277             4,
278             FieldType.UINT64,
279             bitField0,
280             0x00000008,
281             false,
282             null));
283     builder.withField(
284         forProto2OptionalField(
285             field(Proto2MessageLite.class, "fieldInt325_"),
286             5,
287             FieldType.INT32,
288             bitField0,
289             0x00000010,
290             false,
291             null));
292     builder.withField(
293         forProto2OptionalField(
294             field(Proto2MessageLite.class, "fieldFixed646_"),
295             6,
296             FieldType.FIXED64,
297             bitField0,
298             0x00000020,
299             false,
300             null));
301     builder.withField(
302         forProto2OptionalField(
303             field(Proto2MessageLite.class, "fieldFixed327_"),
304             7,
305             FieldType.FIXED32,
306             bitField0,
307             0x00000040,
308             false,
309             null));
310     builder.withField(
311         forProto2OptionalField(
312             field(Proto2MessageLite.class, "fieldBool8_"),
313             8,
314             FieldType.BOOL,
315             bitField0,
316             0x00000080,
317             false,
318             null));
319     builder.withField(
320         forProto2OptionalField(
321             field(Proto2MessageLite.class, "fieldString9_"),
322             9,
323             FieldType.STRING,
324             bitField0,
325             0x00000100,
326             false,
327             null));
328     builder.withField(
329         forProto2OptionalField(
330             field(Proto2MessageLite.class, "fieldMessage10_"),
331             10,
332             FieldType.MESSAGE,
333             bitField0,
334             0x00000200,
335             false,
336             null));
337     builder.withField(
338         forProto2OptionalField(
339             field(Proto2MessageLite.class, "fieldBytes11_"),
340             11,
341             FieldType.BYTES,
342             bitField0,
343             0x00000400,
344             false,
345             null));
346     builder.withField(
347         forProto2OptionalField(
348             field(Proto2MessageLite.class, "fieldUint3212_"),
349             12,
350             FieldType.UINT32,
351             bitField0,
352             0x00000800,
353             false,
354             null));
355     builder.withField(
356         forProto2OptionalField(
357             field(Proto2MessageLite.class, "fieldEnum13_"),
358             13,
359             FieldType.ENUM,
360             bitField0,
361             0x00001000,
362             false,
363             TestEnum.internalGetVerifier()));
364     builder.withField(
365         forProto2OptionalField(
366             field(Proto2MessageLite.class, "fieldSfixed3214_"),
367             14,
368             FieldType.SFIXED32,
369             bitField0,
370             0x00002000,
371             false,
372             null));
373     builder.withField(
374         forProto2OptionalField(
375             field(Proto2MessageLite.class, "fieldSfixed6415_"),
376             15,
377             FieldType.SFIXED64,
378             bitField0,
379             0x00004000,
380             false,
381             null));
382     builder.withField(
383         forProto2OptionalField(
384             field(Proto2MessageLite.class, "fieldSint3216_"),
385             16,
386             FieldType.SINT32,
387             bitField0,
388             0x00008000,
389             false,
390             null));
391     builder.withField(
392         forProto2OptionalField(
393             field(Proto2MessageLite.class, "fieldSint6417_"),
394             17,
395             FieldType.SINT64,
396             bitField0,
397             0x00010000,
398             false,
399             null));
400     builder.withField(
401         forField(
402             field(Proto2MessageLite.class, "fieldDoubleList18_"),
403             18,
404             FieldType.DOUBLE_LIST,
405             false));
406     builder.withField(
407         forField(
408             field(Proto2MessageLite.class, "fieldFloatList19_"), 19, FieldType.FLOAT_LIST, false));
409     builder.withField(
410         forField(
411             field(Proto2MessageLite.class, "fieldInt64List20_"), 20, FieldType.INT64_LIST, false));
412     builder.withField(
413         forField(
414             field(Proto2MessageLite.class, "fieldUint64List21_"),
415             21,
416             FieldType.UINT64_LIST,
417             false));
418     builder.withField(
419         forField(
420             field(Proto2MessageLite.class, "fieldInt32List22_"), 22, FieldType.INT32_LIST, false));
421     builder.withField(
422         forField(
423             field(Proto2MessageLite.class, "fieldFixed64List23_"),
424             23,
425             FieldType.FIXED64_LIST,
426             false));
427     builder.withField(
428         forField(
429             field(Proto2MessageLite.class, "fieldFixed32List24_"),
430             24,
431             FieldType.FIXED32_LIST,
432             false));
433     builder.withField(
434         forField(
435             field(Proto2MessageLite.class, "fieldBoolList25_"), 25, FieldType.BOOL_LIST, false));
436     builder.withField(
437         forField(
438             field(Proto2MessageLite.class, "fieldStringList26_"),
439             26,
440             FieldType.STRING_LIST,
441             false));
442     builder.withField(
443         forRepeatedMessageField(
444             field(Proto2MessageLite.class, "fieldMessageList27_"),
445             27,
446             FieldType.MESSAGE_LIST,
447             Proto2MessageLite.class));
448     builder.withField(
449         forField(
450             field(Proto2MessageLite.class, "fieldBytesList28_"), 28, FieldType.BYTES_LIST, false));
451     builder.withField(
452         forField(
453             field(Proto2MessageLite.class, "fieldUint32List29_"),
454             29,
455             FieldType.UINT32_LIST,
456             false));
457     builder.withField(
458         forFieldWithEnumVerifier(
459             field(Proto2MessageLite.class, "fieldEnumList30_"),
460             30,
461             FieldType.ENUM_LIST,
462             TestEnum.internalGetVerifier()));
463     builder.withField(
464         forField(
465             field(Proto2MessageLite.class, "fieldSfixed32List31_"),
466             31,
467             FieldType.SFIXED32_LIST,
468             false));
469     builder.withField(
470         forField(
471             field(Proto2MessageLite.class, "fieldSfixed64List32_"),
472             32,
473             FieldType.SFIXED64_LIST,
474             false));
475     builder.withField(
476         forField(
477             field(Proto2MessageLite.class, "fieldSint32List33_"),
478             33,
479             FieldType.SINT32_LIST,
480             false));
481     builder.withField(
482         forField(
483             field(Proto2MessageLite.class, "fieldSint64List34_"),
484             34,
485             FieldType.SINT64_LIST,
486             false));
487     builder.withField(
488         forField(
489             field(Proto2MessageLite.class, "fieldDoubleListPacked35_"),
490             35,
491             FieldType.DOUBLE_LIST_PACKED,
492             false));
493     builder.withField(
494         forField(
495             field(Proto2MessageLite.class, "fieldFloatListPacked36_"),
496             36,
497             FieldType.FLOAT_LIST_PACKED,
498             false));
499     builder.withField(
500         forField(
501             field(Proto2MessageLite.class, "fieldInt64ListPacked37_"),
502             37,
503             FieldType.INT64_LIST_PACKED,
504             false));
505     builder.withField(
506         forField(
507             field(Proto2MessageLite.class, "fieldUint64ListPacked38_"),
508             38,
509             FieldType.UINT64_LIST_PACKED,
510             false));
511     builder.withField(
512         forField(
513             field(Proto2MessageLite.class, "fieldInt32ListPacked39_"),
514             39,
515             FieldType.INT32_LIST_PACKED,
516             false));
517     builder.withField(
518         forField(
519             field(Proto2MessageLite.class, "fieldFixed64ListPacked40_"),
520             40,
521             FieldType.FIXED64_LIST_PACKED,
522             false));
523     builder.withField(
524         forField(
525             field(Proto2MessageLite.class, "fieldFixed32ListPacked41_"),
526             41,
527             FieldType.FIXED32_LIST_PACKED,
528             false));
529     builder.withField(
530         forField(
531             field(Proto2MessageLite.class, "fieldBoolListPacked42_"),
532             42,
533             FieldType.BOOL_LIST_PACKED,
534             false));
535     builder.withField(
536         forField(
537             field(Proto2MessageLite.class, "fieldUint32ListPacked43_"),
538             43,
539             FieldType.UINT32_LIST_PACKED,
540             false));
541     builder.withField(
542         forFieldWithEnumVerifier(
543             field(Proto2MessageLite.class, "fieldEnumListPacked44_"),
544             44,
545             FieldType.ENUM_LIST_PACKED,
546             TestEnum.internalGetVerifier()));
547     builder.withField(
548         forField(
549             field(Proto2MessageLite.class, "fieldSfixed32ListPacked45_"),
550             45,
551             FieldType.SFIXED32_LIST_PACKED,
552             false));
553     builder.withField(
554         forField(
555             field(Proto2MessageLite.class, "fieldSfixed64ListPacked46_"),
556             46,
557             FieldType.SFIXED64_LIST_PACKED,
558             false));
559     builder.withField(
560         forField(
561             field(Proto2MessageLite.class, "fieldSint32ListPacked47_"),
562             47,
563             FieldType.SINT32_LIST_PACKED,
564             false));
565     builder.withField(
566         forField(
567             field(Proto2MessageLite.class, "fieldSint64ListPacked48_"),
568             48,
569             FieldType.SINT64_LIST_PACKED,
570             false));
571 
572     builder.withField(
573         forProto2OptionalField(
574             field(Proto2MessageLite.class, "fieldGroup49_"),
575             49,
576             FieldType.GROUP,
577             bitField0,
578             0x00020000,
579             false,
580             null));
581     builder.withField(
582         forRepeatedMessageField(
583             field(Proto2MessageLite.class, "fieldGroupList51_"),
584             51,
585             FieldType.GROUP_LIST,
586             Proto2MessageLite.FieldGroupList51.class));
587 
588     OneofInfo oneof =
589         new OneofInfo(
590             0,
591             field(Proto2MessageLite.class, "testOneofCase_"),
592             field(Proto2MessageLite.class, "testOneof_"));
593     builder.withField(forOneofMemberField(53, FieldType.DOUBLE, oneof, Double.class, false, null));
594     builder.withField(forOneofMemberField(54, FieldType.FLOAT, oneof, Float.class, false, null));
595     builder.withField(forOneofMemberField(55, FieldType.INT64, oneof, Long.class, false, null));
596     builder.withField(forOneofMemberField(56, FieldType.UINT64, oneof, Long.class, false, null));
597     builder.withField(forOneofMemberField(57, FieldType.INT32, oneof, Integer.class, false, null));
598     builder.withField(forOneofMemberField(58, FieldType.FIXED64, oneof, Long.class, false, null));
599     builder.withField(
600         forOneofMemberField(59, FieldType.FIXED32, oneof, Integer.class, false, null));
601     builder.withField(forOneofMemberField(60, FieldType.BOOL, oneof, Boolean.class, false, null));
602     builder.withField(forOneofMemberField(61, FieldType.STRING, oneof, String.class, false, null));
603     builder.withField(
604         forOneofMemberField(62, FieldType.MESSAGE, oneof, Proto2MessageLite.class, false, null));
605     builder.withField(
606         forOneofMemberField(63, FieldType.BYTES, oneof, ByteString.class, false, null));
607     builder.withField(forOneofMemberField(64, FieldType.UINT32, oneof, Integer.class, false, null));
608     builder.withField(
609         forOneofMemberField(65, FieldType.SFIXED32, oneof, Integer.class, false, null));
610     builder.withField(forOneofMemberField(66, FieldType.SFIXED64, oneof, Long.class, false, null));
611     builder.withField(forOneofMemberField(67, FieldType.SINT32, oneof, Integer.class, false, null));
612     builder.withField(forOneofMemberField(68, FieldType.SINT64, oneof, Long.class, false, null));
613     builder.withField(
614         forOneofMemberField(
615             69, FieldType.GROUP, oneof, Proto2MessageLite.FieldGroup69.class, false, null));
616 
617     Field bitField1 = field(Proto2MessageLite.class, "bitField1_");
618     builder.withField(
619         forProto2RequiredField(
620             field(Proto2MessageLite.class, "fieldRequiredDouble71_"),
621             71,
622             FieldType.DOUBLE,
623             bitField1,
624             0x00000008,
625             false,
626             null));
627     builder.withField(
628         forProto2RequiredField(
629             field(Proto2MessageLite.class, "fieldRequiredFloat72_"),
630             72,
631             FieldType.FLOAT,
632             bitField1,
633             0x00000010,
634             false,
635             null));
636     builder.withField(
637         forProto2RequiredField(
638             field(Proto2MessageLite.class, "fieldRequiredInt6473_"),
639             73,
640             FieldType.INT64,
641             bitField1,
642             0x00000020,
643             false,
644             null));
645     builder.withField(
646         forProto2RequiredField(
647             field(Proto2MessageLite.class, "fieldRequiredUint6474_"),
648             74,
649             FieldType.UINT64,
650             bitField1,
651             0x00000040,
652             false,
653             null));
654     builder.withField(
655         forProto2RequiredField(
656             field(Proto2MessageLite.class, "fieldRequiredInt3275_"),
657             75,
658             FieldType.INT32,
659             bitField1,
660             0x00000080,
661             false,
662             null));
663     builder.withField(
664         forProto2RequiredField(
665             field(Proto2MessageLite.class, "fieldRequiredFixed6476_"),
666             76,
667             FieldType.FIXED64,
668             bitField1,
669             0x00000100,
670             false,
671             null));
672     builder.withField(
673         forProto2RequiredField(
674             field(Proto2MessageLite.class, "fieldRequiredFixed3277_"),
675             77,
676             FieldType.FIXED32,
677             bitField1,
678             0x00000200,
679             false,
680             null));
681     builder.withField(
682         forProto2RequiredField(
683             field(Proto2MessageLite.class, "fieldRequiredBool78_"),
684             78,
685             FieldType.BOOL,
686             bitField1,
687             0x00000400,
688             false,
689             null));
690     builder.withField(
691         forProto2RequiredField(
692             field(Proto2MessageLite.class, "fieldRequiredString79_"),
693             79,
694             FieldType.STRING,
695             bitField1,
696             0x00000800,
697             false,
698             null));
699     builder.withField(
700         forProto2RequiredField(
701             field(Proto2MessageLite.class, "fieldRequiredMessage80_"),
702             80,
703             FieldType.MESSAGE,
704             bitField1,
705             0x00001000,
706             false,
707             null));
708     builder.withField(
709         forProto2RequiredField(
710             field(Proto2MessageLite.class, "fieldRequiredBytes81_"),
711             81,
712             FieldType.BYTES,
713             bitField1,
714             0x00002000,
715             false,
716             null));
717     builder.withField(
718         forProto2RequiredField(
719             field(Proto2MessageLite.class, "fieldRequiredUint3282_"),
720             82,
721             FieldType.UINT32,
722             bitField1,
723             0x00004000,
724             false,
725             null));
726     builder.withField(
727         forProto2RequiredField(
728             field(Proto2MessageLite.class, "fieldRequiredEnum83_"),
729             83,
730             FieldType.ENUM,
731             bitField1,
732             0x00008000,
733             false,
734             TestEnum.internalGetVerifier()));
735     builder.withField(
736         forProto2RequiredField(
737             field(Proto2MessageLite.class, "fieldRequiredSfixed3284_"),
738             84,
739             FieldType.SFIXED32,
740             bitField1,
741             0x00010000,
742             false,
743             null));
744     builder.withField(
745         forProto2RequiredField(
746             field(Proto2MessageLite.class, "fieldRequiredSfixed6485_"),
747             85,
748             FieldType.SFIXED64,
749             bitField1,
750             0x00020000,
751             false,
752             null));
753     builder.withField(
754         forProto2RequiredField(
755             field(Proto2MessageLite.class, "fieldRequiredSint3286_"),
756             86,
757             FieldType.SINT32,
758             bitField1,
759             0x00040000,
760             false,
761             null));
762     builder.withField(
763         forProto2RequiredField(
764             field(Proto2MessageLite.class, "fieldRequiredSint6487_"),
765             87,
766             FieldType.SINT64,
767             bitField1,
768             0x00080000,
769             false,
770             null));
771     builder.withField(
772         forProto2RequiredField(
773             field(Proto2MessageLite.class, "fieldRequiredGroup88_"),
774             88,
775             FieldType.GROUP,
776             bitField1,
777             0x00100000,
778             false,
779             null));
780   }
781 
newMessageInfoForFieldGroup49()782   private static StructuralMessageInfo newMessageInfoForFieldGroup49() {
783     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(1);
784     builder.withSyntax(ProtoSyntax.PROTO2);
785     Field bitField0 = field(FieldGroup49.class, "bitField0_");
786     builder.withField(
787         forProto2OptionalField(
788             field(FieldGroup49.class, "fieldInt3250_"),
789             50,
790             FieldType.INT32,
791             bitField0,
792             0x00000001,
793             false,
794             null));
795     return builder.build();
796   }
797 
newMessageInfoForFieldGroupList51()798   private static StructuralMessageInfo newMessageInfoForFieldGroupList51() {
799     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(1);
800     builder.withSyntax(ProtoSyntax.PROTO2);
801     Field bitField0 = field(FieldGroup49.class, "bitField0_");
802     builder.withField(
803         forProto2OptionalField(
804             field(FieldGroupList51.class, "fieldInt3252_"),
805             52,
806             FieldType.INT32,
807             bitField0,
808             0x00000001,
809             false,
810             null));
811     return builder.build();
812   }
813 
newMessageInfoForFieldGroup69()814   private static StructuralMessageInfo newMessageInfoForFieldGroup69() {
815     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(1);
816     builder.withSyntax(ProtoSyntax.PROTO2);
817     Field bitField0 = field(FieldGroup69.class, "bitField0_");
818     builder.withField(
819         forProto2OptionalField(
820             field(FieldGroup69.class, "fieldInt3270_"),
821             70,
822             FieldType.INT32,
823             bitField0,
824             0x00000001,
825             false,
826             null));
827     return builder.build();
828   }
829 
newMessageInfoForRequiredNestedMessage()830   private static StructuralMessageInfo newMessageInfoForRequiredNestedMessage() {
831     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(1);
832     builder.withSyntax(ProtoSyntax.PROTO2);
833     Field bitField0 = field(RequiredNestedMessage.class, "bitField0_");
834     builder.withField(
835         forProto2OptionalField(
836             field(RequiredNestedMessage.class, "value_"),
837             1,
838             FieldType.INT32,
839             bitField0,
840             0x00000001,
841             false,
842             null));
843     return builder.build();
844   }
845 
newMessageInfoForFieldRequiredGroup88()846   private static StructuralMessageInfo newMessageInfoForFieldRequiredGroup88() {
847     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(1);
848     builder.withSyntax(ProtoSyntax.PROTO2);
849     Field bitField0 = field(FieldRequiredGroup88.class, "bitField0_");
850     builder.withField(
851         forProto2OptionalField(
852             field(FieldRequiredGroup88.class, "fieldInt3289_"),
853             89,
854             FieldType.INT32,
855             bitField0,
856             0x00000001,
857             false,
858             null));
859     return builder.build();
860   }
861 
newMessageInfoForProto2EmptyLite()862   private static StructuralMessageInfo newMessageInfoForProto2EmptyLite() {
863     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(1);
864     builder.withSyntax(ProtoSyntax.PROTO2);
865     return builder.build();
866   }
867 
newMessageInfoForProto2MessageLiteWithExtensions()868   private static StructuralMessageInfo newMessageInfoForProto2MessageLiteWithExtensions() {
869     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(0);
870     builder.withSyntax(ProtoSyntax.PROTO2);
871     return builder.build();
872   }
873 
newMessageInfoForExtensionFieldGroup49()874   private static StructuralMessageInfo newMessageInfoForExtensionFieldGroup49() {
875     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(1);
876     builder.withSyntax(ProtoSyntax.PROTO2);
877     Field bitField0 = field(Proto2TestingLite.FieldGroup49.class, "bitField0_");
878     builder.withField(
879         forProto2OptionalField(
880             field(Proto2TestingLite.FieldGroup49.class, "fieldInt3250_"),
881             50,
882             FieldType.INT32,
883             bitField0,
884             0x00000001,
885             false,
886             null));
887     return builder.build();
888   }
889 
newMessageInfoForExtensionFieldGroupList51()890   private static StructuralMessageInfo newMessageInfoForExtensionFieldGroupList51() {
891     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder(1);
892     builder.withSyntax(ProtoSyntax.PROTO2);
893     Field bitField0 = field(Proto2TestingLite.FieldGroup49.class, "bitField0_");
894     builder.withField(
895         forProto2OptionalField(
896             field(Proto2TestingLite.FieldGroupList51.class, "fieldInt3252_"),
897             52,
898             FieldType.INT32,
899             bitField0,
900             0x00000001,
901             false,
902             null));
903     return builder.build();
904   }
905 
906 
newMessageInfoForProto2MessageLiteWithMaps()907   private static StructuralMessageInfo newMessageInfoForProto2MessageLiteWithMaps() {
908     StructuralMessageInfo.Builder builder = StructuralMessageInfo.newBuilder();
909     builder.withCheckInitialized(
910         new int[] {
911           10, 27, 44, 61, 78, 95, 112, 129, 146, 163, 180, 197,
912         });
913     builder.withSyntax(ProtoSyntax.PROTO2);
914     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_bool_1", 1));
915     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_bytes_2", 2));
916     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_double_3", 3));
917     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_enum_4", 4));
918     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_fixed32_5", 5));
919     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_fixed64_6", 6));
920     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_float_7", 7));
921     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_int32_8", 8));
922     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_int64_9", 9));
923     builder.withField(
924         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_message_10", 10));
925     builder.withField(
926         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_sfixed32_11", 11));
927     builder.withField(
928         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_sfixed64_12", 12));
929     builder.withField(
930         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_sint32_13", 13));
931     builder.withField(
932         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_sint64_14", 14));
933     builder.withField(
934         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_string_15", 15));
935     builder.withField(
936         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_uint32_16", 16));
937     builder.withField(
938         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_bool_uint64_17", 17));
939     builder.withField(
940         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_bool_18", 18));
941     builder.withField(
942         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_bytes_19", 19));
943     builder.withField(
944         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_double_20", 20));
945     builder.withField(
946         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_enum_21", 21));
947     builder.withField(
948         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_fixed32_22", 22));
949     builder.withField(
950         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_fixed64_23", 23));
951     builder.withField(
952         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_float_24", 24));
953     builder.withField(
954         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_int32_25", 25));
955     builder.withField(
956         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_int64_26", 26));
957     builder.withField(
958         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_message_27", 27));
959     builder.withField(
960         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_sfixed32_28", 28));
961     builder.withField(
962         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_sfixed64_29", 29));
963     builder.withField(
964         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_sint32_30", 30));
965     builder.withField(
966         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_sint64_31", 31));
967     builder.withField(
968         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_string_32", 32));
969     builder.withField(
970         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_uint32_33", 33));
971     builder.withField(
972         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed32_uint64_34", 34));
973     builder.withField(
974         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_bool_35", 35));
975     builder.withField(
976         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_bytes_36", 36));
977     builder.withField(
978         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_double_37", 37));
979     builder.withField(
980         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_enum_38", 38));
981     builder.withField(
982         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_fixed32_39", 39));
983     builder.withField(
984         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_fixed64_40", 40));
985     builder.withField(
986         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_float_41", 41));
987     builder.withField(
988         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_int32_42", 42));
989     builder.withField(
990         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_int64_43", 43));
991     builder.withField(
992         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_message_44", 44));
993     builder.withField(
994         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_sfixed32_45", 45));
995     builder.withField(
996         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_sfixed64_46", 46));
997     builder.withField(
998         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_sint32_47", 47));
999     builder.withField(
1000         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_sint64_48", 48));
1001     builder.withField(
1002         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_string_49", 49));
1003     builder.withField(
1004         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_uint32_50", 50));
1005     builder.withField(
1006         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_fixed64_uint64_51", 51));
1007     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_bool_52", 52));
1008     builder.withField(
1009         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_bytes_53", 53));
1010     builder.withField(
1011         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_double_54", 54));
1012     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_enum_55", 55));
1013     builder.withField(
1014         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_fixed32_56", 56));
1015     builder.withField(
1016         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_fixed64_57", 57));
1017     builder.withField(
1018         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_float_58", 58));
1019     builder.withField(
1020         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_int32_59", 59));
1021     builder.withField(
1022         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_int64_60", 60));
1023     builder.withField(
1024         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_message_61", 61));
1025     builder.withField(
1026         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_sfixed32_62", 62));
1027     builder.withField(
1028         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_sfixed64_63", 63));
1029     builder.withField(
1030         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_sint32_64", 64));
1031     builder.withField(
1032         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_sint64_65", 65));
1033     builder.withField(
1034         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_string_66", 66));
1035     builder.withField(
1036         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_uint32_67", 67));
1037     builder.withField(
1038         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int32_uint64_68", 68));
1039     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_bool_69", 69));
1040     builder.withField(
1041         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_bytes_70", 70));
1042     builder.withField(
1043         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_double_71", 71));
1044     builder.withField(mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_enum_72", 72));
1045     builder.withField(
1046         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_fixed32_73", 73));
1047     builder.withField(
1048         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_fixed64_74", 74));
1049     builder.withField(
1050         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_float_75", 75));
1051     builder.withField(
1052         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_int32_76", 76));
1053     builder.withField(
1054         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_int64_77", 77));
1055     builder.withField(
1056         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_message_78", 78));
1057     builder.withField(
1058         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_sfixed32_79", 79));
1059     builder.withField(
1060         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_sfixed64_80", 80));
1061     builder.withField(
1062         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_sint32_81", 81));
1063     builder.withField(
1064         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_sint64_82", 82));
1065     builder.withField(
1066         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_string_83", 83));
1067     builder.withField(
1068         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_uint32_84", 84));
1069     builder.withField(
1070         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_int64_uint64_85", 85));
1071     builder.withField(
1072         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_bool_86", 86));
1073     builder.withField(
1074         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_bytes_87", 87));
1075     builder.withField(
1076         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_double_88", 88));
1077     builder.withField(
1078         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_enum_89", 89));
1079     builder.withField(
1080         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_fixed32_90", 90));
1081     builder.withField(
1082         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_fixed64_91", 91));
1083     builder.withField(
1084         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_float_92", 92));
1085     builder.withField(
1086         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_int32_93", 93));
1087     builder.withField(
1088         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_int64_94", 94));
1089     builder.withField(
1090         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_message_95", 95));
1091     builder.withField(
1092         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_sfixed32_96", 96));
1093     builder.withField(
1094         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_sfixed64_97", 97));
1095     builder.withField(
1096         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_sint32_98", 98));
1097     builder.withField(
1098         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_sint64_99", 99));
1099     builder.withField(
1100         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_string_100", 100));
1101     builder.withField(
1102         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_uint32_101", 101));
1103     builder.withField(
1104         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed32_uint64_102", 102));
1105     builder.withField(
1106         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_bool_103", 103));
1107     builder.withField(
1108         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_bytes_104", 104));
1109     builder.withField(
1110         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_double_105", 105));
1111     builder.withField(
1112         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_enum_106", 106));
1113     builder.withField(
1114         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_fixed32_107", 107));
1115     builder.withField(
1116         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_fixed64_108", 108));
1117     builder.withField(
1118         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_float_109", 109));
1119     builder.withField(
1120         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_int32_110", 110));
1121     builder.withField(
1122         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_int64_111", 111));
1123     builder.withField(
1124         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_message_112", 112));
1125     builder.withField(
1126         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_sfixed32_113", 113));
1127     builder.withField(
1128         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_sfixed64_114", 114));
1129     builder.withField(
1130         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_sint32_115", 115));
1131     builder.withField(
1132         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_sint64_116", 116));
1133     builder.withField(
1134         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_string_117", 117));
1135     builder.withField(
1136         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_uint32_118", 118));
1137     builder.withField(
1138         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sfixed64_uint64_119", 119));
1139     builder.withField(
1140         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_bool_120", 120));
1141     builder.withField(
1142         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_bytes_121", 121));
1143     builder.withField(
1144         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_double_122", 122));
1145     builder.withField(
1146         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_enum_123", 123));
1147     builder.withField(
1148         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_fixed32_124", 124));
1149     builder.withField(
1150         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_fixed64_125", 125));
1151     builder.withField(
1152         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_float_126", 126));
1153     builder.withField(
1154         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_int32_127", 127));
1155     builder.withField(
1156         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_int64_128", 128));
1157     builder.withField(
1158         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_message_129", 129));
1159     builder.withField(
1160         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_sfixed32_130", 130));
1161     builder.withField(
1162         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_sfixed64_131", 131));
1163     builder.withField(
1164         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_sint32_132", 132));
1165     builder.withField(
1166         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_sint64_133", 133));
1167     builder.withField(
1168         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_string_134", 134));
1169     builder.withField(
1170         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_uint32_135", 135));
1171     builder.withField(
1172         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint32_uint64_136", 136));
1173     builder.withField(
1174         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_bool_137", 137));
1175     builder.withField(
1176         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_bytes_138", 138));
1177     builder.withField(
1178         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_double_139", 139));
1179     builder.withField(
1180         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_enum_140", 140));
1181     builder.withField(
1182         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_fixed32_141", 141));
1183     builder.withField(
1184         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_fixed64_142", 142));
1185     builder.withField(
1186         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_float_143", 143));
1187     builder.withField(
1188         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_int32_144", 144));
1189     builder.withField(
1190         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_int64_145", 145));
1191     builder.withField(
1192         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_message_146", 146));
1193     builder.withField(
1194         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_sfixed32_147", 147));
1195     builder.withField(
1196         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_sfixed64_148", 148));
1197     builder.withField(
1198         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_sint32_149", 149));
1199     builder.withField(
1200         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_sint64_150", 150));
1201     builder.withField(
1202         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_string_151", 151));
1203     builder.withField(
1204         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_uint32_152", 152));
1205     builder.withField(
1206         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_sint64_uint64_153", 153));
1207     builder.withField(
1208         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_bool_154", 154));
1209     builder.withField(
1210         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_bytes_155", 155));
1211     builder.withField(
1212         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_double_156", 156));
1213     builder.withField(
1214         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_enum_157", 157));
1215     builder.withField(
1216         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_fixed32_158", 158));
1217     builder.withField(
1218         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_fixed64_159", 159));
1219     builder.withField(
1220         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_float_160", 160));
1221     builder.withField(
1222         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_int32_161", 161));
1223     builder.withField(
1224         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_int64_162", 162));
1225     builder.withField(
1226         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_message_163", 163));
1227     builder.withField(
1228         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_sfixed32_164", 164));
1229     builder.withField(
1230         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_sfixed64_165", 165));
1231     builder.withField(
1232         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_sint32_166", 166));
1233     builder.withField(
1234         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_sint64_167", 167));
1235     builder.withField(
1236         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_string_168", 168));
1237     builder.withField(
1238         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_uint32_169", 169));
1239     builder.withField(
1240         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_string_uint64_170", 170));
1241     builder.withField(
1242         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_bool_171", 171));
1243     builder.withField(
1244         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_bytes_172", 172));
1245     builder.withField(
1246         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_double_173", 173));
1247     builder.withField(
1248         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_enum_174", 174));
1249     builder.withField(
1250         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_fixed32_175", 175));
1251     builder.withField(
1252         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_fixed64_176", 176));
1253     builder.withField(
1254         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_float_177", 177));
1255     builder.withField(
1256         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_int32_178", 178));
1257     builder.withField(
1258         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_int64_179", 179));
1259     builder.withField(
1260         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_message_180", 180));
1261     builder.withField(
1262         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_sfixed32_181", 181));
1263     builder.withField(
1264         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_sfixed64_182", 182));
1265     builder.withField(
1266         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_sint32_183", 183));
1267     builder.withField(
1268         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_sint64_184", 184));
1269     builder.withField(
1270         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_string_185", 185));
1271     builder.withField(
1272         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_uint32_186", 186));
1273     builder.withField(
1274         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint32_uint64_187", 187));
1275     builder.withField(
1276         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_bool_188", 188));
1277     builder.withField(
1278         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_bytes_189", 189));
1279     builder.withField(
1280         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_double_190", 190));
1281     builder.withField(
1282         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_enum_191", 191));
1283     builder.withField(
1284         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_fixed32_192", 192));
1285     builder.withField(
1286         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_fixed64_193", 193));
1287     builder.withField(
1288         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_float_194", 194));
1289     builder.withField(
1290         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_int32_195", 195));
1291     builder.withField(
1292         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_int64_196", 196));
1293     builder.withField(
1294         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_message_197", 197));
1295     builder.withField(
1296         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_sfixed32_198", 198));
1297     builder.withField(
1298         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_sfixed64_199", 199));
1299     builder.withField(
1300         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_sint32_200", 200));
1301     builder.withField(
1302         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_sint64_201", 201));
1303     builder.withField(
1304         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_string_202", 202));
1305     builder.withField(
1306         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_uint32_203", 203));
1307     builder.withField(
1308         mapFieldInfo(Proto2MessageLiteWithMaps.class, "field_map_uint64_uint64_204", 204));
1309 
1310     return builder.build();
1311   }
1312 
field(Class<?> clazz, String name)1313   private static Field field(Class<?> clazz, String name) {
1314     try {
1315       return clazz.getDeclaredField(name);
1316     } catch (NoSuchFieldException | SecurityException e) {
1317       throw new RuntimeException(e);
1318     }
1319   }
1320 
mapFieldInfo(Class<?> clazz, String fieldName, int fieldNumber)1321   private static FieldInfo mapFieldInfo(Class<?> clazz, String fieldName, int fieldNumber) {
1322     try {
1323       return forMapField(
1324           field(clazz, SchemaUtil.toCamelCase(fieldName, false) + "_"),
1325           fieldNumber,
1326           SchemaUtil.getMapDefaultEntry(clazz, fieldName),
1327           fieldName.contains("_enum_") ? TestEnum.internalGetVerifier() : null);
1328     } catch (Throwable t) {
1329       throw new RuntimeException(t);
1330     }
1331   }
1332 }
1333