Details
-
Bug
-
Resolution: Solved By
-
Major
-
None
-
11.10.2
-
Unknown
-
N/A
-
N/A
-
Description
Using an API such as:
return this.configurationSource.getProperty("myProperty", Arrays.asList("/", "\\"));
where "myProperty" is a Static List will lead to the following stack trace, if values are present:
Caused by: org.xwiki.properties.converter.ConversionException: Failed to find a Converter to convert from [com.xpn.xwiki.objects.ListProperty$NotifyList] to [java.util.Arrays$ArrayList] at org.xwiki.properties.internal.converter.ConvertUtilsConverter.convert(ConvertUtilsConverter.java:82) at org.xwiki.properties.internal.converter.ConvertUtilsConverter.convert(ConvertUtilsConverter.java:101) at org.xwiki.properties.internal.DefaultConverterManager.convert(DefaultConverterManager.java:114) at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.getPropertyValue(AbstractDocumentConfigurationSource.java:329) at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.getProperty(AbstractDocumentConfigurationSource.java:277)
The core issue is that if there is a converter for java.util.ArrayList, there is no converter for java.util.Arrays#ArrayList which is used when calling Arrays.asList(...).
Attachments
Issue Links
- depends on
-
XCOMMONS-1838 Allow to use ConfigurationSource#getProperty with both a defined class and a defaultValue
- Closed