1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

switch over some for loops to enhanced for loop syntax per intellij

This commit is contained in:
Jesse Vincent 2010-12-01 03:04:07 +00:00
parent 58e6bd388b
commit 5485d0faf1
4 changed files with 15 additions and 28 deletions

View File

@ -81,9 +81,7 @@ public class FolderListFilter<T> extends Filter
final ArrayList<T> newValues = new ArrayList<T>(); final ArrayList<T> newValues = new ArrayList<T>();
for (int i = 0; i < count; i++) for (final T value : values) {
{
final T value = values.get(i);
final String valueText = value.toString().toLowerCase(); final String valueText = value.toString().toLowerCase();
for (int k = 0; k < wordCount; k++) for (int k = 0; k < wordCount; k++)

View File

@ -140,22 +140,15 @@ public class DomainNameChecker
Collection<?> subjectAltNames = certificate.getSubjectAlternativeNames(); Collection<?> subjectAltNames = certificate.getSubjectAlternativeNames();
if (subjectAltNames != null) if (subjectAltNames != null)
{ {
Iterator<?> i = subjectAltNames.iterator(); for (Object subjectAltName : subjectAltNames) {
while (i.hasNext()) List<?> altNameEntry = (List<?>) (subjectAltName);
{ if ((altNameEntry != null) && (2 <= altNameEntry.size())) {
List<?> altNameEntry = (List<?>)(i.next()); Integer altNameType = (Integer) (altNameEntry.get(0));
if ((altNameEntry != null) && (2 <= altNameEntry.size())) if (altNameType != null) {
{ if (altNameType == ALT_IPA_NAME) {
Integer altNameType = (Integer)(altNameEntry.get(0)); String altName = (String) (altNameEntry.get(1));
if (altNameType != null) if (altName != null) {
{ if (K9.DEBUG) {
if (altNameType.intValue() == ALT_IPA_NAME)
{
String altName = (String)(altNameEntry.get(1));
if (altName != null)
{
if (K9.DEBUG)
{
Log.v(K9.LOG_TAG, "alternative IP: " + altName); Log.v(K9.LOG_TAG, "alternative IP: " + altName);
} }
if (thisDomain.equalsIgnoreCase(altName)) if (thisDomain.equalsIgnoreCase(altName))

View File

@ -538,10 +538,8 @@ public class Base64 implements BinaryEncoder, BinaryDecoder
*/ */
public static boolean isArrayByteBase64(byte[] arrayOctet) public static boolean isArrayByteBase64(byte[] arrayOctet)
{ {
for (int i = 0; i < arrayOctet.length; i++) for (byte anArrayOctet : arrayOctet) {
{ if (!isBase64(anArrayOctet) && !isWhiteSpace(anArrayOctet)) {
if (!isBase64(arrayOctet[i]) && !isWhiteSpace(arrayOctet[i]))
{
return false; return false;
} }
} }

View File

@ -43,11 +43,9 @@ public class AccessibleEmailContentActivity extends ListActivity
String[] rawListItems = parsedHtml.toString().split("\n"); String[] rawListItems = parsedHtml.toString().split("\n");
ArrayList<String> cleanedList = new ArrayList<String>(); ArrayList<String> cleanedList = new ArrayList<String>();
for (int i = 0; i < rawListItems.length; i++) for (String rawListItem : rawListItems) {
{ if (rawListItem.trim().length() > 0) {
if (rawListItems[i].trim().length() > 0) addToCleanedList(cleanedList, rawListItem);
{
addToCleanedList(cleanedList, rawListItems[i]);
} }
} }