Skip to content

Commit 0ec8fcb

Browse files
authored
Merge pull request #3114 from whojes-toss/issue-3113
`DefaultResultSetHandler#applyColumnOrderBasedConstructorAutomapping()` should call `Constructor.getParameterTypes()` which internally clones the array just once. fixes #3113
2 parents b044200 + 926c451 commit 0ec8fcb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2023 the original author or authors.
2+
* Copyright 2009-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -782,8 +782,9 @@ private Object applyConstructorAutomapping(ResultSetWrapper rsw, ResultMap resul
782782

783783
private boolean applyColumnOrderBasedConstructorAutomapping(ResultSetWrapper rsw, List<Class<?>> constructorArgTypes,
784784
List<Object> constructorArgs, Constructor<?> constructor, boolean foundValues) throws SQLException {
785-
for (int i = 0; i < constructor.getParameterTypes().length; i++) {
786-
Class<?> parameterType = constructor.getParameterTypes()[i];
785+
Class<?>[] parameterTypes = constructor.getParameterTypes();
786+
for (int i = 0; i < parameterTypes.length; i++) {
787+
Class<?> parameterType = parameterTypes[i];
787788
String columnName = rsw.getColumnNames().get(i);
788789
TypeHandler<?> typeHandler = rsw.getTypeHandler(parameterType, columnName);
789790
Object value = typeHandler.getResult(rsw.getResultSet(), columnName);

0 commit comments

Comments
 (0)