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

Discovery samples: Ensure the last element of the Java import path is capitalized #151

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vchudnov-g
Copy link
Contributor

This was causing problems for IAM, since the Discovery file said "canonicalName" : "iam" and thus the import in the sample read import ....v1.iam; instead of import ....v1.Iam;

@vchudnov-g vchudnov-g added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Jun 5, 2020
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 5, 2020
Copy link
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

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

LGTM with a comment

Joiner.on('.').join(packagePrefix, capitalize(apiTypeName)));
}

public static String capitalize(String str) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be public (maybe private is enough, I see it being used from getSErviceTypeName()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@vchudnov-g
Copy link
Contributor Author

Argh. Not fully fixed, it turns out. The references to the imported class are still lower-cased. I'll update this PR with a fix.

@vchudnov-g
Copy link
Contributor Author

Ok, that should be fixed now. I'll figure out how to add a test before I submit this.

Copy link
Contributor

@vam-google vam-google left a comment

Choose a reason for hiding this comment

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

LGTM

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants