mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-13 06:38:05 -05:00
replaced unnecessary explicit iterator use with for-each loop
This commit is contained in:
parent
8ac942d828
commit
e8d3553b2c
@ -157,11 +157,9 @@ public class DomainNameChecker {
|
|||||||
private static boolean matchDns(X509Certificate certificate, String thisDomain) {
|
private static boolean matchDns(X509Certificate certificate, String thisDomain) {
|
||||||
boolean hasDns = false;
|
boolean hasDns = false;
|
||||||
try {
|
try {
|
||||||
Collection<?> subjectAltNames = certificate.getSubjectAlternativeNames();
|
Collection<List<?>> subjectAltNames = certificate.getSubjectAlternativeNames();
|
||||||
if (subjectAltNames != null) {
|
if (subjectAltNames != null) {
|
||||||
Iterator<?> i = subjectAltNames.iterator();
|
for (List<?> altNameEntry : subjectAltNames) {
|
||||||
while (i.hasNext()) {
|
|
||||||
List<?> altNameEntry = (List<?>)(i.next());
|
|
||||||
if ((altNameEntry != null) && (2 <= altNameEntry.size())) {
|
if ((altNameEntry != null) && (2 <= altNameEntry.size())) {
|
||||||
Integer altNameType = (Integer)(altNameEntry.get(0));
|
Integer altNameType = (Integer)(altNameEntry.get(0));
|
||||||
if (altNameType != null && altNameType.intValue() == ALT_DNS_NAME) {
|
if (altNameType != null && altNameType.intValue() == ALT_DNS_NAME) {
|
||||||
|
Loading…
Reference in New Issue
Block a user