Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-23339

Introduce the validated version of Jenkins:getInstance()

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • core

      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...

      1. Add an additional method (e.g. Jenkins::getActiveInstance()), which throws an exception on access errors
      2. Convert all non-checked Jenkins::getInstance() methods

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: