Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class NativeModuleRegistryBuilder(
public constructor(
reactApplicationContext: ReactApplicationContext,
@Suppress("UNUSED_PARAMETER") reactInstanceManager: ReactInstanceManager
) : this(reactApplicationContext) {}
) : this(reactApplicationContext)

public fun processPackage(reactPackage: ReactPackage) {
// We use an iterable instead of an iterator here to ensure thread safety, and that this list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import android.os.Looper
import android.os.Message

/** Handler that can catch and dispatch Exceptions to an Exception handler. */
internal class MessageQueueThreadHandler
constructor(looper: Looper, private val exceptionHandler: QueueThreadExceptionHandler) :
internal class MessageQueueThreadHandler(looper: Looper, private val exceptionHandler: QueueThreadExceptionHandler) :
Handler(looper) {
override fun dispatchMessage(msg: Message) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import com.facebook.react.module.annotations.ReactModule
@ReactModule(name = NativeLogBoxSpec.NAME)
internal class LogBoxModule(
reactContext: ReactApplicationContext?,
private val devSupportManager: DevSupportManager
devSupportManager: DevSupportManager
) : NativeLogBoxSpec(reactContext) {
private val surfaceDelegate: SurfaceDelegate =
devSupportManager.createSurfaceDelegate(NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import java.io.IOException
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors

public final class BlobProvider : ContentProvider() {
public class BlobProvider : ContentProvider() {
private val executor: ExecutorService = Executors.newSingleThreadExecutor()

override fun onCreate(): Boolean = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import okhttp3.CacheControl
import okhttp3.OkHttpClient
import okhttp3.Request

internal class ReactOkHttpNetworkFetcher(private val okHttpClient: OkHttpClient) :
internal class ReactOkHttpNetworkFetcher(okHttpClient: OkHttpClient) :
OkHttpNetworkFetcher(okHttpClient) {
private fun getHeaders(readableMap: ReadableMap?): Map<String, String>? {
if (readableMap == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import java.net.URI
public class ForwardingCookieHandler() : CookieHandler() {

@Deprecated("Use the default constructor", ReplaceWith("ForwardingCookieHandler()"))
public constructor(@Suppress("UNUSED_PARAMETER") reactContext: ReactContext) : this() {}
public constructor(@Suppress("UNUSED_PARAMETER") reactContext: ReactContext) : this()

@Throws(IOException::class)
override fun get(uri: URI, headers: Map<String, List<String>>): Map<String, List<String>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ public class NetworkingModule(
https://github.com/facebook/react-native/pull/37798#pullrequestreview-1518338914""")
public interface CustomClientBuilder : com.facebook.react.modules.network.CustomClientBuilder

override final fun initialize() {
override fun initialize() {
cookieJarContainer?.setCookieJar(JavaNetCookieJar(cookieHandler))
}

override final fun invalidate() {
override fun invalidate() {
shuttingDown = true
cancelAllRequests()

Expand Down Expand Up @@ -204,7 +204,7 @@ public class NetworkingModule(
responseHandlers.remove(handler)
}

override final fun sendRequest(
override fun sendRequest(
method: String,
url: String,
requestIdAsDouble: Double,
Expand Down Expand Up @@ -663,7 +663,7 @@ public class NetworkingModule(
requestIds.clear()
}

final override fun abortRequest(requestIdAsDouble: Double) {
override fun abortRequest(requestIdAsDouble: Double) {
val requestId = requestIdAsDouble.toInt()
cancelRequest(requestId)
removeRequest(requestId)
Expand All @@ -674,13 +674,13 @@ public class NetworkingModule(
}

@ReactMethod
public final override fun clearCookies(callback: com.facebook.react.bridge.Callback): Unit {
public override fun clearCookies(callback: com.facebook.react.bridge.Callback): Unit {
cookieHandler.clearCookies(callback)
}

public final override fun addListener(eventName: String?): Unit = Unit
public override fun addListener(eventName: String?): Unit = Unit

public final override fun removeListeners(count: Double): Unit = Unit
public override fun removeListeners(count: Double): Unit = Unit

private fun constructMultipartBody(
body: ReadableArray,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import java.io.Closeable
import java.util.concurrent.Executor

@DoNotStripAny
internal class ReactHostInspectorTarget(private val reactHostImpl: ReactHostImpl) : Closeable {
internal class ReactHostInspectorTarget(reactHostImpl: ReactHostImpl) : Closeable {
// fbjni looks for the exact name "mHybridData":
// https://github.com/facebookincubator/fbjni/blob/5587a7fd2b191656be9391a3832ce04c034009a5/cxx/fbjni/detail/Hybrid.h#L310
@Suppress("NoHungarianNotation")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package com.facebook.react.runtime.internal.bolts
* access to the consumer side through the getTask() method while isolating the Task's completion
* mechanisms from the consumer.
*/
internal class TaskCompletionSource<TResult>() {
internal class TaskCompletionSource<TResult> {

/** @return the Task associated with this TaskCompletionSource. */
val task: Task<TResult> = Task()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class OnLayoutEvent private constructor() : Event<OnLayoutEvent>() {

override fun getEventName(): String = "topLayout"

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
val layout =
Arguments.createMap().apply {
putDouble("x", toDIPFromPixel(x.toFloat()).toDouble())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public class Spacing(private val defaultValue: Float, private val spacing: Float
private var valueFlags = 0
private var hasAliasesSet = false

public constructor() : this(0f, newFullSpacingArray()) {}
public constructor() : this(0f, newFullSpacingArray())

public constructor(defaultValue: Float) : this(defaultValue, newFullSpacingArray()) {}
public constructor(defaultValue: Float) : this(defaultValue, newFullSpacingArray())

/**
* Copy constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal class DrawerClosedEvent : Event<DrawerClosedEvent> {

override fun getEventName(): String = EVENT_NAME

protected override fun getEventData(): WritableMap? = Arguments.createMap()
protected override fun getEventData(): WritableMap = Arguments.createMap()

companion object {
const val EVENT_NAME: String = "topDrawerClose"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal class DrawerOpenedEvent : Event<DrawerOpenedEvent> {

override fun getEventName(): String = EVENT_NAME

protected override fun getEventData(): WritableMap? = Arguments.createMap()
protected override fun getEventData(): WritableMap = Arguments.createMap()

companion object {
const val EVENT_NAME: String = "topDrawerOpen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal class DrawerSlideEvent : Event<DrawerSlideEvent> {

override fun getEventName(): String = EVENT_NAME

protected override fun getEventData(): WritableMap? {
protected override fun getEventData(): WritableMap {
val eventData: WritableMap = Arguments.createMap()
eventData.putDouble("offset", getOffset().toDouble())
return eventData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private constructor(
// enough to fit into short.
override fun getCoalescingKey(): Short = eventType.toShort()

override fun getEventData(): WritableMap? =
override fun getEventData(): WritableMap =
Arguments.createMap().apply {
when (eventType) {
ON_PROGRESS -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class ShowEvent(surfaceId: Int, viewTag: Int) : Event<ShowEvent>(surfac

override fun getEventName(): String = EVENT_NAME

override fun getEventData(): WritableMap? = Arguments.createMap()
override fun getEventData(): WritableMap = Arguments.createMap()

companion object {
const val EVENT_NAME: String = "topShow"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.facebook.react.viewmanagers.SafeAreaViewManagerInterface

/** View manager for [ReactSafeAreaView] components. */
@ReactModule(name = ReactSafeAreaViewManager.REACT_CLASS)
internal class ReactSafeAreaViewManager() :
internal class ReactSafeAreaViewManager :
ViewGroupManager<ReactSafeAreaView>(), SafeAreaViewManagerInterface<ReactSafeAreaView> {

private val delegate: ViewManagerDelegate<ReactSafeAreaView> = SafeAreaViewManagerDelegate(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ package com.facebook.react.views.safeareaview
import com.facebook.react.common.annotations.internal.LegacyArchitecture
import com.facebook.react.uimanager.LayoutShadowNode

@LegacyArchitecture internal class ReactSafeAreaViewShadowNode() : LayoutShadowNode() {}
@LegacyArchitecture internal class ReactSafeAreaViewShadowNode : LayoutShadowNode() {}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class RefreshEvent : Event<RefreshEvent> {
return "topRefresh"
}

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
return Arguments.createMap()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class ReactSwitchEvent(surfaceId: Int, viewId: Int, private val isCheck

override fun getEventName(): String = EVENT_NAME

public override fun getEventData(): WritableMap? =
public override fun getEventData(): WritableMap =
Arguments.createMap().apply {
putInt("target", viewTag)
putBoolean("value", isChecked)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal class ReactContentSizeChangedEvent(

override fun getEventName(): String = EVENT_NAME

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
val contentSize =
Arguments.createMap().apply {
putDouble("width", contentWidth.toDouble())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class ReactTextChangedEvent(

override fun getEventName(): String = EVENT_NAME

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
return Arguments.createMap().apply {
putString("text", text)
putInt("eventCount", eventCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal class ReactTextInputBlurEvent(surfaceId: Int, viewId: Int) :

override fun canCoalesce(): Boolean = false

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
return Arguments.createMap().apply { putInt("target", viewTag) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class ReactTextInputEndEditingEvent(

override fun canCoalesce(): Boolean = false

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
return Arguments.createMap().apply {
putInt("target", viewTag)
putString("text", text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class ReactTextInputFocusEvent(surfaceId: Int, viewId: Int) :

override fun getEventName(): String = EVENT_NAME

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
return Arguments.createMap().apply { putInt("target", viewTag) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class ReactTextInputKeyPressEvent(surfaceId: Int, viewId: Int, private

override fun getEventName(): String = EVENT_NAME

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
return Arguments.createMap().apply { putString("key", key) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class ReactTextInputSelectionEvent(

override fun getEventName(): String = EVENT_NAME

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
val selectionData =
Arguments.createMap().apply {
putInt("end", selectionEnd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal class ReactTextInputSubmitEditingEvent(

override fun getEventName(): String = EVENT_NAME

override fun getEventData(): WritableMap? {
override fun getEventData(): WritableMap {
return Arguments.createMap().apply {
putInt("target", viewTag)
putString("text", text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AbstractLayoutAnimationTest {
y: Int,
width: Int,
height: Int
): Animation? {
): Animation {
return mock()
}
}
Expand Down Expand Up @@ -102,7 +102,7 @@ class AbstractLayoutAnimationTest {
y: Int,
width: Int,
height: Int
): Animation? = mock()
): Animation = mock()
}

val result = invalidAnimation.createAnimation(view, 0, 0, 100, 100)
Expand All @@ -126,7 +126,7 @@ class AbstractLayoutAnimationTest {
y: Int,
width: Int,
height: Int
): Animation? = mock()
): Animation = mock()
}

val exception =
Expand Down
Loading