code: public synchronized void updateNextBuildNumber(int next) throws IOException {
          RunT lb = getLastBuild();
          if (lb!=null ?  next>lb.getNumber() : next>0) {
              this.nextBuildNumber = next;
              saveNextBuildNumber();
          }
      }
docs: Programatically updates the next build number.
  
  <p>
  Much of Hudson assumes that the build number is unique and monotonic, so
  this method can only accept a new value that's bigger than
  {@link #getLastBuild()} returns. Otherwise it'll be no-op.
  
  @since 1.199 (before that, this method was package private.)