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

compiler: allow capitalized java keywords as rpc names #4309

Merged
merged 4 commits into from
Apr 5, 2018

Conversation

zpencer
Copy link
Contributor

@zpencer zpencer commented Apr 5, 2018

previously Import fails because it gets turned into a method named
import. This PR makes the method be named import_, everything else
stays the same, such as the name in the method descriptor.

Note: iMport or iMPORT or any variation of capitalizations that is
not Import always worked. Import gets translated into import
because of our attempts to camel case the names.

fixes #2195

previously `Import` fails because it gets turned into a method named
`import`. This PR makes the method be named `import_`, everything else
stays the same, such as the name in the method descriptor.

Note: `iMport` or `iMPORT` or any variation of capitalizations that is
not `Import` always worked. `Import` gets translated into `import`
because of our attempts to camel case the names.
@@ -48,7 +107,10 @@ static string MixedLower(const string& word) {
after_underscore = false;
}
}
return w;
if (java_keywords.find(w) == java_keywords.end()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you invert this condition so the final return is the common/successful case?

@zpencer zpencer added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Apr 5, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Apr 5, 2018
@zpencer zpencer merged commit 8d3d26d into grpc:master Apr 5, 2018
@zpencer zpencer deleted the codegen-reserved-java-keywords branch April 5, 2018 23:45
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gRPC code generator needs to handle reserved words in method names
3 participants