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 @@ -93,7 +93,6 @@
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.modules.core.ReactChoreographer;
import com.facebook.react.modules.debug.interfaces.DeveloperSettings;
import com.facebook.react.packagerconnection.RequestHandler;
import com.facebook.react.uimanager.DisplayMetricsHolder;
import com.facebook.react.uimanager.ReactRoot;
Expand Down Expand Up @@ -194,7 +193,7 @@ public interface ReactInstanceEventListener
private boolean mUseFallbackBundle = true;
private volatile boolean mInstanceManagerInvalidated = false;

private class ReactContextInitParams {
private static class ReactContextInitParams {
private final JavaScriptExecutorFactory mJsExecutorFactory;
private final JSBundleLoader mJsBundleLoader;

Expand Down Expand Up @@ -301,14 +300,11 @@ public static ReactInstanceManagerBuilder builder() {
mDevSupportManager.startInspector();
}

// Using `if (true)` just to prevent tests / lint errors.
if (true) {
// Legacy architecture of React Native is deprecated and can't be initialized anymore.
// More details on:
// https://github.com/react-native-community/discussions-and-proposals/blob/nc/legacy-arch-removal/proposals/0929-legacy-architecture-removal.md
throw new UnsupportedOperationException(
"ReactInstanceManager.createReactContext is unsupported.");
}
// Legacy architecture of React Native is deprecated and can't be initialized anymore.
// More details on:
// https://github.com/react-native-community/discussions-and-proposals/blob/nc/legacy-arch-removal/proposals/0929-legacy-architecture-removal.md
throw new UnsupportedOperationException(
"ReactInstanceManager.createReactContext is unsupported.");
}

private ReactInstanceDevHelper createDevHelperInterface() {
Expand Down Expand Up @@ -450,7 +446,6 @@ private void recreateReactContextInBackgroundInner() {
UiThreadUtil.assertOnUiThread();

if (mUseDeveloperSupport && mJSMainModulePath != null) {
final DeveloperSettings devSettings = mDevSupportManager.getDevSettings();
if (!Systrace.isTracing(TRACE_TAG_REACT)) {
if (mBundleLoader == null) {
mDevSupportManager.handleReloadJS();
Expand Down Expand Up @@ -1164,6 +1159,7 @@ private void runCreateReactContextOnNewThread(final ReactContextInitParams initP
try {
ReactInstanceManager.this.mHasStartedDestroying.wait();
} catch (InterruptedException e) {
// Interrupted while waiting for destruction to complete, just retry
continue;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,13 @@ public class ReactInstanceManagerBuilder {
}

private companion object {
private val TAG: String = ReactInstanceManagerBuilder::class.java.simpleName

init {
LegacyArchitectureLogger.assertLegacyArchitecture(
"ReactInstanceManagerBuilder",
LegacyArchitectureLogLevel.ERROR,
)
}

private val TAG: String = ReactInstanceManagerBuilder::class.java.simpleName
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ internal abstract class AnimationDriver {
* start animating with the new properties (different destination or spring settings)
*/
open fun resetConfig(config: ReadableMap) {
throw JSApplicationCausedNativeException(
"Animation config for ${javaClass.simpleName} cannot be reset"
)
throw JSApplicationCausedNativeException("Animation config for AnimationDriver cannot be reset")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public void destroy() {
if (mFabricUIManager != null) {
mFabricUIManager.invalidate();
}
boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);
mPendingJSCalls.getAndSet(0);

getReactQueueConfiguration()
.getJSQueueThread()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ internal class JavaMethodWrapper(
private var arguments: Array<Any?>? = null
private var jsArgumentsNeeded = 0

val signature: String?
get() {
if (!argumentsProcessed) {
processArguments()
}
return checkNotNull(internalSignature)
}

init {
method.isAccessible = true
parameterTypes = method.parameterTypes
Expand Down Expand Up @@ -86,14 +94,6 @@ internal class JavaMethodWrapper(
}
}

val signature: String?
get() {
if (!argumentsProcessed) {
processArguments()
}
return checkNotNull(internalSignature)
}

private fun buildSignature(method: Method, paramTypes: Array<Class<*>>, isSync: Boolean): String =
buildString(paramTypes.size + 2) {
if (isSync) {
Expand Down Expand Up @@ -249,13 +249,6 @@ internal class JavaMethodWrapper(
}

companion object {
init {
LegacyArchitectureLogger.assertLegacyArchitecture(
"JavaMethodWrapper",
LegacyArchitectureLogLevel.ERROR,
)
}

private val ARGUMENT_EXTRACTOR_BOOLEAN: ArgumentExtractor<Boolean> =
object : ArgumentExtractor<Boolean>() {
@Suppress("DEPRECATION")
Expand Down Expand Up @@ -388,6 +381,13 @@ internal class JavaMethodWrapper(
private val DEBUG =
PrinterHolder.printer.shouldDisplayLogMessage(ReactDebugOverlayTags.BRIDGE_CALLS)

init {
LegacyArchitectureLogger.assertLegacyArchitecture(
"JavaMethodWrapper",
LegacyArchitectureLogLevel.ERROR,
)
}

private fun paramTypeToChar(paramClass: Class<*>): Char {
val tryCommon = commonTypeToChar(paramClass)
if (tryCommon != '\u0000') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,15 @@ public class JavaOnlyMap() : ReadableMap, WritableMap {
override fun toString(): String = backingMap.toString()

override fun equals(other: Any?): Boolean {
return if (this === other) {
true
} else if (other == null || javaClass != other.javaClass) {
false
} else {
backingMap == (other as JavaOnlyMap).backingMap
if (this === other) {
return true
}
if (other !is JavaOnlyMap) {
return false
}
val thisBackingMap = backingMap
val otherBackingMap = other.backingMap
return thisBackingMap == otherBackingMap
}

override fun hashCode(): Int = backingMap.hashCode()
Expand Down
Loading