You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mark private static fields as final in ReactHorizontalScrollView (#54343)
Summary:
Pull Request resolved: #54343
Fixed NotWrittenPrivateField lint warnings in ReactHorizontalScrollView.java by marking three private static fields as final:
- DEBUG_MODE: Changed from `private static boolean` to `private static final boolean`
- TAG: Changed from `private static String` to `private static final String`
- NO_SCROLL_POSITION: Changed from `private static int` to `private static final int`
These fields are initialized once and never modified, making them compile-time constants. Marking them as final follows Java best practices and prevents potential issues with Redex code optimization.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D85904890
fbshipit-source-id: f83a19392a2418d8415936421f1e021316643056
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -83,10 +83,10 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
0 commit comments