private <T extends TBase<T, F>, F extends TFieldIdEnum> Map<String, TField> computeFieldNameMap(
            Class<?> clazz) {
        final Map<String, TField> map = new HashMap<>();

        if (isTBase(clazz)) {
            // Get the metaDataMap for this Thrift class
            @SuppressWarnings("unchecked")
            final Map<? extends TFieldIdEnum, FieldMetaData> metaDataMap =
                    ThriftMetadataAccess.getStructMetaDataMap((Class<T>) clazz);

            for (Entry<? extends TFieldIdEnum, FieldMetaData> e : metaDataMap.entrySet()) {
                final String fieldName = e.getKey().getFieldName();
                final FieldMetaData metaData = e.getValue();
                updateClassMap(metaData, clazz);

                // Workaround a bug in the generated thrift message read()
                // method by mapping the ENUM type to the INT32 type
                // The thrift generated parsing code requires that, when expecting
                // a value of enum, we actually parse a value of type int32. The
                // generated read() method then looks up the enum value in a map.
                final byte type = TType.ENUM == metaData.valueMetaData.type ? TType.I32
                                                                            : metaData.valueMetaData.type;

                map.put(fieldName,
                        new TField(fieldName,
                                   type,
                                   e.getKey().getThriftFieldId()));
            }
        } else { // TApplicationException
            map.put("message", new TField("message", (byte)11, (short)1));
            map.put("type", new TField("type", (byte)8, (short)2));
        }

        return map;
    }
Compute a new field name map for the current thrift message
we are parsing.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/common/thrift/text/StructContext.java