Skip to content

Fix SelfComparison lint error in NativeModuleRegistry.kt#55444

Closed
mdvacca wants to merge 7 commits intofacebook:mainfrom
mdvacca:export-D91797839
Closed

Fix SelfComparison lint error in NativeModuleRegistry.kt#55444
mdvacca wants to merge 7 commits intofacebook:mainfrom
mdvacca:export-D91797839

Conversation

@mdvacca
Copy link
Contributor

@mdvacca mdvacca commented Feb 6, 2026

Summary:
Fixed SelfComparison lint error by extracting the compared values into separate local variables, making it clearer to the linter that we're comparing two different instances.

The original code was comparing this.reactApplicationContext with newRegister.reactApplicationContext, but the linter incorrectly flagged it as a self-comparison due to the same property name.

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D91797839

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 6, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 6, 2026

@mdvacca has exported this pull request. If you are a Meta employee, you can view the originating Diff in D91797839.

Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

mdvacca added a commit to mdvacca/react-native that referenced this pull request Feb 7, 2026
)

Summary:
Pull Request resolved: facebook#55444

Fixed SelfComparison lint error by extracting the compared values into separate local variables, making it clearer to the linter that we're comparing two different instances.

The original code was comparing `this.reactApplicationContext` with `newRegister.reactApplicationContext`, but the linter incorrectly flagged it as a self-comparison due to the same property name.

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D91797839
Summary:
Fixed DoNotStripAnnotationUsage lint error in FabricUIManagerBinding.kt.

The class has many members (external methods like initHybrid, installFabricUIManager, etc.)
that need to be kept, so DoNotStripAny is more appropriate than DoNotStrip which only
keeps the directly annotated element.

changelog: [internal] internal

Differential Revision: D91840163
Summary:
Fixed ClownyBooleanExpression lint warning in FabricUIManager.java.

The expression `false && ReactBuildConfig.DEBUG` is intentionally used as a
development flag that can be easily toggled. The constant false ensures it's
disabled in production while making it clear how to enable it for development.

changelog: [internal] internal

Differential Revision: D91840560
Summary:
Fixed NotInvokedPrivateMethod lint warning for preallocateView in FabricUIManager.java.

This method is called from JNI/C++ code, not from Java, so the lint warning is
a false positive. Added SuppressLint annotation to suppress the warning.

changelog: [internal] internal

Differential Revision: D91840733
Summary:
Fixed JavadocsBackticksUse lint warning in FabricUIManager.java.

Replaced markdown-style backticks with proper javadoc {code ...} tags for
code references in the receiveEvent method documentation.

changelog: [internal] internal

Differential Revision: D91841151
…nteropUIBlockListener

Summary:
Fixed ClassNameDoesNotMatchFileName lint warning by renaming the file from
InteropUiBlockListener.kt to InteropUIBlockListener.kt to match the class name.

changelog: [internal] internal

Differential Revision: D91843967
Summary:
Fixed lint warnings in LongStreamingStats.kt:
- Replaced `size == 0` with `isEmpty()` for better readability
- Replaced `!!` operator with safe null handling using `?: 0L`

changelog: [internal] internal

Differential Revision: D91844147
)

Summary:
Pull Request resolved: facebook#55444

Fixed SelfComparison lint error by extracting the compared values into separate local variables, making it clearer to the linter that we're comparing two different instances.

The original code was comparing `this.reactApplicationContext` with `newRegister.reactApplicationContext`, but the linter incorrectly flagged it as a self-comparison due to the same property name.

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D91797839
@meta-codesync meta-codesync bot closed this in f412887 Feb 8, 2026
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 8, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 8, 2026

This pull request has been merged in f412887.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants