You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
split() returns a String[] that most collection methods mishandle: join()/asString() leak the array identity toString, sort() returns it unsorted, first()/last() throw #7027
split() returns a java.lang.String[], and most collection methods do not handle an array receiver. The failures are not uniform: some leak the array's identity toString() into a user-visible result, sort() silently returns the input unsorted, first()/last() throw, and asList() does not convert it. Separately, join() on a Set ignores its separator argument.
Where (HEAD c50338bd8)
engine/src/main/java/com/arcadedb/query/sql/method/** - the collection methods type-test their receiver for java.util.List (or Collection) and fall through to a toString() on anything else. split() is the standard producer of a non-List collection, so the two meet on the most natural chain a user writes.
Repro
Measured at c50338bd8. The receiver matrix for join('-'):
['a','b'].join('-') -> "a-b" correct
'a,b'.split(',').join('-') -> "[Ljava.lang.String;@7a8fa663" array identity toString
['b','a'].asSet().join('-') -> "[a, b]" Set toString, separator ignored
'a,b'.split(',').asList().join('-') -> "[Ljava.lang.String;@5ce33a58" asList() did not convert
sort() is worse than an error, because it looks like it worked:
'b,a'.split(',').sort() -> ["b","a"] unsorted, no error
['b','a'].asSet().sort() -> ["a","b"] correct
So a user chaining split() into any collection method gets, depending on which one, a correct answer, a silently wrong answer, a Java object address in their result set, or an exception. The "[Ljava.lang.String;@..." cases are the most damaging because they reach the client as data.
Suggested fix
Normalize the receiver once, in AbstractSQLMethod or a shared helper: accept Collection, an array (via Arrays.asList) and a scalar (as a singleton), and route every collection method through it. That fixes the whole matrix in one place rather than method by method, and it is the same "one helper so the next hardening reaches all of them" move already applied to SQLAggregatedFunction.accumulateNumeric and to the conversion methods in #6825.
Two separate points worth deciding explicitly:
sort() returning the receiver unsorted rather than erroring is the one I would prioritise: a silently unsorted result is worse than a failure.
join() on a Set should honour its separator; today it discards the argument and returns the Set's own toString().
Scope / confidence
High - every line above is measured output from this checkout, with the List case in the same run as the control.
Note on scope
I also tested two adjacent claims and they did NOT reproduce, so they are deliberately not part of this report: asRecord() does not mutate the receiver's record (the property was identical before and after the call), and replace() with a null operand returns null rather than its first argument.
split() now returns a list, like the split() function and Cypher's split() already did, and every collection method (join(), sort(), transform(), asList(), asSet(), asString()) accepts lists, sets, arrays and iterables alike. So 'a,b'.split(',').join('-') gives a-b, 'b,a'.split(',').sort() gives [a, b], and asSet().join('-') honours the separator. first() and last() are now also available as methods, so 'a,b'.split(',').first() works.
Found while testing: a method chained on a parameter, such as :list.join('-'), was silently ignored and returned the bare parameter. That is fixed too.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Re-validated against main at 4c03d0280: every line of the reported matrix is fixed, and the shared listReceiverOrNull() helper is exactly the structural fix this issue asked for.
Five collection methods were not routed through it (keys, values, ifEmpty, remove, removeAll - all still instanceof Collection). Much narrower exposure now, since split() answers a List, so it needs an array-valued parameter or property - filed as a follow-up rather than reopening.
Activity
lvca commentedon Sep 3, 2026
Fixed in #7092 (26.9.1).
split()now returns a list, like thesplit()function and Cypher'ssplit()already did, and every collection method (join(),sort(),transform(),asList(),asSet(),asString()) accepts lists, sets, arrays and iterables alike. So'a,b'.split(',').join('-')givesa-b,'b,a'.split(',').sort()gives[a, b], andasSet().join('-')honours the separator.first()andlast()are now also available as methods, so'a,b'.split(',').first()works.Found while testing: a method chained on a parameter, such as
:list.join('-'), was silently ignored and returned the bare parameter. That is fixed too.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
ruispereira commentedon Sep 3, 2026
Re-validated against
mainat4c03d0280: every line of the reported matrix is fixed, and the sharedlistReceiverOrNull()helper is exactly the structural fix this issue asked for.Five collection methods were not routed through it (
keys,values,ifEmpty,remove,removeAll- all stillinstanceof Collection). Much narrower exposure now, sincesplit()answers aList, so it needs an array-valued parameter or property - filed as a follow-up rather than reopening.Fix split()/collection-method receivers, append() leading null, shutd…
fix(ArcadeData#7434, ArcadeData#7114, ArcadeData#7125): $matched.<ali…