Skip to content

Commit 3f81348

Browse files
mateoguzmanafacebook-github-bot
authored andcommitted
Make ClassFinder internal (#50482)
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.common.ClassFinder). ## Changelog: [INTERNAL] - Make com.facebook.react.common.ClassFinder internal Pull Request resolved: #50482 Test Plan: ```bash yarn test-android yarn android ``` Reviewed By: cortinico Differential Revision: D72445636 Pulled By: javache fbshipit-source-id: 678327173afbbd5140eef163782051203b4f175b
1 parent 150b1cc commit 3f81348

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,12 +1669,6 @@ public final class com/facebook/react/bridge/queue/ReactQueueConfigurationSpec$C
16691669
public final fun createDefault ()Lcom/facebook/react/bridge/queue/ReactQueueConfigurationSpec;
16701670
}
16711671

1672-
public final class com/facebook/react/common/ClassFinder {
1673-
public static final field INSTANCE Lcom/facebook/react/common/ClassFinder;
1674-
public static final fun canLoadClassesFromAnnotationProcessors ()Z
1675-
public static final fun findClass (Ljava/lang/String;)Ljava/lang/Class;
1676-
}
1677-
16781672
public final class com/facebook/react/common/ClearableSynchronizedPool : androidx/core/util/Pools$Pool {
16791673
public fun <init> (I)V
16801674
public fun acquire ()Ljava/lang/Object;

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/ClassFinder.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@ package com.facebook.react.common
1010
import com.facebook.react.BuildConfig
1111
import kotlin.jvm.Throws
1212

13-
public object ClassFinder {
13+
internal object ClassFinder {
1414

1515
/**
1616
* We don't run the ModuleInfoProvider Annotation Processor in OSS, so there is no need to attempt
1717
* to call Class.forName() as we know for sure that those classes won't be there.
1818
*/
19-
@JvmStatic
20-
public fun canLoadClassesFromAnnotationProcessors(): Boolean = BuildConfig.IS_INTERNAL_BUILD
19+
@JvmStatic fun canLoadClassesFromAnnotationProcessors(): Boolean = BuildConfig.IS_INTERNAL_BUILD
2120

2221
@JvmStatic
2322
@Throws(ClassNotFoundException::class)
24-
public fun findClass(className: String): Class<*>? {
23+
fun findClass(className: String): Class<*>? {
2524
if (canLoadClassesFromAnnotationProcessors().not()) {
2625
return null
2726
}

0 commit comments

Comments
 (0)