[Geoserver-devel] Spotbugs, or... why have two static code checkers, when you can have three?

Hi all,
you might recall that when settig up static analysis I tried spotbugs and left it aside because
it was reporting too many issues and could not find a quick way to configure it.

After squeezing like a lemon PMD (and pushing it where it starts reporting too many false positives, which I don’t like)
I went back to spotbugs and with some effort and luck found the tuning knobs… and so I’ve prepared a new
pull request adding also spotbugs in the mix :smiley:

Was a good exercise, spotbugs is the slowest of the checkers, but found a number of guaranteed null
dereferences, string comparisons with ==, fields that will always be null, and other issues that were IMHO good to fix.

The plan is the usual, adding it in a profile, make it run on the side on Travis and on the build server.

Opinions?

Pull request here:
https://github.com/geotools/geotools/pull/2239

Mind, the changes make AllQuery and FidQuery throw unmodifiiable exceptions that were before built but not
thrown, so please do not merge right away unless you want to also double check the builds in GWC and GS
(but hey, if you want to do that, I’d be grateful :smiley: )

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.

Doh, was meant for geotools-devel… oh well, reposting there, and apologies to those receiveing it twice

Cheers
Andrea

···

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.