simonAndre / protobuf-embedded-c

Automatically exported from code.google.com/p/protobuf-embedded-c
0 stars 0 forks source link

M4 does NOT work with without the optional attributes #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download "protoc-1.0M4.jar"
2. Create  "phone.proto" with: 

enum PhoneType {
  MOBILE = 0;
  HOME = 1;
  WORK = 2;
}

message PhoneNumber {
  required string number = 1;
  required PhoneType type = 2;

3. Run "java -jar protoc-1.0M4.jar phone.proto"

The following error message appears (works fine with M3):

Exception in thread "main" java.lang.reflect.InvocationTargetException
        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 org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.NumberFormatException: null
        at java.lang.Integer.parseInt(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at edu.tum.cs.ccts.protobuf.embedded.EmbeddedCGenerator.getMaximumSerial
izedSize(EmbeddedCGenerator.java:491)
        at edu.tum.cs.ccts.protobuf.embedded.EmbeddedCGenerator.compileHeader(Em
beddedCGenerator.java:307)
        at edu.tum.cs.ccts.protobuf.embedded.EmbeddedCGenerator.doGenerate(Embed
dedCGenerator.java:113)
        at edu.tum.cs.ccts.protobuf.embedded.Protoc.main(Protoc.java:126)
        ... 5 more

Original issue reported on code.google.com by widmann....@gmail.com on 24 Jun 2013 at 5:25

GoogleCodeExporter commented 9 years ago
This error is caused because you have a string attribute and did not define in 
an annotation @max_string_length. Error is fixed by issue 41

Original comment by nvp...@gmail.com on 24 Jun 2013 at 1:03