Skip to content

Commit

Permalink
checkstyle fix
Browse files Browse the repository at this point in the history
  • Loading branch information
S1artie committed Jan 2, 2019
1 parent 3eed587 commit f9ea973
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,21 +520,21 @@ 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.
Class<?> anArrayTargetType = aTargetType;
if (anArrayTargetType == null) {
Class<?> tempArrayTargetType = aTargetType;
if (tempArrayTargetType == null) {
// The "null" type - for default conversion - cannot be used to instantiate an array.
// See if we have Integrity data types that may be converted to unpredictable Java default
// types. If yes, use an Object array to catch them all. Otherwise it should be safe to use
// the source array type as target type since no actual conversion should take place
// anyway. Fixes issue #205.
if (isIntegrityType(tempResult.getClass().getComponentType())) {
anArrayTargetType = Object.class;
tempArrayTargetType = Object.class;
} else {
anArrayTargetType = tempResult.getClass().getComponentType();
tempArrayTargetType = tempResult.getClass().getComponentType();
}
}

Object tempResultArray = Array.newInstance(anArrayTargetType, Array.getLength(tempResult));
Object tempResultArray = Array.newInstance(tempArrayTargetType, 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 f9ea973

Please sign in to comment.