Tutorial Java: error in the "Writing A Message" code

10 views
Skip to first unread message

stefano

unread,
Aug 3, 2022, 3:43:01 AM8/3/22
to Protocol Buffers
If you look at this link


you can find the following code:
...
// Add an address.
   
addressBook.addPerson(
     
PromptForAddress(new BufferedReader(new InputStreamReader(System.in)),
                       
System.out));
...

But I think that the correct code is:
...
// Add an address.
   
addressBook.addPeople(
     
PromptForAddress(new BufferedReader(new InputStreamReader(System.in)),
                       
System.out));
...

Derek Perez

unread,
Aug 3, 2022, 12:12:11 PM8/3/22
to stefano, David Castro, Protocol Buffers
Thanks for the report! +David Castro can you revise this?

- D

--
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 protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/bbd01667-922d-4950-9481-54f46c7a2826n%40googlegroups.com.

David Castro

unread,
Aug 3, 2022, 1:31:05 PM8/3/22
to Derek Perez, stefano, Protocol Buffers

Stefano is right, based on the proto definition earlier in the tutorial:

message AddressBook {
  repeated Person people = 1;
}


Thanks for pointing this out!
--
David Castro | Core Languages Technical Writer | logo...@google.com 

[Off-hours communication: If you receive this email outside of your usual working hours, please don't feel the need to respond until it's within your working window.]
Reply all
Reply to author
Forward
0 new messages