Try addRepeated...Builder() and then getRepeatedFieldBuilder():
https://github.com/google/protobuf/blob/master/java/core/src/test/java/com/google/protobuf/GeneratedMessageTest.java#L1613


On Friday, February 19, 2016 at 3:57:10 PM UTC-8, Diana Contreras wrote:
>
> Is there a chance that there is a method like setRepeatedFieldBuilder? Im 
> using setRepeatedField on a builder by doing:
>
> builder.setRepeatedField(field, i, builderToSet.buildPartial());
>
> But I'm having trouble with references due to the fact that when I try to 
> retrieve the builders set:
>
> Builder b = builder.getRepeatedFieldBuilder(field, i)
>
>  the builder "b" is a different object than the builder I originally set, 
> because by doing the buildPartial on the "set" the builder is converted to 
> an inmutable message, and by doing getRepeatedFieldBuilder a new 
> builder(different reference id) is returned. 
> So if a reference to that builder already existed, it won't be updated 
> because now we are talking about a new builder with the same info. Any help?
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to