Skip to content

Commit e9e9a29

Browse files
authored
Merge pull request mybatis#3138 from dukbong/Refactoring
Use isEmpty() instead of length()
2 parents 382cbf4 + a020b39 commit e9e9a29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/apache/ibatis/executor/keygen/SelectKeyGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private void processGeneratedKeys(Executor executor, MappedStatement ms, Object
6565
// The transaction will be closed by parent executor.
6666
Executor keyExecutor = configuration.newExecutor(executor.getTransaction(), ExecutorType.SIMPLE);
6767
List<Object> values = keyExecutor.query(keyStatement, parameter, RowBounds.DEFAULT, Executor.NO_RESULT_HANDLER);
68-
if (values.size() == 0) {
68+
if (values.isEmpty()) {
6969
throw new ExecutorException("SelectKey returned no data.");
7070
}
7171
if (values.size() > 1) {

0 commit comments

Comments
 (0)