Currently, the jenkins.model.Jenkins::getInstance() method is marked as @CheckForNull, but the most of Jenkins code does not actually check the return value. It leads to tons of static analysis errors, hence it is hard to analyze the code.
I propose to...
- Add an additional method (e.g. Jenkins::getActiveInstance()), which throws an exception on access errors
- Convert all non-checked Jenkins::getInstance() methods