Skip to content

Commit

Permalink
Merge pull request #3114 from whojes-toss/issue-3113
Browse files Browse the repository at this point in the history
`DefaultResultSetHandler#applyColumnOrderBasedConstructorAutomapping()` should call `Constructor.getParameterTypes()` which internally clones the array just once.

fixes #3113
  • Loading branch information
harawata authored Mar 20, 2024
2 parents b044200 + 926c451 commit 0ec8fcb
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2023 the original author or authors.
* Copyright 2009-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -782,8 +782,9 @@ private Object applyConstructorAutomapping(ResultSetWrapper rsw, ResultMap resul

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

0 comments on commit 0ec8fcb

Please sign in to comment.