Picnic logo

Picnic Open-sources Error Prone Support

Written by Sander MakNov 30, 2022 08:253 min read
2210 BlogPosts Images  Error Prone2

We’re excited to announce that Picnic’s Error Prone Support project is now open-source!


Last week, we already shared an in-depth overview of how Picnic has adopted Google’s Error Prone static analysis tool for Java code. In short, it allows us to:




  • Improve the consistency and quality of our Java codebases.

  • Introduce custom checks for code (anti-)patterns we value.

  • Refactor our Java code at scale in an automated manner.


You can also watch this Devoxx talk to get an overview of how Error Prone works and why we open-sourced Error Prone Support:



 

Why you should use Error Prone Support


We also shared how Picnic built up a considerable number of custom BugChecks and Refaster (refactoring) rules to be used with Error Prone. As of today, these can be used by anyone! You can easily integrate Error Prone Support (EPS) into your own code by following the steps in the Getting Started guide.


Here’s a small taste of what the Error Prone Support BugChecks and Refaster rules can do for you:




Hungry for more? On the project’s website, you can find a complete overview of all BugChecks and Refaster rules that are available.


Next to the BugChecks and Refaster rules, EPS also offers other improvements. For example, the ability to easily load and run many Refaster rules in one go. Also, EPS introduces support for testing Refaster rules on top of Error Prone’s Refaster implementation. If you’re serious about adopting Error Prone and Refaster, adding EPS to the mix will make your life a lot easier!



What’s ahead


Besides what’s already open-sourced today, we have many plans to improve Error Prone Support! Let’s share a few of them. First and foremost, we want to improve the performance of applying large numbers of Refaster rules. Currently, the matching algorithm is very naive, so we’re developing a new algorithm to drastically speed up this process. Early tests already show a 50% performance improvement!


Secondly, we are introducing support for emitting website links for matches of Refaster rules, bringing the developer experience to the same level as BugCheck messages. As a result, developers can easily navigate to the documentation website and see extra information about the rule. You can see an example here.


Last, we’ll keep introducing more BugChecks and Refaster rules.



Our open-source commitment


Error Prone Support was developed over the past five years within Picnic, as you can see in the GitHub project’s history. Stephan Schroevers (Tech Lead Consumer Products) deserves a special mention here. He is the initiator and main contributor of the Error Prone Support project, and has championed the adoption of Error Prone within Picnic.


Picnic is fully committed to developing Error Prone Support further, now as an open-source project. That means we’d love to see your contributions as well! Once you start developing your own BugChecks and Refaster rules, we encourage you to check out our contribution guidelines and open a Pull Request. Let’s improve as many Java codebases as we can, together!


Written by: Sander Mak

Recent blog posts

We're strong believers in learning from each other, so
our employees write about what interests them.