in src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java [152:164]
public static Object toObject(Object propValue) {
if (propValue == null) {
return null;
} else if (propValue.getClass().isArray()) {
Object[] prop = (Object[]) propValue;
return prop.length > 0 ? prop[0] : null;
} else if (propValue instanceof Collection<?>) {
Collection<?> prop = (Collection<?>) propValue;
return prop.isEmpty() ? null : prop.iterator().next();
} else {
return propValue;
}
}