Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fca73bca authored by Jared Duke's avatar Jared Duke
Browse files

Mark FeatureFlags impl member as final

Marking the member as final for non-test scenarios allows for
optimizations that may otherwise be unavailable, and avoids ambiguity
about mutability.

Bug: 280833463
Test: atest aconfig.test
Change-Id: Ia58a04c9a57ee06d68f4dd022ace5365c65f4cf5
parent b9511617
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -473,7 +473,7 @@ mod tests {
                .unwrap();
        let expect_flags_content = EXPECTED_FLAG_COMMON_CONTENT.to_string()
            + r#"
            private static FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
            private static final FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
        }"#;

        let expect_featureflagsimpl_content = r#"
@@ -661,7 +661,7 @@ mod tests {
            public static boolean enabledRoExported() {
                return FEATURE_FLAGS.enabledRoExported();
            }
            private static FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
            private static final FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
        }
        "#;

@@ -1083,7 +1083,7 @@ mod tests {
            public static boolean enabledRw() {
                return FEATURE_FLAGS.enabledRw();
            }
            private static FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
            private static final FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
        }"#;

        let expect_customfeatureflags_content = r#"
+5 −2
Original line number Diff line number Diff line
@@ -33,8 +33,11 @@ public final class Flags \{
    public static void unsetFeatureFlags() \{
        Flags.FEATURE_FLAGS = null;
    }
{{ -endif }}

    private static FeatureFlags FEATURE_FLAGS{{ -if not is_test_mode }} = new FeatureFlagsImpl(){{ -endif- }};
    private static FeatureFlags FEATURE_FLAGS;
{{ -else }}

    private static final FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
{{ -endif }}

}