Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile fails without "optional" annotations @max_string_length and @max_repeated_length in .proto file #51

Open
GoogleCodeExporter opened this issue Jul 7, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Repro:
1. Generate a .proto file that has a string type but does not have the 
@max_string_length comment
2. Attempt to compile the .proto file

Expected:
I expected it to compile. Instead I get this exception:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NumberFormatException: null
    at java.lang.Integer.parseInt(Integer.java:417)
    at java.lang.Integer.parseInt(Integer.java:499)
    at edu.tum.cs.ccts.protobuf.embedded.EmbeddedCGenerator.getMaximumSerializedSize(EmbeddedCGenerator.java:491)
    at edu.tum.cs.ccts.protobuf.embedded.EmbeddedCGenerator.compileHeader(EmbeddedCGenerator.java:307)
    at edu.tum.cs.ccts.protobuf.embedded.EmbeddedCGenerator.doGenerate(EmbeddedCGenerator.java:113)
    at edu.tum.cs.ccts.protobuf.embedded.Protoc.main(Protoc.java:126)

This is running 1.0M4 on Java 1.6.0_65 on Max OSX 10.6.

When I add the //@max_string_length=32 annotation it compiles without issue.

A similar exception happens when the //@max_repeated_length annotation is 
missing and you declare an element repeated.

Original issue reported on code.google.com by [email protected] on 31 Dec 2013 at 5:16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant