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

Commit c3bedfb1 authored by Pavel Grafov's avatar Pavel Grafov
Browse files

Remove useless generic argument and unchecked cast

There is no need for <V> generic parameter - it is not used in either
arguments or result.
The cast is unchecked and in fact uses a wrong type - PolicyDefinitions
are never prarametrized by PolicyValue.

Test: TH
Flag: EXEMPT - the code should result in the same binary
Bug: 335663055
Change-Id: Ia2254808107383a1b8549d0c2d55bf59878b507d
parent 187ee73b
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -705,17 +705,15 @@ final class PolicyDefinition<V> {
    }

    @Nullable
    static <V> PolicyKey readPolicyKeyFromXml(TypedXmlPullParser parser)
    static PolicyKey readPolicyKeyFromXml(TypedXmlPullParser parser)
            throws XmlPullParserException, IOException {
        // TODO: can we avoid casting?
        PolicyKey policyKey = PolicyKey.readGenericPolicyKeyFromXml(parser);
        if (policyKey == null) {
            Slogf.wtf(TAG, "Error parsing PolicyKey, GenericPolicyKey is null");
            return null;
        }
        PolicyDefinition<PolicyValue<V>> genericPolicyDefinition =
                (PolicyDefinition<PolicyValue<V>>) POLICY_DEFINITIONS.get(
                        policyKey.getIdentifier());
        PolicyDefinition<?> genericPolicyDefinition =
                POLICY_DEFINITIONS.get(policyKey.getIdentifier());
        if (genericPolicyDefinition == null) {
            Slogf.wtf(TAG, "Error parsing PolicyKey, Unknown generic policy key: " + policyKey);
            return null;