Fully qualify class names in javadoc when there is no other reference.

This removes the need for the class to actually be imported, thus removing potential dependencies.

PiperOrigin-RevId: 305259489
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/AllIncompatibleChangesExpansion.java b/src/main/java/com/google/devtools/build/lib/runtime/AllIncompatibleChangesExpansion.java
index d0a73ee..9dff3d9 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/AllIncompatibleChangesExpansion.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/AllIncompatibleChangesExpansion.java
@@ -18,36 +18,38 @@
 import com.google.devtools.common.options.Converter;
 import com.google.devtools.common.options.ExpansionFunction;
 import com.google.devtools.common.options.IsolatedOptionsData;
-import com.google.devtools.common.options.Option;
 import com.google.devtools.common.options.OptionDefinition;
 import com.google.devtools.common.options.OptionMetadataTag;
-import com.google.devtools.common.options.OptionsBase;
-import com.google.devtools.common.options.OptionsParser;
 import java.util.ArrayList;
 import java.util.Map;
 
 /**
  * Expansion function for {@code --all_incompatible_changes}. Expands to all options of form {@code
- * --incompatible_*} that are declared in the {@link OptionsBase} subclasses that are passed to the
- * parser.
+ * --incompatible_*} that are declared in the {@link com.google.devtools.common.options.OptionsBase}
+ * subclasses that are passed to the parser.
  *
  * <p>The incompatible changes system provides users with a uniform way of opting into backwards-
  * incompatible changes, in order to test whether their builds will be broken by an upcoming
  * release. When adding a new breaking change to Bazel, prefer to use this mechanism for guarding
  * the behavior.
  *
- * <p>An {@link Option}-annotated field that is considered an incompatible change must satisfy the
- * following requirements.
+ * <p>An {@link com.google.devtools.common.options.Option}-annotated field that is considered an
+ * incompatible change must satisfy the following requirements.
  *
  * <ul>
- *   <li>the {@link Option#name} must be prefixed with "incompatible_"
- *   <li>the {@link Option#metadataTags()} must include {@link
+ *   <li>the {@link com.google.devtools.common.options.Option#name} must be prefixed with
+ *       "incompatible_"
+ *   <li>the {@link com.google.devtools.common.options.Option#metadataTags()} must include {@link
  *       OptionMetadataTag#INCOMPATIBLE_CHANGE} and {@link
  *       OptionMetadataTag#TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES}
- *   <li>the {@link Option#help} field must be set, and must refer the user to information about
- *       what the change does and how to migrate their code
- *   <li>the following fields may not be used: {@link Option#abbrev}, {@link Option#valueHelp},
- *       {@link Option#converter}, {@link Option#allowMultiple}, and {@link Option#oldName}
+ *   <li>the {@link com.google.devtools.common.options.Option#help} field must be set, and must
+ *       refer the user to information about what the change does and how to migrate their code
+ *   <li>the following fields may not be used: {@link
+ *       com.google.devtools.common.options.Option#abbrev}, {@link
+ *       com.google.devtools.common.options.Option#valueHelp}, {@link
+ *       com.google.devtools.common.options.Option#converter}, {@link
+ *       com.google.devtools.common.options.Option#allowMultiple}, and {@link
+ *       com.google.devtools.common.options.Option#oldName}
  * </ul>
  *
  * Example:
@@ -67,10 +69,11 @@
  * All options that have either the "incompatible_" prefix or the tag {@link
  * OptionMetadataTag#TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES} will be validated using the above
  * criteria. Any failure will cause {@link IllegalArgumentException} to be thrown, which will cause
- * the construction of the {@link OptionsParser} to fail with the <i>unchecked</i> exception {@link
- * OptionsParser.ConstructionException}. Therefore, when adding a new incompatible change, be aware
- * that an error in the specification of the {@code @Option} will exercise failure code paths in the
- * early part of the Bazel server execution.
+ * the construction of the {@link com.google.devtools.common.options.OptionsParser} to fail with the
+ * <i>unchecked</i> exception {@link
+ * com.google.devtools.common.options.OptionsParser.ConstructionException}. Therefore, when adding a
+ * new incompatible change, be aware that an error in the specification of the {@code @Option} will
+ * exercise failure code paths in the early part of the Bazel server execution.
  *
  * <p>After the breaking change has been enabled by default, it is recommended (required?) that the
  * flag stick around for a few releases, to provide users the flexibility to opt out. Even after
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BazelFileSystemModule.java b/src/main/java/com/google/devtools/build/lib/runtime/BazelFileSystemModule.java
index ef23dc7..1ed618f 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BazelFileSystemModule.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BazelFileSystemModule.java
@@ -22,7 +22,6 @@
 import com.google.devtools.build.lib.vfs.DigestHashFunction.DefaultAlreadySetException;
 import com.google.devtools.build.lib.vfs.DigestHashFunction.DefaultHashFunctionNotSetException;
 import com.google.devtools.build.lib.vfs.DigestHashFunction.DigestFunctionConverter;
-import com.google.devtools.build.lib.vfs.FileSystem;
 import com.google.devtools.build.lib.vfs.JavaIoFileSystem;
 import com.google.devtools.build.lib.vfs.PathFragment;
 import com.google.devtools.build.lib.windows.WindowsFileSystem;
@@ -30,10 +29,12 @@
 import com.google.devtools.common.options.OptionsParsingResult;
 
 /**
- * Module to provide a {@link FileSystem} instance that uses {@code SHA256} as the default hash
- * function, or else what's specified by {@code -Dbazel.DigestFunction}.
+ * Module to provide a {@link com.google.devtools.build.lib.vfs.FileSystem} instance that uses
+ * {@code SHA256} as the default hash function, or else what's specified by {@code
+ * -Dbazel.DigestFunction}.
  *
- * <p>For legacy reasons we can't make the {@link FileSystem} class use {@code SHA256} by default.
+ * <p>For legacy reasons we can't make the {@link com.google.devtools.build.lib.vfs.FileSystem}
+ * class use {@code SHA256} by default.
  */
 public class BazelFileSystemModule extends BlazeModule {
 
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeModule.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeModule.java
index 4938c3e..b2536f5 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeModule.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeModule.java
@@ -16,9 +16,7 @@
 import com.google.auto.value.AutoValue;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
-import com.google.common.eventbus.SubscriberExceptionContext;
 import com.google.common.eventbus.SubscriberExceptionHandler;
-import com.google.devtools.build.lib.actions.ActionContext;
 import com.google.devtools.build.lib.actions.ExecutorInitException;
 import com.google.devtools.build.lib.analysis.BlazeDirectories;
 import com.google.devtools.build.lib.analysis.BlazeVersionInfo;
@@ -35,7 +33,6 @@
 import com.google.devtools.build.lib.exec.ModuleActionContextRegistry;
 import com.google.devtools.build.lib.exec.SpawnStrategyRegistry;
 import com.google.devtools.build.lib.packages.Package;
-import com.google.devtools.build.lib.packages.PackageFactory;
 import com.google.devtools.build.lib.packages.PackageValidator;
 import com.google.devtools.build.lib.skyframe.AspectValue;
 import com.google.devtools.build.lib.skyframe.PrecomputedValue;
@@ -133,10 +130,11 @@
   /**
    * Returns handler for {@link com.google.common.eventbus.EventBus} subscriber and async thread
    * exceptions. For async thread exceptions, {@link
-   * SubscriberExceptionHandler#handleException(Throwable, SubscriberExceptionContext)} will be
-   * called with null {@link SubscriberExceptionContext}. If all modules return null, a handler that
-   * crashes on all async exceptions and files bug reports for all EventBus subscriber exceptions
-   * will be used.
+   * SubscriberExceptionHandler#handleException(Throwable,
+   * com.google.common.eventbus.SubscriberExceptionContext)} will be called with null {@link
+   * com.google.common.eventbus.SubscriberExceptionContext}. If all modules return null, a handler
+   * that crashes on all async exceptions and files bug reports for all EventBus subscriber
+   * exceptions will be used.
    */
   public SubscriberExceptionHandler getEventBusAndAsyncExceptionHandler() {
     return null;
@@ -310,8 +308,9 @@
 
   /**
    * Registers any action contexts this module provides with the execution phase. They will be
-   * available for {@linkplain ActionContext.ActionContextRegistry#getContext querying} to actions
-   * and other action contexts.
+   * available for {@linkplain
+   * com.google.devtools.build.lib.actions.ActionContext.ActionContextRegistry#getContext querying}
+   * to actions and other action contexts.
    *
    * <p>This method is invoked before actions are executed but after {@link #executorInit}.
    *
@@ -398,8 +397,8 @@
   }
 
   /**
-   * Returns a helper that the {@link PackageFactory} will use during package loading, or null if
-   * the module does not provide any helper.
+   * Returns a helper that the {@link com.google.devtools.build.lib.packages.PackageFactory} will
+   * use during package loading, or null if the module does not provide any helper.
    *
    * <p>Called once during server startup some time after {@link #serverInit}.
    *
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
index 06d1d32..856d47e 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java
@@ -51,7 +51,6 @@
 import com.google.devtools.build.lib.packages.Package;
 import com.google.devtools.build.lib.packages.PackageFactory;
 import com.google.devtools.build.lib.packages.PackageValidator;
-import com.google.devtools.build.lib.packages.RuleClassProvider;
 import com.google.devtools.build.lib.profiler.AutoProfiler;
 import com.google.devtools.build.lib.profiler.MemoryProfiler;
 import com.google.devtools.build.lib.profiler.ProfilePhase;
@@ -60,7 +59,6 @@
 import com.google.devtools.build.lib.profiler.ProfilerTask;
 import com.google.devtools.build.lib.profiler.SilentCloseable;
 import com.google.devtools.build.lib.query2.QueryEnvironmentFactory;
-import com.google.devtools.build.lib.query2.common.AbstractBlazeQueryEnvironment;
 import com.google.devtools.build.lib.query2.engine.QueryEnvironment.QueryFunction;
 import com.google.devtools.build.lib.query2.query.output.OutputFormatter;
 import com.google.devtools.build.lib.query2.query.output.OutputFormatters;
@@ -447,8 +445,9 @@
   }
 
   /**
-   * Returns the {@link QueryEnvironmentFactory} that should be used to create a
-   * {@link AbstractBlazeQueryEnvironment}, whenever one is needed.
+   * Returns the {@link QueryEnvironmentFactory} that should be used to create a {@link
+   * com.google.devtools.build.lib.query2.common.AbstractBlazeQueryEnvironment}, whenever one is
+   * needed.
    */
   public QueryEnvironmentFactory getQueryEnvironmentFactory() {
     return queryEnvironmentFactory;
@@ -1458,8 +1457,8 @@
 
   /**
    * A builder for {@link BlazeRuntime} objects. The only required fields are the {@link
-   * BlazeDirectories}, and the {@link RuleClassProvider} (except for testing). All other fields
-   * have safe default values.
+   * BlazeDirectories}, and the {@link com.google.devtools.build.lib.packages.RuleClassProvider}
+   * (except for testing). All other fields have safe default values.
    *
    * <p>The default behavior of the BlazeRuntime's EventBus is to exit the JVM when a subscriber
    * throws an exception. Please plan appropriately.
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/Command.java b/src/main/java/com/google/devtools/build/lib/runtime/Command.java
index 0e180e4..b1d5053 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/Command.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/Command.java
@@ -13,7 +13,6 @@
 // limitations under the License.
 package com.google.devtools.build.lib.runtime;
 
-import com.google.devtools.common.options.Option;
 import com.google.devtools.common.options.OptionsBase;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
@@ -33,8 +32,9 @@
   String name();
 
   /**
-   * Options processed by the command, indicated by options interfaces.
-   * These interfaces must contain methods annotated with {@link Option}.
+   * Options processed by the command, indicated by options interfaces. These interfaces must
+   * contain methods annotated with {@link com/google/devtools/build/lib/runtime/Command.java used
+   * only in javadoc: com.google.devtools.common.options.Option}.
    */
   Class<? extends OptionsBase>[] options() default {};
 
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
index d4dcb66..12f3358 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java
@@ -22,7 +22,6 @@
 import com.google.devtools.build.lib.actions.cache.ActionCache;
 import com.google.devtools.build.lib.analysis.AnalysisOptions;
 import com.google.devtools.build.lib.analysis.BlazeDirectories;
-import com.google.devtools.build.lib.analysis.config.BuildConfiguration;
 import com.google.devtools.build.lib.analysis.config.CoreOptions;
 import com.google.devtools.build.lib.cmdline.Label;
 import com.google.devtools.build.lib.events.Reporter;
@@ -594,7 +593,8 @@
 
   /**
    * Initializes the package cache using the given options, and syncs the package cache. Also
-   * injects the skylark semantics using the options for the {@link BuildConfiguration}.
+   * injects the skylark semantics using the options for the {@link
+   * com.google.devtools.build.lib.analysis.config.BuildConfiguration}.
    */
   public void setupPackageCache(OptionsProvider options)
       throws InterruptedException, AbruptExitException {
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java b/src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java
index 931142e..ad03ceb 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java
@@ -21,7 +21,6 @@
 import com.google.devtools.build.lib.actions.Artifact;
 import com.google.devtools.build.lib.actions.CompletionContext;
 import com.google.devtools.build.lib.actions.CompletionContext.ArtifactReceiver;
-import com.google.devtools.build.lib.actions.EventReportingArtifacts;
 import com.google.devtools.build.lib.buildeventstream.ArtifactGroupNamer;
 import com.google.devtools.build.lib.buildeventstream.BuildEvent;
 import com.google.devtools.build.lib.buildeventstream.BuildEvent.LocalFile.LocalFileType;
@@ -41,7 +40,7 @@
 /**
  * A {@link BuildEvent} introducing a set of artifacts to be referred to later by its name. Those
  * events are generated by the {@link BuildEventStreamer} upon seeing an {@link
- * EventReportingArtifacts}, if necessary.
+ * com.google.devtools.build.lib.actions.EventReportingArtifacts}, if necessary.
  */
 class NamedArtifactGroup implements BuildEvent {
   private final String name;
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/ServerBuilder.java b/src/main/java/com/google/devtools/build/lib/runtime/ServerBuilder.java
index 064bdc6..a992579 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/ServerBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/ServerBuilder.java
@@ -20,7 +20,6 @@
 import com.google.devtools.build.lib.bazel.repository.downloader.Downloader;
 import com.google.devtools.build.lib.packages.PackageFactory;
 import com.google.devtools.build.lib.query2.QueryEnvironmentFactory;
-import com.google.devtools.build.lib.query2.common.AbstractBlazeQueryEnvironment;
 import com.google.devtools.build.lib.query2.engine.QueryEnvironment.QueryFunction;
 import com.google.devtools.build.lib.query2.query.output.OutputFormatter;
 import com.google.devtools.build.lib.runtime.commands.InfoItem;
@@ -107,8 +106,10 @@
   }
 
   /**
-   * Sets a factory for creating {@link AbstractBlazeQueryEnvironment} instances. Note that only one
-   * factory per server is allowed. If none is set, the server uses the default implementation.
+   * Sets a factory for creating {@link
+   * com.google.devtools.build.lib.query2.common.AbstractBlazeQueryEnvironment} instances. Note that
+   * only one factory per server is allowed. If none is set, the server uses the default
+   * implementation.
    */
   public ServerBuilder setQueryEnvironmentFactory(QueryEnvironmentFactory queryEnvironmentFactory) {
     Preconditions.checkState(
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java
index 39701de..56a580f 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java
@@ -17,7 +17,6 @@
 import com.google.devtools.build.lib.events.ExtendedEventHandler;
 import com.google.devtools.build.lib.pkgcache.PackageCacheOptions;
 import com.google.devtools.build.lib.pkgcache.PathPackageLocator;
-import com.google.devtools.build.lib.runtime.BlazeCommand;
 import com.google.devtools.build.lib.runtime.CommonCommandOptions;
 import com.google.devtools.build.lib.runtime.ProjectFile;
 import com.google.devtools.build.lib.skyframe.BazelSkyframeExecutorConstants;
@@ -31,7 +30,8 @@
 import java.util.List;
 
 /**
- * Provides support for implementations for {@link BlazeCommand} to work with {@link ProjectFile}.
+ * Provides support for implementations for {@link
+ * com.google.devtools.build.lib.runtime.BlazeCommand} to work with {@link ProjectFile}.
  */
 public final class ProjectFileSupport {
   static final String PROJECT_FILE_PREFIX = "+";