Skip to content

Commit fc9940d

Browse files
mdvaccameta-codesync[bot]
authored andcommitted
Fix FieldsBelowInit: Move property declarations before init block (#55513)
Summary: Pull Request resolved: #55513 Fixed FieldsBelowInit lint warning in SurfaceHandlerBinding.kt. Moved the property declarations (surfaceId, isRunning, moduleName) before the init block to follow Kotlin best practices for initialization order. Note: These are computed properties (getters) that call native methods, so the warning was technically a false positive, but reordering improves code clarity. changelog: [internal] internal Reviewed By: alanleedev, NickGerleman Differential Revision: D92024128 fbshipit-source-id: 8627edf02806d8767b72ed9adcbb15a5e2fca927
1 parent 47684ca commit fc9940d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/SurfaceHandlerBinding.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ import com.facebook.react.fabric.mounting.LayoutMetricsConversions
1313

1414
internal open class SurfaceHandlerBinding(moduleName: String) : HybridClassBase() {
1515

16-
init {
17-
initHybrid(NO_SURFACE_ID, moduleName)
18-
}
19-
20-
private external fun initHybrid(surfaceId: Int, moduleName: String)
21-
2216
val surfaceId: Int
2317
get() = _getSurfaceId()
2418

@@ -28,6 +22,12 @@ internal open class SurfaceHandlerBinding(moduleName: String) : HybridClassBase(
2822
val moduleName: String
2923
get() = _getModuleName()
3024

25+
init {
26+
initHybrid(NO_SURFACE_ID, moduleName)
27+
}
28+
29+
private external fun initHybrid(surfaceId: Int, moduleName: String)
30+
3131
private external fun _getSurfaceId(): Int
3232

3333
private external fun _getModuleName(): String

0 commit comments

Comments
 (0)