@SuppressWarnings("unchecked") private Object fromReflectionType(final Object value){
  FieldDescriptor descriptor=getDescriptor();
  if (descriptor.isRepeated()) {
    if (descriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE || descriptor.getJavaType() == FieldDescriptor.JavaType.ENUM) {
      final List result=new ArrayList();
      for (      final Object element : (List)value) {
        result.add(singularFromReflectionType(element));
      }
      return result;
    }
 else {
      return value;
    }
  }
 else {
    return singularFromReflectionType(value);
  }
}

@ SuppressWarnings ( "unchecked" ) private Object fromReflectionType ( final Object value ) { FieldDescriptor descriptor = getDescriptor ( ) ; if ( descriptor . isRepeated ( ) ) { if ( descriptor . getJavaType ( ) == FieldDescriptor . JavaType . MESSAGE || descriptor . getJavaType ( ) == FieldDescriptor . JavaType . ENUM ) { final List result = new ArrayList ( ) ; for ( final Object element : ( List ) value ) { result . add ( singularFromReflectionType ( element ) ) ; } return result ; } else { return value ; } } else { return singularFromReflectionType ( value ) ; } }
convert from the type used by the reflection accessors to the type used by native accessors . e . g . , for enums , the reflection accessors use enumvaluedescriptors but the native accessors use the generated enum type .
