Skip to content

Commit

Permalink
fix: add JvmStatic to all methods used in cpp (#45243)
Browse files Browse the repository at this point in the history
Summary:
Following-up on #45230, I added all the needed `JvmStatic` annotations for methods used in cpp code here: https://github.com/facebook/hermes/blob/f5c867514c71b25212eb3039230e0c095518b532/lib/Platform/Unicode/PlatformUnicodeJava.cpp.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Use `JvmStatic` annotations for all methods from `AndroidUnicodeUtils.kt`

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Use `JvmStatic` annotations for all methods from `AndroidUnicodeUtils.kt`

Pull Request resolved: #45243

Test Plan: Try and use those methods to see that they don't crash on `cpp` side.

Reviewed By: cortinico

Differential Revision: D59264093

Pulled By: dmytrorykun

fbshipit-source-id: 07d683ee38ea1c7d9621ad2e37d04f3d484d3200
  • Loading branch information
WoLewicki authored and facebook-github-bot committed Jul 2, 2024
1 parent ad3df84 commit 54dadd7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ import java.util.Locale
public object AndroidUnicodeUtils {

@DoNotStrip
@JvmStatic
public fun localeCompare(left: String?, right: String?): Int {
val collator = Collator.getInstance()
return collator.compare(left, right)
}

@DoNotStrip
@JvmStatic
public fun dateFormat(unixtimeMs: Double, formatDate: Boolean, formatTime: Boolean): String {
val format =
when {
Expand Down Expand Up @@ -53,6 +55,7 @@ public object AndroidUnicodeUtils {
}

@DoNotStrip
@JvmStatic
public fun normalize(input: String?, form: Int): String =
when (form) {
FORM_C -> Normalizer.normalize(input, Normalizer.Form.NFC)
Expand Down

0 comments on commit 54dadd7

Please sign in to comment.