Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 545 by [email protected]: Unable to set enum field via setField (Java Protobufs 2.5.0)
http://code.google.com/p/protobuf/issues/detail?id=545

What steps will reproduce the problem?
1. Compile the attached .proto file to Java
2. Run the attached TestDriver.java file
3. Observe the following exception:

Exception in thread "main" java.lang.IllegalArgumentException: argument type mismatch
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.protobuf.GeneratedMessage.invokeOrDie(GeneratedMessage.java:1427) at com.google.protobuf.GeneratedMessage.access$1400(GeneratedMessage.java:57) at com.google.protobuf.GeneratedMessage$FieldAccessorTable$SingularEnumFieldAccessor.set(GeneratedMessage.java:1778) at com.google.protobuf.GeneratedMessage$Builder.setField(GeneratedMessage.java:366)
        at com.sri.scenic.TestDriver.main(TestDriver.java:12)


What is the expected output? What do you see instead?

I expect the field to be set with the legal value Action.Act1. I need to set the field via setField because in general I may not know the exact type of message, but I am guaranteed that it will contain a field named "action" of type Action.


What version of the product are you using? On what operating system?
Java Protobufs 2.5.0 on Windows 7

Thanks for your time.


Attachments:
        TestDriver.java  435 bytes
        test.proto  241 bytes

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
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 http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to