Skip to content

Commit d469cca

Browse files
mateoguzmanafacebook-github-bot
authored andcommitted
Make SoftAssertions internal (facebook#51172)
Summary: This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.bridge.SoftAssertions). ## Changelog: [INTERNAL] - Make com.facebook.react.bridge.SoftAssertions internal Pull Request resolved: facebook#51172 Test Plan: ```bash yarn test-android yarn android ``` Reviewed By: rshest Differential Revision: D74368288 Pulled By: arushikesarwani94 fbshipit-source-id: 50e9559f7f15700ea9adfb03a260615e3b397a0c
1 parent 23e693a commit d469cca

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,13 +1442,6 @@ public final class com/facebook/react/bridge/RuntimeExecutor : com/facebook/jni/
14421442
public final class com/facebook/react/bridge/RuntimeScheduler : com/facebook/jni/HybridClassBase {
14431443
}
14441444

1445-
public final class com/facebook/react/bridge/SoftAssertions {
1446-
public static final field INSTANCE Lcom/facebook/react/bridge/SoftAssertions;
1447-
public static final fun assertCondition (ZLjava/lang/String;)V
1448-
public static final fun assertNotNull (Ljava/lang/Object;)Ljava/lang/Object;
1449-
public static final fun assertUnreachable (Ljava/lang/String;)V
1450-
}
1451-
14521445
public abstract interface class com/facebook/react/bridge/UIManager : com/facebook/react/bridge/PerformanceCounter {
14531446
public abstract fun addRootView (Landroid/view/View;Lcom/facebook/react/bridge/WritableMap;)I
14541447
public abstract fun addUIManagerEventListener (Lcom/facebook/react/bridge/UIManagerListener;)V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/SoftAssertions.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import com.facebook.react.bridge.ReactSoftExceptionLogger.Categories.SOFT_ASSERT
1515
* opinion on when these assertions should be used as opposed to assertions that might throw
1616
* AssertionError Throwables that will cause the app to hard crash.
1717
*/
18-
public object SoftAssertions {
18+
internal object SoftAssertions {
1919

2020
/**
2121
* Throw [AssertionException] with a given message. Use this method surrounded with `if` block
@@ -24,7 +24,7 @@ public object SoftAssertions {
2424
* throw.
2525
*/
2626
@JvmStatic
27-
public fun assertUnreachable(message: String): Unit {
27+
fun assertUnreachable(message: String): Unit {
2828
ReactSoftExceptionLogger.logSoftException(SOFT_ASSERTIONS, AssertionException(message))
2929
}
3030

@@ -34,7 +34,7 @@ public object SoftAssertions {
3434
* throw.
3535
*/
3636
@JvmStatic
37-
public fun assertCondition(condition: Boolean, message: String): Unit {
37+
fun assertCondition(condition: Boolean, message: String): Unit {
3838
if (!condition) {
3939
ReactSoftExceptionLogger.logSoftException(SOFT_ASSERTIONS, AssertionException(message))
4040
}
@@ -45,7 +45,7 @@ public object SoftAssertions {
4545
* an assertion with ReactSoftExceptionLogger, which decides whether or not to actually throw.
4646
*/
4747
@JvmStatic
48-
public fun <T> assertNotNull(instance: T?): T? {
48+
fun <T> assertNotNull(instance: T?): T? {
4949
if (instance == null) {
5050
ReactSoftExceptionLogger.logSoftException(
5151
SOFT_ASSERTIONS, AssertionException("Expected object to not be null!"))

0 commit comments

Comments
 (0)