Skip to content

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.
@zpencer zpencer requested a review from ejona86 April 5, 2018 21:19
}
}
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