I know this is a bit old but...I've just discovered that toString on any 
message class in Java throws an exception (java.lang.NoSuchMethodError: 
com.google.protobuf.DescriptorProtos$FileDescriptorProto.getPublicDependencyCount())
 
- this is with the version of the compiler and source being kept in sync so 
I must assume there's a bug somewhere in that code...?

On Thursday, April 4, 2013 4:42:14 PM UTC+1, Stik kos wrote:
>
> Hello,
>
> I just upgraded 'protobuf-java' to 2.5.0 and noticed that this upgrade 
> breaks the default toString implementation with error:
>
> java.lang.UnsupportedOperationException: This is supposed to be overridden 
> by subclasses.
> at 
> com.google.protobuf.GeneratedMessage.getUnknownFields(GeneratedMessage.java:180)
> at com.google.protobuf.TextFormat$Printer.print(TextFormat.java:275)
> at com.google.protobuf.TextFormat$Printer.access$400(TextFormat.java:248)
> at com.google.protobuf.TextFormat.print(TextFormat.java:71)
> at com.google.protobuf.TextFormat.printToString(TextFormat.java:118)
> at com.google.protobuf.AbstractMessage.toString(AbstractMessage.java:106)
> at java.lang.String.valueOf(String.java:2826)
> at java.lang.StringBuilder.append(StringBuilder.java:115)
>
>
> I can't find anything in the release notes about this and the docs (
> https://developers.google.com/protocol-buffers/docs/javatutorial) still 
> state:
>
> toString(): returns a human-readable representation of the message, 
> particularly useful for debugging.
>
> Is there any reason why no default toString is provided anymore?
>
> 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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to