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

Introduce the validated version of Jenkins:getInstance()

    • 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

          [JENKINS-23339] Introduce the validated version of Jenkins:getInstance()

          Oleg Nenashev created issue -
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 155905 ] New: JNJira + In-Review [ 195293 ]

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

              Created:
              Updated:
              Resolved: