-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix(java): apply Mouaad suggestions APIC-396 #344
Conversation
✅ Deploy Preview for api-clients-automation canceled.
|
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it, great clean! Small suggestion
return value | ||
.replaceAll("\\W+", "_") | ||
.replaceAll("(\\b[a-z]+|\\G(?!^))((?:[A-Z]|\\d+)[a-z]*)", "$1_$2") | ||
.toUpperCase(Locale.ROOT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return value | |
.replaceAll("\\W+", "_") | |
.replaceAll("(\\b[a-z]+|\\G(?!^))((?:[A-Z]|\\d+)[a-z]*)", "$1_$2") | |
.toUpperCase(Locale.ROOT); | |
return value | |
.replaceAll("(.+?)([A-Z]|[0-9])", "$1_$2") | |
.toUpperCase(Locale.ROOT); |
Not fully tested but I think it should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your regex works even better, it handles the case like AddUnique
-> ADD_UNIQUE
that didn't work before, thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 nice
also thanks @aallam
algolia/api-clients-automation#344 Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
🧭 What and Why
🎟 JIRA Ticket: APIC-396
Apply the suggestions brought by @aallam in this PR
Changes included:
java.util.Date
final
keyword when needed🧪 Test
CI