uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <...@uima.apache.org>
Subject [jira] [Commented] (UIMA-3928) createExternalResourceDescription() signatures shadowing each other
Date Tue, 29 May 2018 19:11:00 GMT

    [ https://issues.apache.org/jira/browse/UIMA-3928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494081#comment-16494081
] 

ASF GitHub Bot commented on UIMA-3928:
--------------------------------------

asfgit commented on issue #3: [UIMA-3928] createExternalResourceDescription() signatures shadowing
each other
URL: https://github.com/apache/uima-uimafit/pull/3#issuecomment-392905157
 
 
   
   Refer to this link for build results (access rights to CI server needed): 
   https://builds.apache.org/job/Apache%20UIMA%20uimaFIT%20(GitHub%20PR)/6/
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> createExternalResourceDescription() signatures shadowing each other
> -------------------------------------------------------------------
>
>                 Key: UIMA-3928
>                 URL: https://issues.apache.org/jira/browse/UIMA-3928
>             Project: UIMA
>          Issue Type: Bug
>          Components: uimaFIT
>    Affects Versions: 2.0.0uimaFIT
>            Reporter: Richard Eckart de Castilho
>            Priority: Major
>             Fix For: 3.0.0uimaFIT
>
>
> The method 
> {noformat}
> ExternalResourceDescription createExternalResourceDescription(
>   Class<? extends SharedResourceObject> aInterface, 
>   String aUrl, 
>   Object... aParams)
> {noformat}
> can be invoked if the user actually wanted to call the method
> {noformat}
> ExternalResourceDescription createExternalResourceDescription(
>   Class<? extends Resource> aInterface, 
>   Object... aParams)
> {noformat}
> E.g.
> {noformat}
> createExternalResourceDescription(
>         MyResource,
>         MyResource.PARAM_VALUE, 
>         "myvalue"))
> {noformat}
> Java seems to be smart enough to invoke the correct method, but when calling this from
Groovy, it fails:
> {noformat}
> 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)
> {noformat}
> A workaround is currently to cast the first parameter name to Object:
> {noformat}
> createExternalResourceDescription(
>         MyResource,
>         (Object) MyResource.PARAM_VALUE, 
>         "myvalue"))
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message