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

Commit 5f6bcc17 authored by Steve Block's avatar Steve Block Committed by Android (Google) Code Review
Browse files

Merge "Remove some superfluous null-checks when constructing a CacheResult" into honeycomb

parents a270bd59 7a112151
Loading
Loading
Loading
Loading
+6 −11
Original line number Original line Diff line number Diff line
@@ -734,8 +734,7 @@ public final class CacheManager {
        CacheResult ret = new CacheResult();
        CacheResult ret = new CacheResult();
        ret.httpStatusCode = statusCode;
        ret.httpStatusCode = statusCode;


        String location = headers.getLocation();
        ret.location = headers.getLocation();
        if (location != null) ret.location = location;


        ret.expires = -1;
        ret.expires = -1;
        ret.expiresString = headers.getExpires();
        ret.expiresString = headers.getExpires();
@@ -754,15 +753,9 @@ public final class CacheManager {
            }
            }
        }
        }


        String contentDisposition = headers.getContentDisposition();
        ret.contentdisposition = headers.getContentDisposition();
        if (contentDisposition != null) {
            ret.contentdisposition = contentDisposition;
        }


        String crossDomain = headers.getXPermittedCrossDomainPolicies();
        ret.crossDomain = headers.getXPermittedCrossDomainPolicies();
        if (crossDomain != null) {
            ret.crossDomain = crossDomain;
        }


        // lastModified and etag may be set back to http header. So they can't
        // lastModified and etag may be set back to http header. So they can't
        // be empty string.
        // be empty string.
@@ -772,7 +765,9 @@ public final class CacheManager {
        }
        }


        String etag = headers.getEtag();
        String etag = headers.getEtag();
        if (etag != null && etag.length() > 0) ret.etag = etag;
        if (etag != null && etag.length() > 0) {
            ret.etag = etag;
        }


        String cacheControl = headers.getCacheControl();
        String cacheControl = headers.getCacheControl();
        if (cacheControl != null) {
        if (cacheControl != null) {