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

refactor: Migrate Internal ProviderPersistence class to kotlin #533

Open
wants to merge 1 commit into
base: blackout-2024
Choose a base branch
from

Conversation

Mansi-mParticle
Copy link
Contributor

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

  • Migrate internal package’s ProviderPersistence classe to Kotlin.

Testing Plan

  • Was this tested locally? If not, explain why.
  • Tested with sample application and ran the unit test cases

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

Copy link
Collaborator

@einsteinx2 einsteinx2 left a comment

Choose a reason for hiding this comment

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

Just those questions about locale, otherwise looks good to me.

private fun applyMacro(defaultString: String): String {
var defaultString = defaultString
if (!isEmpty(defaultString) && defaultString.startsWith("%")) {
defaultString = defaultString.lowercase(Locale.getDefault())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we sure we want to use the default locale here? I'm not saying we don't, but is this different in any way from the toLowerCase() function in Java? Does getDefault() get the current system default or some universal default? I've been bitten by locale bugs in the past, so I want to make sure we're 100% certain here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so here Locale.getDefault() will return the default language for system. languages where case rules vary (e.g., Turkish).


private fun generateAID(): String {
var uuid = UUID.randomUUID().toString().replace("-", "")
uuid = uuid.uppercase(Locale.getDefault())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same concern about locale here.

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.

2 participants