Another way to do it is to put more effort into improving the quality of your current team. In the long run, that's a skill you're gonna need.
23 karma · joined November 6, 2016
Another way to do it is to put more effort into improving the quality of your current team. In the long run, that's a skill you're gonna need.
Of course, it's important to read that section as "what I don't prioritise", not "what you shouldn't prioritise".
What incentive do the distributors - your customers, and gatekeepers to using this approach - have to adopt it?
Surely, this is a technical solution to a non-technical problem?
I've written checks in both error-prone and Findbugs and error-prone is simply more natural. Part of that is the Findbugs API, for want of a better word, is godawful, but the AST is simply the best representation of the program for analysis.
If you're going to analyse the AST, you then have a further two choices: build your own AST, or hook into the compiler. Building it yourself is dangerous here: firstly, it's repeating a lot of work that's already been done, but more importantly you want to be absolutely sure that what you're analysing is what you're actually building. Either way you have to do updates when the language changes, as any static analysis tool needs to.
Are there costs to this decision? Yep. Is it going to be the right tool for every job? Nope. But that doesn't mean that these decisions don't have reasoning behind them, and compelling reasons to go this way.
Error-prone is a compiler plugin _mechanism_ - once you have an error-prone compiler, the checks are arguments to the compiler just like APT annotation processors are.
It's built on a standard API - the JavaCompiler mechanism built into the Java SDK - but yes, the code does have further dependencies on com.sun packages. This is a little confusing because why expose the compiler for invocation and extension when extensions have to rely on unsupported code?
So, yes, there are ways where the distinction is important, but they're orthogonal to the point I was trying to make.
See https://github.com/google/error-prone/blob/master/core/src/m... for the entry-point.
I'm very close to getting out of my depth here though :)
This turns out to be really quite relevant if you're building domain-specific static analysis checks, as opposed to just running standard analyses.