jodd-bean/src/main/java/jodd/typeconverter/impl/ShortArrayConverter.java
protected short[] convertValueToArray(final Object value) {
		if (value instanceof Collection) {
			final Collection collection = (Collection) value;
			final short[] target = new short[collection.size()];

			int i = 0;
			for (final Object element : collection) {
				target[i] = convertType(element);
				i++;
			}

			return target;
		}

		if (value instanceof Iterable) {
			final Iterable iterable = (Iterable) value;

			final ArrayList<Short> shortArrayList = new ArrayList<>();

			for (final Object element : iterable) {
				final short convertedValue = convertType(element);
				shortArrayList.add(Short.valueOf(convertedValue));
			}

			final short[] array = new short[shortArrayList.size()];

			for (int i = 0; i < shortArrayList.size(); i++) {
				final Short s = shortArrayList.get(i);
				array[i] = s.shortValue();
			}

			return array;
		}

		if (value instanceof CharSequence) {
			final String[] strings = StringUtil.splitc(value.toString(), ArrayConverter.NUMBER_DELIMITERS);
			return convertArrayToArray(strings);
		}

		// everything else:
		return convertToSingleElementArray(value);
	}
protected short[] convertValueToArray(final Object value) {
		if (value instanceof Collection) {
			final Collection collection = (Collection) value;
			final short[] target = new short[collection.size()];

			int i = 0;
			for (final Object element : collection) {
				target[i] = convertType(element);
				i++;
			}

			return target;
		}

		if (value instanceof Iterable) {
			final Iterable iterable = (Iterable) value;

			final ArrayList<Short> shortArrayList = new ArrayList<>();

			for (final Object element : iterable) {
				final short convertedValue = convertType(element);
				shortArrayList.add(Short.valueOf(convertedValue));
			}

			final short[] array = new short[shortArrayList.size()];

			for (int i = 0; i < shortArrayList.size(); i++) {
				final Short s = shortArrayList.get(i);
				array[i] = s.shortValue();
			}

			return array;
		}

		if (value instanceof CharSequence) {
			final String[] strings = StringUtil.splitc(value.toString(), ArrayConverter.NUMBER_DELIMITERS);
			return convertArrayToArray(strings);
		}

		// everything else:
		return convertToSingleElementArray(value);
	}
Converts non-array value to array. Detects various
collection types and iterates them to make conversion
and to create target array.