mmiklavc commented on a change in pull request #1416: METRON-2123: Expand
Stellar JOIN to work on all Iterables
URL: https://github.com/apache/metron/pull/1416#discussion_r285753468
##########
File path:
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/functions/StringFunctions.java
##########
@@ -133,15 +131,15 @@ public Object apply(List<Object> strings) {
}
@Stellar( name="JOIN"
- , description="Joins the components in the list of strings with the
specified delimiter."
- , params = { "list - List of strings", "delim - String delimiter"}
+ , description="Joins the non-null items in the iterable as strings
with the specified delimiter. Null items are dropped."
+ , params = { "iterable - iterable (e.g. List, LinkedHashSet, etc.)
of items treated as strings", "delim - String delimiter"}
, returns = "String"
)
Review comment:
> do we need to SurpressWarnings("unchecked")?
That's always been there - it's calling out the unchecked type cast
`(Iterable<Object>) args.get(0);` (previously `(List<Object>) args.get(0);`
Alternatively, we can add extra instanceof checks, but it's really 6 of one,
half a dozen of the other. You get a classcastexception.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services