Loading core/java/android/net/http/SslCertificate.java +14 −4 Original line number Diff line number Diff line Loading @@ -128,8 +128,8 @@ public class SslCertificate { String issuedTo, String issuedBy, Date validNotBefore, Date validNotAfter) { mIssuedTo = new DName(issuedTo); mIssuedBy = new DName(issuedBy); mValidNotBefore = validNotBefore; mValidNotAfter = validNotAfter; mValidNotBefore = cloneDate(validNotBefore); mValidNotAfter = cloneDate(validNotAfter); } /** Loading @@ -148,7 +148,7 @@ public class SslCertificate { * "" if none has been set */ public Date getValidNotBeforeDate() { return mValidNotBefore; return cloneDate(mValidNotBefore); } /** Loading @@ -166,7 +166,7 @@ public class SslCertificate { * "" if none has been set */ public Date getValidNotAfterDate() { return mValidNotAfter; return cloneDate(mValidNotAfter); } /** Loading Loading @@ -223,6 +223,16 @@ public class SslCertificate { return new SimpleDateFormat(ISO_8601_DATE_FORMAT).format(date); } /** * Clone a possibly null Date */ private static Date cloneDate(Date date) { if (date == null) { return null; } return (Date) date.clone(); } /** * A distinguished name helper class: a 3-tuple of: * - common name (CN), Loading Loading
core/java/android/net/http/SslCertificate.java +14 −4 Original line number Diff line number Diff line Loading @@ -128,8 +128,8 @@ public class SslCertificate { String issuedTo, String issuedBy, Date validNotBefore, Date validNotAfter) { mIssuedTo = new DName(issuedTo); mIssuedBy = new DName(issuedBy); mValidNotBefore = validNotBefore; mValidNotAfter = validNotAfter; mValidNotBefore = cloneDate(validNotBefore); mValidNotAfter = cloneDate(validNotAfter); } /** Loading @@ -148,7 +148,7 @@ public class SslCertificate { * "" if none has been set */ public Date getValidNotBeforeDate() { return mValidNotBefore; return cloneDate(mValidNotBefore); } /** Loading @@ -166,7 +166,7 @@ public class SslCertificate { * "" if none has been set */ public Date getValidNotAfterDate() { return mValidNotAfter; return cloneDate(mValidNotAfter); } /** Loading Loading @@ -223,6 +223,16 @@ public class SslCertificate { return new SimpleDateFormat(ISO_8601_DATE_FORMAT).format(date); } /** * Clone a possibly null Date */ private static Date cloneDate(Date date) { if (date == null) { return null; } return (Date) date.clone(); } /** * A distinguished name helper class: a 3-tuple of: * - common name (CN), Loading