Skip to content

Commit 9b20e5a

Browse files
committed
[ci] Combine more complex 'if' statement per pmd/sonar
1 parent 403625f commit 9b20e5a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/main/java/org/apache/ibatis/builder/xml/XMLMapperBuilder.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -393,14 +393,11 @@ private ResultMapping buildResultMappingFromContext(XNode context, Class<?> resu
393393
}
394394

395395
private String processNestedResultMappings(XNode context, List<ResultMapping> resultMappings, Class<?> enclosingType) {
396-
if ("association".equals(context.getName())
397-
|| "collection".equals(context.getName())
398-
|| "case".equals(context.getName())) {
399-
if (context.getStringAttribute("select") == null) {
400-
validateCollection(context, enclosingType);
401-
ResultMap resultMap = resultMapElement(context, resultMappings, enclosingType);
402-
return resultMap.getId();
403-
}
396+
if (("association".equals(context.getName()) || "collection".equals(context.getName())
397+
|| "case".equals(context.getName())) && context.getStringAttribute("select") == null) {
398+
validateCollection(context, enclosingType);
399+
ResultMap resultMap = resultMapElement(context, resultMappings, enclosingType);
400+
return resultMap.getId();
404401
}
405402
return null;
406403
}

0 commit comments

Comments
 (0)