question: @ SuppressWarnings ( "unchecked" ) private Object toReflectionType ( final Object value ) { FieldDescriptor descriptor = getDescriptor ( ) ; if ( descriptor . isRepeated ( ) ) { if ( descriptor . getJavaType ( ) == FieldDescriptor . JavaType . ENUM ) { final List result = new ArrayList ( ) ; for ( final Object element : ( List ) value ) { result . add ( singularToReflectionType ( element ) ) ; } return result ; } else { return value ; } } else { return singularToReflectionType ( value ) ; } }
target:  Convert from the type used by the native accessors to the type used by reflection accessors.  E.g., for enums, the reflection accessors use EnumValueDescriptors but the native accessors use the generated enum type.