-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Description
What version of gRPC-Java are you using?
v1.56.0
What is your environment?
Linux, Java 17
What did you expect to see?
Generated code from the gRPC Java compiler should use fully qualified names for String.
What did you see instead?
Compilation error for inputs that include a message type named String.
Steps to reproduce the bug
syntax = "proto3";
package example;
message String {
string val = 1;
}
message GetThingRequest {
string id = 1;
}
message GetThingResponse {
String id = 1;
}
service ExampleService {
rpc GetThing(GetThingRequest) returns (GetThingResponse);
}To generate code, I'm using buf with this buf.gen.yaml:
version: v1
managed:
enabled: true
plugins:
- plugin: buf.build/protocolbuffers/java
out: gen
- plugin: buf.build/grpc/java
out: genThe issue seems to be that the variable here
| vars["String"] = "java.lang.String"; |
" private final String methodName;\n" " $proto_method_descriptor_supplier$(String methodName) {\n" "public static final String SERVICE_NAME = "
I'm happy to raise a PR to fix but I'm having a hard time getting the local build to work end to end on MacOS arm64 and Linux arm64. I imagine this will require not only changing the compiler but also potentially updating tests and regenerating code with the new compiler.