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