Skip to content

Commit 2fae1eb

Browse files
cortinicofacebook-github-bot
authored andcommitted
Remove all the redundant public visibility modifier (facebook#49532)
Summary: Pull Request resolved: facebook#49532 I've done a pass with Android Studio and removed automatically all the `public` modifier that are not really needed. Changelog: [Internal] [Changed] - Reviewed By: mdvacca Differential Revision: D69857731
1 parent e804683 commit 2fae1eb

18 files changed

+56
-84
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal object ReactBridge {
1919

2020
@JvmStatic
2121
@Synchronized
22-
public fun staticInit() {
22+
fun staticInit() {
2323
if (_didInit) {
2424
return
2525
}
@@ -35,14 +35,14 @@ internal object ReactBridge {
3535
}
3636

3737
@JvmStatic
38-
public val loadStartTime: Long
38+
val loadStartTime: Long
3939
get() = _loadStartTime
4040

4141
@JvmStatic
42-
public val loadEndTime: Long
42+
val loadEndTime: Long
4343
get() = _loadEndTime
4444

4545
@JvmStatic
46-
public val initialized: Boolean
46+
val initialized: Boolean
4747
@JvmName("isInitialized") get() = _didInit
4848
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public open class ReadableNativeArray protected constructor() : NativeArray(), R
8686
private companion object {
8787
@get:JvmStatic
8888
@get:JvmName("getJNIPassCounter")
89-
public var jniPassCounter: Int = 0
89+
var jniPassCounter: Int = 0
9090
private set
9191
}
9292
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public open class ReadableNativeMap protected constructor() : NativeMap(), Reada
179179
private companion object {
180180
@get:JvmStatic
181181
@get:JvmName("getJNIPassCounter")
182-
public var jniPassCounter: Int = 0
182+
var jniPassCounter: Int = 0
183183
private set
184184
}
185185
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/AndroidChoreographerProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ internal object AndroidChoreographerProvider : ChoreographerProvider {
1515
private class AndroidChoreographer : ChoreographerProvider.Choreographer {
1616
private val instance: android.view.Choreographer = android.view.Choreographer.getInstance()
1717

18-
public override fun postFrameCallback(callback: android.view.Choreographer.FrameCallback) {
18+
override fun postFrameCallback(callback: android.view.Choreographer.FrameCallback) {
1919
instance.postFrameCallback(callback)
2020
}
2121

22-
public override fun removeFrameCallback(callback: android.view.Choreographer.FrameCallback) {
22+
override fun removeFrameCallback(callback: android.view.Choreographer.FrameCallback) {
2323
instance.removeFrameCallback(callback)
2424
}
2525
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobCollector.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal object BlobCollector {
1717
}
1818

1919
@JvmStatic
20-
public fun install(reactContext: ReactContext, blobModule: BlobModule) {
20+
fun install(reactContext: ReactContext, blobModule: BlobModule) {
2121
reactContext.runOnJSQueueThread {
2222
val jsContext: JavaScriptContextHolder? = reactContext.getJavaScriptContextHolder()
2323
// When debugging in chrome the JS context is not available.

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/image/ImageLoaderModule.kt

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis
9191
this.imagePipeline.fetchDecodedImage(request, this.callerContext)
9292
val dataSubscriber: DataSubscriber<CloseableReference<CloseableImage>> =
9393
object : BaseDataSubscriber<CloseableReference<CloseableImage>>() {
94-
protected override fun onNewResultImpl(
95-
dataSource: DataSource<CloseableReference<CloseableImage>>
96-
) {
94+
override fun onNewResultImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {
9795
if (!dataSource.isFinished) {
9896
return
9997
}
@@ -115,9 +113,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis
115113
}
116114
}
117115

118-
protected override fun onFailureImpl(
119-
dataSource: DataSource<CloseableReference<CloseableImage>>
120-
) {
116+
override fun onFailureImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {
121117
promise.reject(ERROR_GET_SIZE_FAILURE, dataSource.failureCause)
122118
}
123119
}
@@ -151,9 +147,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis
151147
this.imagePipeline.fetchDecodedImage(request, this.callerContext)
152148
val dataSubscriber: DataSubscriber<CloseableReference<CloseableImage>> =
153149
object : BaseDataSubscriber<CloseableReference<CloseableImage>>() {
154-
protected override fun onNewResultImpl(
155-
dataSource: DataSource<CloseableReference<CloseableImage>>
156-
) {
150+
override fun onNewResultImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {
157151
if (!dataSource.isFinished) {
158152
return
159153
}
@@ -175,9 +169,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis
175169
}
176170
}
177171

178-
protected override fun onFailureImpl(
179-
dataSource: DataSource<CloseableReference<CloseableImage>>
180-
) {
172+
override fun onFailureImpl(dataSource: DataSource<CloseableReference<CloseableImage>>) {
181173
promise.reject(ERROR_GET_SIZE_FAILURE, dataSource.failureCause)
182174
}
183175
}
@@ -208,7 +200,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis
208200
this.imagePipeline.prefetchToDiskCache(request, this.callerContext)
209201
val prefetchSubscriber =
210202
object : BaseDataSubscriber<Void?>() {
211-
protected override fun onNewResultImpl(dataSource: DataSource<Void?>) {
203+
override fun onNewResultImpl(dataSource: DataSource<Void?>) {
212204
if (!dataSource.isFinished) {
213205
return
214206
}
@@ -222,7 +214,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis
222214
}
223215
}
224216

225-
protected override fun onFailureImpl(dataSource: DataSource<Void?>) {
217+
override fun onFailureImpl(dataSource: DataSource<Void?>) {
226218
try {
227219
removeRequest(requestId)
228220
promise.reject(ERROR_PREFETCH_FAILURE, dataSource.failureCause)
@@ -245,7 +237,7 @@ public class ImageLoaderModule : NativeImageLoaderAndroidSpec, LifecycleEventLis
245237
// perform cache interrogation in async task as disk cache checks are expensive
246238
@Suppress("DEPRECATION", "StaticFieldLeak")
247239
object : GuardedAsyncTask<Void, Void>(getReactApplicationContext()) {
248-
protected override fun doInBackgroundGuarded(vararg params: Void) {
240+
override fun doInBackgroundGuarded(vararg params: Void) {
249241
val result: WritableMap = Arguments.createMap()
250242
val imagePipeline: ImagePipeline = this@ImageLoaderModule.imagePipeline
251243
for (i in 0 until uris.size()) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class PermissionsModule(reactContext: ReactApplicationContext?) :
7878
callbacks.put(
7979
requestCode,
8080
object : Callback {
81-
public override operator fun invoke(vararg args: Any?) {
81+
override operator fun invoke(vararg args: Any?) {
8282
val results = args[0] as IntArray
8383
if (results.size > 0 && results[0] == PackageManager.PERMISSION_GRANTED) {
8484
promise.resolve(GRANTED)
@@ -125,7 +125,7 @@ public class PermissionsModule(reactContext: ReactApplicationContext?) :
125125
callbacks.put(
126126
requestCode,
127127
object : Callback {
128-
public override operator fun invoke(vararg args: Any?) {
128+
override operator fun invoke(vararg args: Any?) {
129129
val results = args[0] as IntArray
130130
val callbackActivity = args[1] as PermissionAwareActivity
131131
for (j in permissionsToCheck.indices) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ComponentNameResolverBinding.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ internal object ComponentNameResolverBinding {
1818
SoLoader.loadLibrary("uimanagerjni")
1919
}
2020

21-
@JvmStatic
22-
public external fun install(runtimeExecutor: RuntimeExecutor, componentNameResolver: Any)
21+
@JvmStatic external fun install(runtimeExecutor: RuntimeExecutor, componentNameResolver: Any)
2322
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/FilterHelper.kt

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import kotlin.math.sin
2525
internal object FilterHelper {
2626

2727
@JvmStatic
28-
public fun parseFilters(filters: ReadableArray?): RenderEffect? {
28+
fun parseFilters(filters: ReadableArray?): RenderEffect? {
2929
filters ?: return null
3030
var chainedEffects: RenderEffect? = null
3131
for (i in 0 until filters.size()) {
@@ -53,7 +53,7 @@ internal object FilterHelper {
5353
}
5454

5555
@JvmStatic
56-
public fun parseColorMatrixFilters(filters: ReadableArray?): ColorMatrixColorFilter? {
56+
fun parseColorMatrixFilters(filters: ReadableArray?): ColorMatrixColorFilter? {
5757
filters ?: return null
5858
// New ColorMatrix objects represent the identity matrix
5959
val resultColorMatrix = ColorMatrix()
@@ -82,7 +82,7 @@ internal object FilterHelper {
8282
}
8383

8484
@JvmStatic
85-
public fun isOnlyColorMatrixFilters(filters: ReadableArray?): Boolean {
85+
fun isOnlyColorMatrixFilters(filters: ReadableArray?): Boolean {
8686
if (filters == null || filters.size() == 0) {
8787
return false
8888
}
@@ -98,7 +98,7 @@ internal object FilterHelper {
9898
}
9999

100100
// https://www.w3.org/TR/filter-effects-1/#blurEquivalent
101-
public fun createBlurEffect(sigma: Float, chainedEffects: RenderEffect? = null): RenderEffect? {
101+
fun createBlurEffect(sigma: Float, chainedEffects: RenderEffect? = null): RenderEffect? {
102102
if (sigma <= 0.5) {
103103
return null
104104
}
@@ -112,10 +112,7 @@ internal object FilterHelper {
112112
}
113113

114114
// https://www.w3.org/TR/filter-effects-1/#brightnessEquivalent
115-
public fun createBrightnessEffect(
116-
amount: Float,
117-
chainedEffects: RenderEffect? = null
118-
): RenderEffect {
115+
fun createBrightnessEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
119116
return createColorMatrixEffect(createBrightnessColorMatrix(amount), chainedEffects)
120117
}
121118

@@ -126,15 +123,12 @@ internal object FilterHelper {
126123
}
127124

128125
// https://www.w3.org/TR/filter-effects-1/#opacityEquivalent
129-
public fun createOpacityEffect(
130-
amount: Float,
131-
chainedEffects: RenderEffect? = null
132-
): RenderEffect {
126+
fun createOpacityEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
133127
return createColorMatrixEffect(createOpacityColorMatrix(amount), chainedEffects)
134128
}
135129

136130
// https://www.w3.org/TR/filter-effects-1/#dropshadowEquivalent
137-
public fun createDropShadowEffect(
131+
fun createDropShadowEffect(
138132
offsetX: Float,
139133
offsetY: Float,
140134
blurRadius: Float,
@@ -176,7 +170,7 @@ internal object FilterHelper {
176170
return RenderEffect.createBlendModeEffect(blurEffect, identity, BlendMode.SRC_OVER)
177171
}
178172

179-
public fun parseAndCreateDropShadowEffect(
173+
fun parseAndCreateDropShadowEffect(
180174
filterValues: ReadableMap,
181175
chainedEffects: RenderEffect? = null
182176
): RenderEffect {
@@ -191,17 +185,14 @@ internal object FilterHelper {
191185
return createDropShadowEffect(offsetX, offsetY, radius, color, chainedEffects)
192186
}
193187

194-
public fun createOpacityColorMatrix(amount: Float): ColorMatrix {
188+
fun createOpacityColorMatrix(amount: Float): ColorMatrix {
195189
val matrix = ColorMatrix()
196190
matrix.setScale(1f, 1f, 1f, amount)
197191
return matrix
198192
}
199193

200194
// https://www.w3.org/TR/filter-effects-1/#contrastEquivalent
201-
public fun createContrastEffect(
202-
amount: Float,
203-
chainedEffects: RenderEffect? = null
204-
): RenderEffect {
195+
fun createContrastEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
205196
return createColorMatrixEffect(createContrastColorMatrix(amount), chainedEffects)
206197
}
207198

@@ -234,10 +225,7 @@ internal object FilterHelper {
234225
}
235226

236227
// https://www.w3.org/TR/filter-effects-1/#grayscaleEquivalent
237-
public fun createGrayscaleEffect(
238-
amount: Float,
239-
chainedEffects: RenderEffect? = null
240-
): RenderEffect {
228+
fun createGrayscaleEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
241229
return createColorMatrixEffect(createGrayscaleColorMatrix(amount), chainedEffects)
242230
}
243231

@@ -268,7 +256,7 @@ internal object FilterHelper {
268256
}
269257

270258
// https://www.w3.org/TR/filter-effects-1/#sepiaEquivalent
271-
public fun createSepiaEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
259+
fun createSepiaEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
272260
return createColorMatrixEffect(createSepiaColorMatrix(amount), chainedEffects)
273261
}
274262

@@ -299,10 +287,7 @@ internal object FilterHelper {
299287
}
300288

301289
// https://www.w3.org/TR/filter-effects-1/#saturateEquivalent
302-
public fun createSaturateEffect(
303-
amount: Float,
304-
chainedEffects: RenderEffect? = null
305-
): RenderEffect {
290+
fun createSaturateEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
306291
return createColorMatrixEffect(createSaturateColorMatrix(amount), chainedEffects)
307292
}
308293

@@ -313,10 +298,7 @@ internal object FilterHelper {
313298
}
314299

315300
// https://www.w3.org/TR/filter-effects-1/#huerotateEquivalent
316-
public fun createHueRotateEffect(
317-
amount: Float,
318-
chainedEffects: RenderEffect? = null
319-
): RenderEffect {
301+
fun createHueRotateEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
320302
return createColorMatrixEffect(createHueRotateColorMatrix(amount), chainedEffects)
321303
}
322304

@@ -349,7 +331,7 @@ internal object FilterHelper {
349331
}
350332

351333
// https://www.w3.org/TR/filter-effects-1/#invertEquivalent
352-
public fun createInvertEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
334+
fun createInvertEffect(amount: Float, chainedEffects: RenderEffect? = null): RenderEffect {
353335
return createColorMatrixEffect(createInvertColorMatrix(amount), chainedEffects)
354336
}
355337

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIConstantsProviderBinding.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ internal object UIConstantsProviderBinding {
2020
}
2121

2222
@JvmStatic
23-
public external fun install(
23+
external fun install(
2424
runtimeExecutor: RuntimeExecutor,
2525
defaultEventTypesProvider: DefaultEventTypesProvider,
2626
viewManagerConstantsProvider: ConstantsForViewManagerProvider,
2727
constantsProvider: ConstantsProvider
2828
)
2929

3030
@DoNotStripAny
31-
public interface DefaultEventTypesProvider {
31+
interface DefaultEventTypesProvider {
3232
/* Returns UIManager's constants. */
33-
public fun getDefaultEventTypes(): NativeMap
33+
fun getDefaultEventTypes(): NativeMap
3434
}
3535

3636
@DoNotStripAny
37-
public interface ConstantsForViewManagerProvider {
37+
interface ConstantsForViewManagerProvider {
3838
/* Returns UIManager's constants. */
39-
public fun getConstantsForViewManager(viewManagerName: String): NativeMap?
39+
fun getConstantsForViewManager(viewManagerName: String): NativeMap?
4040
}
4141

4242
@DoNotStripAny
43-
public interface ConstantsProvider {
43+
interface ConstantsProvider {
4444
/* Returns UIManager's constants. */
45-
public fun getConstants(): NativeMap
45+
fun getConstants(): NativeMap
4646
}
4747
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,15 @@ public open class FabricEventDispatcher(reactContext: ReactApplicationContext) :
201201
}
202202
}
203203

204-
public fun stop() {
204+
fun stop() {
205205
shouldStop = true
206206
}
207207

208-
public fun resume() {
208+
fun resume() {
209209
shouldStop = false
210210
}
211211

212-
public fun maybeDispatchBatchedEvents() {
212+
fun maybeDispatchBatchedEvents() {
213213
if (!isFrameCallbackDispatchScheduled) {
214214
isFrameCallbackDispatchScheduled = true
215215
dispatchBatchedEvents()
@@ -221,7 +221,7 @@ public open class FabricEventDispatcher(reactContext: ReactApplicationContext) :
221221
.postFrameCallback(ReactChoreographer.CallbackType.TIMERS_EVENTS, currentFrameCallback)
222222
}
223223

224-
public fun maybeScheduleDispatchOfBatchedEvents() {
224+
fun maybeScheduleDispatchOfBatchedEvents() {
225225
if (isFrameCallbackDispatchScheduled) {
226226
return
227227
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/layoutanimation/AnimatedPropertyType.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal enum class AnimatedPropertyType {
1919

2020
companion object {
2121
@JvmStatic
22-
public fun fromString(name: String): AnimatedPropertyType {
22+
fun fromString(name: String): AnimatedPropertyType {
2323
return when (name) {
2424
"opacity" -> OPACITY
2525
"scaleX" -> SCALE_X

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderColors.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal value class BorderColors(
2525
@ColorInt val edgeColors: Array<Int?> = arrayOfNulls<Int?>(LogicalEdge.values().size)
2626
) {
2727

28-
public fun resolve(layoutDirection: Int, context: Context): ColorEdges {
28+
fun resolve(layoutDirection: Int, context: Context): ColorEdges {
2929
return when (layoutDirection) {
3030
LayoutDirection.LTR ->
3131
ColorEdges(

0 commit comments

Comments
 (0)