mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
Code cleanup - move old iterator/while loops to for loops
This commit is contained in:
1 parent
0c4fc4eea3
commit
63e9f603ec
25 files changed
+360
-524
No files matched your search
@@ -1,7 +1,6 @@
|
||||
package com.avaje.ebeaninternal.server.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -180,10 +179,8 @@ public class BindParamsParser {
|
||||
// Chop up Collection parameter into a number
|
||||
// of individual parameters and add each one individually
|
||||
Collection<?> collection = (Collection<?>)inValue;
|
||||
Iterator<?> it = collection.iterator();
|
||||
int c = 0;
|
||||
while (it.hasNext()) {
|
||||
Object elVal = (Object) it.next();
|
||||
for (Object elVal : collection) {
|
||||
if (++c > 1){
|
||||
orderedList.appendSql(",");
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.jar.Attributes;
|
||||
@@ -262,9 +261,7 @@ public class ClassPathSearch {
|
||||
if (includePkgs.size() > 0) {
|
||||
// just search the relevant directories based on the
|
||||
// list of included packages
|
||||
Iterator<String> it = includePkgs.iterator();
|
||||
while (it.hasNext()) {
|
||||
String pkg = it.next();
|
||||
for (String pkg : includePkgs) {
|
||||
String relativePath = pkg.replace('.', '/');
|
||||
File dir = new File(classPath, relativePath);
|
||||
if (dir.exists()) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.avaje.ebeaninternal.server.util;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -177,9 +176,7 @@ public class ClassPathSearchFilter {
|
||||
if (set.contains(match)) {
|
||||
return true;
|
||||
}
|
||||
Iterator<String> incIt = set.iterator();
|
||||
while (incIt.hasNext()) {
|
||||
String val = incIt.next();
|
||||
for (String val : set) {
|
||||
if (match.contains(val)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user