mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
fix: add JvmStatic to all methods used in cpp (#45243)
Summary: Following-up on https://github.com/facebook/react-native/pull/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: https://github.com/facebook/react-native/pull/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
This commit is contained in:
1 parent
ad3df84668
commit
54dadd7bda
1 file changed
+3
+3
@@ -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 {
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user