Hi Jody, there is also the case of array of objects that can trip things up on the client side, so better avoid it for those cases too (see my "self review" on the PR).
Cheers Andrea On Sun, Jan 17, 2021 at 2:19 AM Jody Garnett <jody.garn...@gmail.com> wrote: > Worth trying, we have a few cases where we already use varargs in a few > places and I like the increase in usability; apparently some caution is > needed when using varargs and generics together. > -- > Jody Garnett > > > On Fri, 15 Jan 2021 at 10:40, Andrea Aime <andrea.a...@geo-solutions.it> > wrote: > >> Hi, >> fiddling with IntelliJ I've found a cleanup that introduces usage of >> varargs in API having >> the last argument as an array. >> It immediately picked my interest, as I've been annoyed multiple times >> from APIs forcing >> me to create arrays... like, for example, setSortBy in Query. >> >> So I've tried to run it... first on the whole codebase. That was too much >> apparently, lots of >> changes, some of which a bit weird (like "public static void main(String >> ...)", which is btw valid). >> >> So I've tried to restrict the area of application to modules in the >> library modules, and if possible, only to >> src/main/java contents. The refactor is smart enough to also clean up >> call points, simplifying the code. >> Restricting the application means a PMD rule for this cannot be added, >> but maybe, for this it's not >> really needed. >> >> The result is here for your consideration: >> https://github.com/geotools/geotools/pull/3317 >> >> The changes are transparent for API users, not sure what happens for >> subclasses though... I'd >> assume the signature is equivalent, but not sure. >> >> What do you think? Worth merging before 25-RC? >> >> Cheers >> Andrea >> >> == GeoServer Professional Services from the experts! Visit >> http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf >> Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa >> (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 >> http://www.geo-solutions.it http://twitter.com/geosolutions_it >> ------------------------------------------------------- *Con riferimento >> alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - >> Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni >> circostanza inerente alla presente email (il suo contenuto, gli eventuali >> allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i >> destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per >> errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le >> sarei comunque grato se potesse darmene notizia. This email is intended >> only for the person or entity to which it is addressed and may contain >> information that is privileged, confidential or otherwise protected from >> disclosure. We remind that - as provided by European Regulation 2016/679 >> “GDPR” - copying, dissemination or use of this e-mail or the information >> herein by anyone other than the intended recipient is prohibited. If you >> have received this email by mistake, please notify us immediately by >> telephone or e-mail.* >> _______________________________________________ >> GeoTools-Devel mailing list >> GeoTools-Devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/geotools-devel >> > -- Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- *Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.*
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel