code: protected void updateCache(@Nonnull Job<?,?> job, @Nullable Run<?,?> b) {
          final int n = b==null ? RESOLVES_TO_NONE : b.getNumber();
  
          File cache = getPermalinkFile(job);
          cache.getParentFile().mkdirs();
  
          try {
              String target = String.valueOf(n);
              if (b != null && !new File(job.getBuildDir(), target).exists()) {
                  // (re)create the build Number->Id symlink
                  Util.createSymlink(job.getBuildDir(),b.getId(),target,TaskListener.NULL);
              }
              writeSymlink(cache, target);
          } catch (IOException | InterruptedException e) {
              LOGGER.log(Level.WARNING, "Failed to update "+job+" "+getId()+" permalink for " + b, e);
              cache.delete();
          }
      }
docs: Remembers the value 'n' in the cache for future {@link #resolve(Job)}.