Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.0uimaFIT
-
None
Description
The method
ExternalResourceDescription createExternalResourceDescription( Class<? extends SharedResourceObject> aInterface, String aUrl, Object... aParams)
can be invoked if the user actually wanted to call the method
ExternalResourceDescription createExternalResourceDescription( Class<? extends Resource> aInterface, Object... aParams)
E.g.
createExternalResourceDescription( MyResource, MyResource.PARAM_VALUE, "myvalue"))
Java seems to be smart enough to invoke the correct method, but when calling this from Groovy, it fails:
Caught: java.lang.IllegalArgumentException: Parameter arguments have to come in key/value pairs, but found odd number of arguments [3] java.lang.IllegalArgumentException: Parameter arguments have to come in key/value pairs, but found odd number of arguments [3] at org.apache.uima.fit.factory.ConfigurationParameterFactory.ensureParametersComeInPairs(ConfigurationParameterFactory.java:531) at org.apache.uima.fit.factory.ConfigurationParameterFactory.createConfigurationData(ConfigurationParameterFactory.java:374) at org.apache.uima.fit.factory.ExternalResourceFactory.createExternalResourceDescription(ExternalResourceFactory.java:277) at org.apache.uima.fit.factory.ExternalResourceFactory.createExternalResourceDescription(ExternalResourceFactory.java:213)
A workaround is currently to cast the first parameter name to Object:
createExternalResourceDescription( MyResource, (Object) MyResource.PARAM_VALUE, "myvalue"))
Attachments
Attachments
Issue Links
- links to