Skip to content

Commit 151e90e

Browse files
authored
Merge pull request #990 from hazendaz/master
[ci] Use isEmpty checks instead of size per sonarqube
2 parents 0941ba3 + d6be6e0 commit 151e90e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/apache/ibatis/executor/resultset/DefaultResultSetHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ private List<UnMappedColumnAutoMapping> createAutomaticMappings(ResultSetWrapper
507507
private boolean applyAutomaticMappings(ResultSetWrapper rsw, ResultMap resultMap, MetaObject metaObject, String columnPrefix) throws SQLException {
508508
List<UnMappedColumnAutoMapping> autoMapping = createAutomaticMappings(rsw, resultMap, metaObject, columnPrefix);
509509
boolean foundValues = false;
510-
if (autoMapping.size() > 0) {
510+
if (!autoMapping.isEmpty()) {
511511
for (UnMappedColumnAutoMapping mapping : autoMapping) {
512512
final Object value = mapping.typeHandler.getResult(rsw.getResultSet(), mapping.column);
513513
if (value != null) {
@@ -1012,7 +1012,7 @@ private CacheKey createRowKey(ResultMap resultMap, ResultSetWrapper rsw, String
10121012
final CacheKey cacheKey = new CacheKey();
10131013
cacheKey.update(resultMap.getId());
10141014
List<ResultMapping> resultMappings = getResultMappingsForRowKey(resultMap);
1015-
if (resultMappings.size() == 0) {
1015+
if (resultMappings.isEmpty()) {
10161016
if (Map.class.isAssignableFrom(resultMap.getType())) {
10171017
createRowKeyForMap(rsw, cacheKey);
10181018
} else {
@@ -1043,7 +1043,7 @@ private CacheKey combineKeys(CacheKey rowKey, CacheKey parentRowKey) {
10431043

10441044
private List<ResultMapping> getResultMappingsForRowKey(ResultMap resultMap) {
10451045
List<ResultMapping> resultMappings = resultMap.getIdResultMappings();
1046-
if (resultMappings.size() == 0) {
1046+
if (resultMappings.isEmpty()) {
10471047
resultMappings = resultMap.getPropertyResultMappings();
10481048
}
10491049
return resultMappings;

0 commit comments

Comments
 (0)