Skip to content

Commit c1a6c31

Browse files
committed
code polish
1 parent 16059df commit c1a6c31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,16 @@ private boolean applyNestedResultMappings(ResultSet rs, ResultMap resultMap, Met
149149
try {
150150
final StringBuilder columnPrefixBuilder = new StringBuilder();
151151
if (parentPrefix != null) columnPrefixBuilder.append(parentPrefix);
152-
if (resultMapping.getColumnPrefix()!= null) columnPrefixBuilder.append(resultMapping.getColumnPrefix());
152+
if (resultMapping.getColumnPrefix() != null) columnPrefixBuilder.append(resultMapping.getColumnPrefix());
153153
final String columnPrefix = columnPrefixBuilder.length() == 0 ? null : columnPrefixBuilder.toString().toUpperCase(Locale.ENGLISH);
154154
final ResultMap nestedResultMap = getNestedResultMap(rs, nestedResultMapId, columnPrefix);
155-
final Object collectionProperty = instantiateCollectionPropertyIfAppropriate(resultMapping, metaObject);
156155
final CacheKey absoluteKey = createAbsoluteKey(nestedResultMap, rs, columnPrefix, resultColumnCache);
157156
final CacheKey combinedKey = getCombinedKey(absoluteKey, parentRowKey);
158157
final boolean knownValue = objectCache.containsKey(combinedKey);
159158
final boolean isAncestor = ancestorCache.containsKey(absoluteKey);
160159
Object rowValue = getRowValue(rs, nestedResultMap, combinedKey, absoluteKey, columnPrefix, resultColumnCache);
161160
if (!knownValue && rowValue != null && anyNotNullColumnHasValue(resultMapping, columnPrefix, rs)) {
161+
final Object collectionProperty = instantiateCollectionPropertyIfAppropriate(resultMapping, metaObject);
162162
if (collectionProperty != null) {
163163
final MetaObject targetMetaObject = configuration.newMetaObject(collectionProperty);
164164
targetMetaObject.add(rowValue);

0 commit comments

Comments
 (0)