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,15 +1,14 @@
|
||||
package com.avaje.ebeaninternal.server.persist;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Used to hold BatchedPstmt objects for batch based execution.
|
||||
* <p>
|
||||
@@ -92,9 +91,7 @@ public class BatchedPstmtHolder {
|
||||
// but still need to close PreparedStatements.
|
||||
boolean isError = false;
|
||||
|
||||
Iterator<BatchedPstmt> it = stmtMap.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
BatchedPstmt bs = it.next();
|
||||
for (BatchedPstmt bs : stmtMap.values()) {
|
||||
try {
|
||||
if (!isError) {
|
||||
bs.executeBatch(getGeneratedKeys);
|
||||
@@ -119,7 +116,7 @@ public class BatchedPstmtHolder {
|
||||
bs.close();
|
||||
} catch (SQLException ex) {
|
||||
// error closing PreparedStatement
|
||||
logger.error(null, ex);
|
||||
logger.error(null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user