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

Replaced capitalize() method to mitigate issue with camelCase flavors #243

Closed
wants to merge 1 commit into from

Conversation

fobo66
Copy link

@fobo66 fobo66 commented Sep 23, 2022

I used Apache Commons for the capitalization, which may be unreasonable. So if it's not okay to use Commons, it's possible to rewrite the existing method to not interfere with the camelCase names of the flavors.

I've added a test case for the issue, so you can see that it will fail without the fix.

Also, compilation failed for me because of the public modifier in the enum, so I changed that as well.

Closes #183


public static String capitalize(String s) {
if (s.length() == 0) return s;
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think rewriting this method to just use:

  return s.substring(0, 1).toUpperCase() + s.substring(1);

is more reasonable than taking on the dependency on org.apache.commons:commons-lang3 and increases the chances of this getting merged.

davidmotson pushed a commit that referenced this pull request Jan 17, 2023
also bumped the gradle version to fix incompatibility with more recent JVM and updated groovy enum definition
@fobo66 fobo66 closed this Jan 20, 2023
@fobo66 fobo66 deleted the fix-capitalize branch January 20, 2023 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google-services.json search location changed when upgrading from 4.3.5 to 4.3.8
2 participants