Skip to content

Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java #50359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -90,6 +90,7 @@ public class SurfaceMountingManager {
private final Set<Integer> mViewsToDeleteAfterTouchFinishes = new HashSet<>();

// This is null *until* StopSurface is called.
// NULLSAFE_FIXME[Field Not Initialized]
private SparseArrayCompat<Object> mTagSetForStoppedSurface;

private final int mSurfaceId;
Expand Down Expand Up @@ -315,9 +316,13 @@ public void stopSurface() {

// Evict all views from cache and memory
// TODO: clear instead of nulling out to simplify null-safety in this class
// NULLSAFE_FIXME[Field Not Nullable]
mTagToViewState = null;
// NULLSAFE_FIXME[Field Not Nullable]
mJSResponderHandler = null;
// NULLSAFE_FIXME[Field Not Nullable]
mRootViewManager = null;
// NULLSAFE_FIXME[Field Not Nullable]
mMountItemExecutor = null;
mThemedReactContext = null;
mOnViewAttachMountItems.clear();
Expand Down Expand Up @@ -659,6 +664,7 @@ public void createViewUnsafe(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
"SurfaceMountingManager::createViewUnsafe(" + componentName + ")");
try {
// NULLSAFE_FIXME[Parameter Not Nullable]
ReactStylesDiffMap propMap = new ReactStylesDiffMap(props);

ViewState viewState = new ViewState(reactTag);
Expand All @@ -672,6 +678,7 @@ public void createViewUnsafe(
// View Managers are responsible for dealing with inital state and props.
viewState.mView =
viewManager.createView(
// NULLSAFE_FIXME[Parameter Not Nullable]
reactTag, mThemedReactContext, propMap, stateWrapper, mJSResponderHandler);
viewState.mViewManager = viewManager;
}
Expand Down Expand Up @@ -930,8 +937,10 @@ public void updateState(final int reactTag, @Nullable StateWrapper stateWrapper)
throw new IllegalStateException("Unable to find ViewManager for tag: " + reactTag);
}
Object extraData =
// NULLSAFE_FIXME[Parameter Not Nullable]
viewManager.updateState(viewState.mView, viewState.mCurrentProps, stateWrapper);
if (extraData != null) {
// NULLSAFE_FIXME[Parameter Not Nullable]
viewManager.updateExtraData(viewState.mView, extraData);
}

Expand Down Expand Up @@ -1026,6 +1035,7 @@ private void onViewStateDeleted(ViewState viewState) {
// For non-root views we notify viewmanager with {@link ViewManager#onDropInstance}
ViewManager viewManager = viewState.mViewManager;
if (!viewState.mIsRoot && viewManager != null) {
// NULLSAFE_FIXME[Parameter Not Nullable]
viewManager.onDropViewInstance(viewState.mView);
}
}
Expand Down
Loading