google / protobuf-gradle-plugin

Protobuf Plugin for Gradle
Other
1.77k stars 273 forks source link

Java keyword "public" not escaped during proto generation #736

Closed wadriance closed 8 months ago

wadriance commented 1 year ago

See https://github.com/google/protobuf-gradle-plugin/issues/46 for the same issue with the keyword "interface".

My protobuf files are in packages that include the word "public" like so:

package example.example.public.proto;

When the java files are built from the protos by the Gradle plugin, the generated Java packages contain the word "public" without any escaping, which causes compilation errors since "public" is a keyword in Java.

I can submit the fix if you can point me to the right spot.

ejona86 commented 8 months ago

This is not a plugin issue. https://github.com/protocolbuffers/protobuf is for the actual generated code. That other issue you mentioned was not for the plugin; it was fixed by a change in the protobuf repo.