From 847c0f704be9f45f9c40358dfbaeb2a38f285ff9 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Tue, 7 Nov 2023 07:21:23 +0000 Subject: [PATCH] Fix ImmutableEnum lint (flutter/engine#47739) This was introduced in https://github.com/flutter/engine/pull/47315. Internally, this lint breaks the build with the following error: ``` shell/platform/android/io/flutter/embedding/android/KeyData.java:78: Error: DeviceType is an enum, which should be immutable, but field DeviceType.value is not final [ImmutableEnum] private long value; ~~~~~~~~~~~~~~~~~~~ ``` See also https://errorprone.info/bugpattern/ImmutableEnumChecker. Fixes: b/309552840 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../platform/android/io/flutter/embedding/android/KeyData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/KeyData.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/KeyData.java index 776372c801..ef3b8eb6d8 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/KeyData.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/KeyData.java @@ -75,7 +75,7 @@ public class KeyData { kJoystick(3), kHdmi(4); - private long value; + private final long value; private DeviceType(long value) { this.value = value;