code: public FilePath getCurrentWorkspace() {
          lock.readLock().lock();
          try {
              if (executable == null) {
                  return null;
              }
              if (executable instanceof AbstractBuild) {
                  AbstractBuild ab = (AbstractBuild) executable;
                  return ab.getWorkspace();
              }
              return null;
          } finally {
              lock.readLock().unlock();
          }
      }
docs: If {@linkplain #getCurrentExecutable() current executable} is {@link AbstractBuild},
  return the workspace that this executor is using, or null if the build hasn't gotten
  to that point yet.