Skip to content

Commit e69faff

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Mark classes of package uimanager as @nullsafe (#43161)
Summary: Pull Request resolved: #43161 All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future changelog: [internal] internal bypass-github-export-checks Reviewed By: javache Differential Revision: D54027187 fbshipit-source-id: a25024ba7f7d4893a2b7d083e2ba10c5f2e3a035
1 parent 9f58b1a commit e69faff

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77

88
package com.facebook.react.uimanager;
99

10+
import com.facebook.infer.annotation.Nullsafe;
11+
1012
// Common conditionals:
1113
// - `kind == PARENT` checks whether the node can host children in the native tree.
1214
// - `kind != NONE` checks whether the node appears in the native tree.
1315

16+
@Nullsafe(Nullsafe.Mode.LOCAL)
1417
public enum NativeKind {
1518
// Node is in the native hierarchy and the HierarchyOptimizer should assume it can host children
1619
// (e.g. because it's a ViewGroup). Note that it's okay if the node doesn't support children. When

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77

88
package com.facebook.react.uimanager;
99

10+
import com.facebook.infer.annotation.Nullsafe;
11+
1012
/**
1113
* Exception thrown when a class tries to access a native view by a tag that has no native view
1214
* associated with it.
1315
*/
16+
@Nullsafe(Nullsafe.Mode.LOCAL)
1417
class NoSuchNativeViewException extends IllegalViewOperationException {
1518

1619
public NoSuchNativeViewException(String detailMessage) {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99

1010
import androidx.annotation.Nullable;
1111
import androidx.core.util.Pools;
12+
import com.facebook.infer.annotation.Nullsafe;
1213
import com.facebook.react.bridge.Arguments;
1314
import com.facebook.react.bridge.WritableMap;
1415
import com.facebook.react.uimanager.events.Event;
1516

1617
/** Event used to notify JS component about changes of its position or dimensions */
18+
@Nullsafe(Nullsafe.Mode.LOCAL)
1719
public class OnLayoutEvent extends Event<OnLayoutEvent> {
1820

1921
private static final Pools.SynchronizedPool<OnLayoutEvent> EVENTS_POOL =

0 commit comments

Comments
 (0)