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

Commit cc0eaf41 authored by Tobias Thierer's avatar Tobias Thierer Committed by Android (Google) Code Review
Browse files

Merge "Avoid instantiations of Boolean that are immediately unboxed." into nyc-dev-plus-aosp

parents 7563a13b b0800dce
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -570,7 +570,7 @@ public class ZenModeConfig implements Parcelable {


    private static boolean safeBoolean(String val, boolean defValue) {
    private static boolean safeBoolean(String val, boolean defValue) {
        if (TextUtils.isEmpty(val)) return defValue;
        if (TextUtils.isEmpty(val)) return defValue;
        return Boolean.valueOf(val);
        return Boolean.parseBoolean(val);
    }
    }


    private static int safeInt(XmlPullParser parser, String att, int defValue) {
    private static int safeInt(XmlPullParser parser, String att, int defValue) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -135,7 +135,7 @@ public class VpnProfile implements Cloneable, Parcelable {
            profile.dnsServers = values[5];
            profile.dnsServers = values[5];
            profile.searchDomains = values[6];
            profile.searchDomains = values[6];
            profile.routes = values[7];
            profile.routes = values[7];
            profile.mppe = Boolean.valueOf(values[8]);
            profile.mppe = Boolean.parseBoolean(values[8]);
            profile.l2tpSecret = values[9];
            profile.l2tpSecret = values[9];
            profile.ipsecIdentifier = values[10];
            profile.ipsecIdentifier = values[10];
            profile.ipsecSecret = values[11];
            profile.ipsecSecret = values[11];
+1 −1
Original line number Original line Diff line number Diff line
@@ -1280,7 +1280,7 @@ public class XmlUtils {
            if (eventType == parser.START_TAG) {
            if (eventType == parser.START_TAG) {
                if (parser.getName().equals("item")) {
                if (parser.getName().equals("item")) {
                    try {
                    try {
                        array[i] = Boolean.valueOf(parser.getAttributeValue(null, "value"));
                        array[i] = Boolean.parseBoolean(parser.getAttributeValue(null, "value"));
                    } catch (NullPointerException e) {
                    } catch (NullPointerException e) {
                        throw new XmlPullParserException("Need value attribute in item");
                        throw new XmlPullParserException("Need value attribute in item");
                    } catch (NumberFormatException e) {
                    } catch (NumberFormatException e) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -1402,7 +1402,7 @@ final class ActivityRecord {
            } else if (ATTR_RESOLVEDTYPE.equals(attrName)) {
            } else if (ATTR_RESOLVEDTYPE.equals(attrName)) {
                resolvedType = attrValue;
                resolvedType = attrValue;
            } else if (ATTR_COMPONENTSPECIFIED.equals(attrName)) {
            } else if (ATTR_COMPONENTSPECIFIED.equals(attrName)) {
                componentSpecified = Boolean.valueOf(attrValue);
                componentSpecified = Boolean.parseBoolean(attrValue);
            } else if (ATTR_USERID.equals(attrName)) {
            } else if (ATTR_USERID.equals(attrName)) {
                userId = Integer.parseInt(attrValue);
                userId = Integer.parseInt(attrValue);
            } else if (attrName.startsWith(TaskDescription.ATTR_TASKDESCRIPTION_PREFIX)) {
            } else if (attrName.startsWith(TaskDescription.ATTR_TASKDESCRIPTION_PREFIX)) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -311,7 +311,7 @@ public class RankingHelper implements RankingConfig {


    private static boolean tryParseBool(String value, boolean defValue) {
    private static boolean tryParseBool(String value, boolean defValue) {
        if (TextUtils.isEmpty(value)) return defValue;
        if (TextUtils.isEmpty(value)) return defValue;
        return Boolean.valueOf(value);
        return Boolean.parseBoolean(value);
    }
    }


    /**
    /**
Loading