Skip to content

Commit 9f3ae8b

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Fix EmptyCatchBlock: Add comment for InterruptedException handling
Summary: Fixed EmptyCatchBlock lint error in BridgelessAtomicRef.kt. Added a comment explaining that the InterruptedException is intentionally caught to record the interrupt status, which is then restored after the wait loop completes. This is a standard pattern for proper interrupt handling. changelog: [internal] internal Reviewed By: alanleedev Differential Revision: D91728772
1 parent 954589d commit 9f3ae8b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessAtomicRef.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ internal class BridgelessAtomicRef<T>(
7878
try {
7979
(this as Object).wait()
8080
} catch (ex: InterruptedException) {
81+
// Record the interrupt to restore it after the wait loop completes.
82+
// We continue waiting because we need the object to be created.
8183
wasInterrupted = true
8284
}
8385
}

0 commit comments

Comments
 (0)