Skip to content

Commit

Permalink
fixed #199: Array element type mismatch possible with array objects
Browse files Browse the repository at this point in the history
  • Loading branch information
S1artie committed Sep 27, 2018
1 parent bd6debe commit 28fbb8a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,7 @@ protected Object convertEncapsulatedValueToTargetType(Class<?> aTargetType, Clas
} else if (tempResult != null && tempResult.getClass().isArray()) {
// A slight variant of the collection case is an array (possibly filled with Integrity types)
// We just convert the individual elements in this case.
Object tempResultArray = Array.newInstance(tempResult.getClass().getComponentType(),
Array.getLength(tempResult));
Object tempResultArray = Array.newInstance(aTargetType, Array.getLength(tempResult));
for (int i = 0; i < Array.getLength(tempResult); i++) {
Array.set(tempResultArray, i, convertSingleValueToTargetType(aTargetType, aParameterizedType,
Array.get(tempResult, i), aConversionContext, someVisitedValues));
Expand Down

0 comments on commit 28fbb8a

Please sign in to comment.