I see! As XQuery sequences may contain items of arbitrary type, it is not always possible to decide at compile time which Java function needs to be chosen for evaluation. I recommend you to stick with the "Object..." declaration.
Nevertheless, I will check if we can optimize the static function selection without compromising performance. Best, Christian On Fri, Jun 29, 2018 at 12:30 PM Alexander Shpack <[email protected]> wrote: > > Hi Christian, > > Right now we are using the next code > > public static String exec(String key) { > return ... > } > > public static String exec(Object... keys) { > return ... > } > > The code that doesn't work: > > public static String exec(String... keys) > > > > On Fri, Jun 29, 2018 at 10:51 AM Christian Grün <[email protected]> > wrote: >> >> Hi Alex, >> >> How does the signature of the invoked Java function look like? >> >> Best, >> Christian >> >> >> >> On Mon, Jun 18, 2018 at 9:43 PM Alexander Shpack <[email protected]> wrote: >> > >> > Hey, team! >> > >> > Just simple question. How to pass sequence of string to the java class? >> > >> > let $values := for $i in (1 to 3) return $i cast to xs:string >> > return j:exec($values) >> > >> > In case when local function returns one item all is good. Otherwise >> > j:exec takes array of item()+, but not the array of stings. >> > >> > If you just call j:exec(("1","2")) than all works as expected. >> > >> > Any thoughts? Is it bug or feature? ;) >> > >> > BaseX 9.0 >> > >> > Thanks! >> > >> > >> > -- >> > s0rr0w > > > > -- > s0rr0w

