[2/3] Remove the term "sanity" in comments.

Code references are not changed.

PiperOrigin-RevId: 336215348
diff --git a/src/java_tools/junitrunner/java/com/google/testing/coverage/ClassProbesMapper.java b/src/java_tools/junitrunner/java/com/google/testing/coverage/ClassProbesMapper.java
index ed65bf1..f682781 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/coverage/ClassProbesMapper.java
+++ b/src/java_tools/junitrunner/java/com/google/testing/coverage/ClassProbesMapper.java
@@ -54,6 +54,6 @@
 
   @Override
   public void visitTotalProbeCount(int count) {
-    // Nothing to do. Maybe perform some sanity checks here.
+    // Nothing to do. Maybe perform some checks here.
   }
 }
diff --git a/src/main/java/com/google/devtools/build/lib/graph/Digraph.java b/src/main/java/com/google/devtools/build/lib/graph/Digraph.java
index 1e51665..bb2c67e 100644
--- a/src/main/java/com/google/devtools/build/lib/graph/Digraph.java
+++ b/src/main/java/com/google/devtools/build/lib/graph/Digraph.java
@@ -80,9 +80,8 @@
   public Digraph() {}
 
   /**
-   * Sanity-check: assert that a node is indeed a member of this graph and not
-   * another one.  Perform this check whenever a function is supplied a node by
-   * the user.
+   * Check that a node is indeed a member of this graph and not another one. Perform this check
+   * whenever a function is supplied a node by the user.
    */
   private final void checkNode(Node<T> node) {
     if (getNode(node.getLabel()) != node) {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AarImport.java b/src/main/java/com/google/devtools/build/lib/rules/android/AarImport.java
index 56d88f3..1a7f278 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AarImport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AarImport.java
@@ -121,9 +121,9 @@
     ResourceApk resourceApk = ResourceApk.of(validatedResources, mergedAssets, null, null);
 
     // There isn't really any use case for building an aar_import target on its own, so the files to
-    // build could be empty. The R class JAR and merged JARs are added here as a sanity check for
-    // Bazel developers so that `bazel build java/com/my_aar_import` will fail if the resource
-    // processing or JAR merging steps fail.
+    // build could be empty. The R class JAR and merged JARs are added here as a check for Bazel
+    // developers so that `bazel build java/com/my_aar_import` will fail if the resource processing
+    // or JAR merging steps fail.
     NestedSet<Artifact> filesToBuild =
         NestedSetBuilder.<Artifact>stableOrder()
             .add(resourceApk.getValidatedResources().getJavaClassJar())
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java b/src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java
index bfd0c51..14b2078 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java
@@ -222,7 +222,7 @@
         for (String arg : rcArgs.getArgs()) {
           expansion.add(arg);
           if (arg.length() >= 8 && arg.substring(0, 8).equals("--config")) {
-            // We have a config. For sanity, because we don't want to worry about formatting,
+            // We have a config. Because we don't want to worry about formatting,
             // we will only accept --config=value, and will not accept value on a following line.
             int charOfConfigValue = arg.indexOf('=');
             if (charOfConfigValue < 0) {
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java b/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
index a4a11e1..ec30e22 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
@@ -861,11 +861,11 @@
   }
 
   /**
-   * Reads the given file {@code path}, assumed to have size {@code fileSize}, and does a sanity
-   * check on the number of bytes read.
+   * Reads the given file {@code path}, assumed to have size {@code fileSize}, and does a check on
+   * the number of bytes read.
    *
-   * <p>Use this method when you already know the size of the file. The sanity check is intended to
-   * catch issues where filesystems incorrectly truncate files.
+   * <p>Use this method when you already know the size of the file. The check is intended to catch
+   * issues where filesystems incorrectly truncate files.
    *
    * @throws IOException if there was an error, or if fewer than {@code fileSize} bytes were read.
    */
diff --git a/src/main/java/com/google/devtools/build/skyframe/NodeEntry.java b/src/main/java/com/google/devtools/build/skyframe/NodeEntry.java
index dc48fe8..82f3696 100644
--- a/src/main/java/com/google/devtools/build/skyframe/NodeEntry.java
+++ b/src/main/java/com/google/devtools/build/skyframe/NodeEntry.java
@@ -83,7 +83,7 @@
     /**
      * A forced rebuilding is in progress, likely because of a transient error on the previous build
      * or a recoverable inconsistency in the current one. The distinction between this and {@link
-     * #REBUILDING} is only needed for internal sanity checks.
+     * #REBUILDING} is only needed for internal checks.
      */
     FORCED_REBUILDING
   }
@@ -433,14 +433,14 @@
 
   /** Which edges a done NodeEntry stores (dependencies and/or reverse dependencies. */
   enum KeepEdgesPolicy {
-    /** Both deps and rdeps are stored. Incremental builds and sanity checks are possible. */
+    /** Both deps and rdeps are stored. Incremental builds and checking are possible. */
     ALL,
     /**
      * Only deps are stored. Incremental builds may be possible with a "top-down" evaluation
-     * framework. Sanity checking of reverse deps is not possible.
+     * framework. Checking of reverse deps is not possible.
      */
     JUST_DEPS,
-    /** Neither deps nor rdeps are stored. Incremental builds and sanity checking are disabled. */
+    /** Neither deps nor rdeps are stored. Incremental builds and checking are disabled. */
     NONE
   }
 }
diff --git a/src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java b/src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java
index db26e64..0e4420d 100644
--- a/src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java
+++ b/src/main/java/com/google/devtools/common/options/InvocationPolicyEnforcer.java
@@ -415,7 +415,7 @@
       List<String> subflagValue,
       OptionInstanceOrigin subflagOrigin,
       FlagPolicyWithContext originalPolicy) {
-    // Some sanity checks.
+    // Some checks.
     OptionDefinition subflag = subflagDesc.getOptionDefinition();
     Verify.verify(originalPolicy.policy.getOperationCase().equals(OperationCase.SET_VALUE));
     if (!subflag.allowsMultiple()) {
diff --git a/src/main/java/com/google/devtools/common/options/OptionPriority.java b/src/main/java/com/google/devtools/common/options/OptionPriority.java
index 8d669a8..ca004aa 100644
--- a/src/main/java/com/google/devtools/common/options/OptionPriority.java
+++ b/src/main/java/com/google/devtools/common/options/OptionPriority.java
@@ -76,7 +76,7 @@
   public static OptionPriority getChildPriority(OptionPriority parentPriority)
       throws OptionsParsingException {
     if (parentPriority.alreadyExpanded) {
-      // TODO(bazel-team): Either tighten sanity check or prevent multiple
+      // TODO(bazel-team): Either tighten check or prevent multiple
       // expansions when implicit requirements are set.
       logger.atWarning().log("Tried to expand option too many times.");
     }
diff --git a/src/test/java/com/google/devtools/build/android/desugar/DesugarFunctionalTest.java b/src/test/java/com/google/devtools/build/android/desugar/DesugarFunctionalTest.java
index d34fb94..a5b2f87 100644
--- a/src/test/java/com/google/devtools/build/android/desugar/DesugarFunctionalTest.java
+++ b/src/test/java/com/google/devtools/build/android/desugar/DesugarFunctionalTest.java
@@ -178,7 +178,7 @@
         new MethodReferenceInSubclass(ImmutableList.of("Sergey", "Larry", "Alex"));
     assertThat(methodrefUse.containsE()).containsExactly("Sergey", "Alex");
     assertThat(methodrefUse.startsWithL()).containsExactly("Larry");
-    // Test sanity: make sure sub- and superclass have bridge methods with matching descriptors but
+    // Check to make sure sub- and superclass have bridge methods with matching descriptors but
     // different names
     Method superclassBridge = findOnlyBridge(MethodReferenceSuperclass.class);
     Method subclassBridge = findOnlyBridge(MethodReferenceInSubclass.class);
@@ -285,7 +285,7 @@
     // Expect String apply(Number) and any expected bridges
     assertThat(ConcreteFunction.toInt().getClass().getDeclaredMethods())
         .hasLength(expectedBridgesFromSameTarget + 1);
-    // Sanity check that we only copied over methods, no fields, from the functional interface
+    // Check that we only copied over methods, no fields, from the functional interface
     assertThrows(
         NoSuchFieldException.class,
         () ->
@@ -293,7 +293,7 @@
                 .getClass()
                 .getDeclaredField("DO_NOT_COPY_INTO_LAMBDA_CLASSES"));
     assertThat(SpecializedFunction.class.getDeclaredField("DO_NOT_COPY_INTO_LAMBDA_CLASSES"))
-        .isNotNull(); // test sanity
+        .isNotNull();
   }
 
   /** Tests lambdas with bridge methods when the implemented interface is in a separate target. */
@@ -317,7 +317,7 @@
         .isEqualTo(expectLambdaMethodsInInterfaces);
   }
 
-  /** Sanity-checks that the resource file included in the original Jar is still there unchanged. */
+  /** Checks that the resource file included in the original Jar is still there unchanged. */
   @Test
   public void testResourcePreserved() throws Exception {
     try (InputStream content = Lambda.class.getResource("testresource.txt").openStream()) {
diff --git a/src/test/java/com/google/devtools/build/android/dexer/DexConversionEnqueuerTest.java b/src/test/java/com/google/devtools/build/android/dexer/DexConversionEnqueuerTest.java
index ef9c012..fb2096f 100644
--- a/src/test/java/com/google/devtools/build/android/dexer/DexConversionEnqueuerTest.java
+++ b/src/test/java/com/google/devtools/build/android/dexer/DexConversionEnqueuerTest.java
@@ -88,7 +88,7 @@
   @Test
   public void testDirectory_copyEmptyBuffer() throws Exception {
     ZipEntry entry = newZipEntry("dir/", 0);
-    assertThat(entry.isDirectory()).isTrue(); // test sanity
+    assertThat(entry.isDirectory()).isTrue();
     mockEntries(entry);
 
     stuffer.call();
@@ -167,7 +167,7 @@
     byte[] bytecode = ByteStreams.toByteArray(
         Thread.currentThread().getContextClassLoader().getResourceAsStream(filename));
     ZipEntry entry = newZipEntry(filename, bytecode.length);
-    assertThat(entry.isDirectory()).isFalse(); // test sanity
+    assertThat(entry.isDirectory()).isFalse();
     mockEntries(entry);
     when(zip.getInputStream(entry)).thenReturn(new ByteArrayInputStream(bytecode));
     return bytecode;
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/ActionTester.java b/src/test/java/com/google/devtools/build/lib/analysis/util/ActionTester.java
index 81e79fe..047480a 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/util/ActionTester.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/util/ActionTester.java
@@ -102,7 +102,7 @@
         firstAction = action;
       }
     }
-    // Sanity check that the count is correct.
+    // Check that the count is correct.
     assertThat(
             Actions.canBeShared(
                 actionKeyContext,
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java
index 81c9356..570214b 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java
@@ -1780,7 +1780,7 @@
     assertThat(getFirstArtifactEndingWith(linkAction.getInputs(),
         "package/libDylib2Lib.a")).isNull();
 
-    // Sanity check that the identical binary without dylibs would be fully linked.
+    // Check that the identical binary without dylibs would be fully linked.
     Action alternateLipobinAction = lipoBinAction("//package:alternate");
     Artifact alternateBinArtifact = getFirstArtifactEndingWith(alternateLipobinAction.getInputs(),
         "package/alternate_bin");
diff --git a/src/test/java/com/google/devtools/build/lib/testutil/BazelPackageLoadingListenerForTesting.java b/src/test/java/com/google/devtools/build/lib/testutil/BazelPackageLoadingListenerForTesting.java
index bd45785..95bc84b 100644
--- a/src/test/java/com/google/devtools/build/lib/testutil/BazelPackageLoadingListenerForTesting.java
+++ b/src/test/java/com/google/devtools/build/lib/testutil/BazelPackageLoadingListenerForTesting.java
@@ -30,8 +30,8 @@
 import net.starlark.java.eval.StarlarkSemantics;
 
 /**
- * A {@link PackageLoadingListener} for use in tests that a sanity check with {@link
- * BazelPackageLoader} for each loaded package, for the sake of getting pretty nice test coverage.
+ * A {@link PackageLoadingListener} for use in tests that a check with {@link BazelPackageLoader}
+ * for each loaded package, for the sake of getting pretty nice test coverage.
  */
 public class BazelPackageLoadingListenerForTesting implements PackageLoadingListener {
   private final ConfiguredRuleClassProvider ruleClassProvider;
diff --git a/src/test/java/com/google/devtools/build/skyframe/GraphTest.java b/src/test/java/com/google/devtools/build/skyframe/GraphTest.java
index 8229603..1445f18 100644
--- a/src/test/java/com/google/devtools/build/skyframe/GraphTest.java
+++ b/src/test/java/com/google/devtools/build/skyframe/GraphTest.java
@@ -40,7 +40,7 @@
 import org.junit.Before;
 import org.junit.Test;
 
-/** Base class for sanity tests on {@link EvaluableGraph} implementations. */
+/** Base class for tests on {@link EvaluableGraph} implementations. */
 public abstract class GraphTest {
   protected ProcessableGraph graph;
   protected TestRunnableWrapper wrapper;
diff --git a/src/test/shell/bazel/python_version_test.sh b/src/test/shell/bazel/python_version_test.sh
index 251e83e..523534c 100755
--- a/src/test/shell/bazel/python_version_test.sh
+++ b/src/test/shell/bazel/python_version_test.sh
@@ -67,7 +67,7 @@
 
 #### TESTS #############################################################
 
-# Sanity test that our environment setup works.
+# Check that our environment setup works.
 function test_can_run_py_binaries() {
   mkdir -p test
 
diff --git a/src/test/shell/bazel/workspace_test.sh b/src/test/shell/bazel/workspace_test.sh
index c8bc513..cdd2cab 100755
--- a/src/test/shell/bazel/workspace_test.sh
+++ b/src/test/shell/bazel/workspace_test.sh
@@ -187,7 +187,7 @@
 
   MARKER="<== Starlark flag test ==>"
 
-  # Sanity check.
+  # Initial check.
   bazel build //:x &>"$TEST_log" \
     || fail "Expected build to succeed"
   expect_log "In workspace: " "Did not find workspace print output"
diff --git a/src/test/shell/integration/build_event_stream_test.sh b/src/test/shell/integration/build_event_stream_test.sh
index 9c7ef34..efb1acc 100755
--- a/src/test/shell/integration/build_event_stream_test.sh
+++ b/src/test/shell/integration/build_event_stream_test.sh
@@ -501,7 +501,7 @@
 }
 
 function test_test_attempts_multi_runs() {
-  # Sanity check on individual test attempts. Even in more complicated
+  # Check individual test attempts. Even in more complicated
   # situations, with some test rerun and some not, all events are properly
   # announced by the test actions (and not chained into the progress events).
   ( bazel test --build_event_text_file=$TEST_log \
@@ -513,7 +513,7 @@
 }
 
 function test_test_attempts_multi_runs_flake_detection() {
-  # Sanity check on individual test attempts. Even in more complicated
+  # Check individual test attempts. Even in more complicated
   # situations, with some test rerun and some not, all events are properly
   # announced by the test actions (and not chained into the progress events).
   ( bazel test --build_event_text_file=$TEST_log \
@@ -1025,7 +1025,7 @@
   bazel build --experimental_tool_command_line="foo bar" --build_event_text_file=$TEST_log \
     || fail "build failed"
 
-  # Sanity check the arglist
+  # Check the arglist
   expect_log_once 'args: "build"'
   expect_log_once 'args: "--experimental_tool_command_line='
 
diff --git a/src/test/shell/integration/run_test.sh b/src/test/shell/integration/run_test.sh
index 6539e9f..d75ce4b 100755
--- a/src/test/shell/integration/run_test.sh
+++ b/src/test/shell/integration/run_test.sh
@@ -472,7 +472,7 @@
     # Translate from `/*` to a windows path.
     tmpdir="$(cygpath -m "${tmpdir}")"
   fi
-  # Sanity check to ensure we execute the intended scenario.
+  # Check that we execute the intended scenario.
   if [[ "${tmpdir}" == "${TEST_TMPDIR}"* ]]; then
     fail "Temp folder potentially overlaps with the exec root"
   fi
diff --git a/src/tools/android/java/com/google/devtools/build/android/PlaceholderIdFieldInitializerBuilder.java b/src/tools/android/java/com/google/devtools/build/android/PlaceholderIdFieldInitializerBuilder.java
index 36d3af2..4841eb4 100644
--- a/src/tools/android/java/com/google/devtools/build/android/PlaceholderIdFieldInitializerBuilder.java
+++ b/src/tools/android/java/com/google/devtools/build/android/PlaceholderIdFieldInitializerBuilder.java
@@ -263,7 +263,7 @@
         nextTypeId = nextFreeId(nextTypeId + 1, reservedTypeSlots);
       }
     }
-    // Sanity check that everything has been assigned, except STYLEABLE. There shouldn't be
+    // Check that everything has been assigned, except STYLEABLE. There shouldn't be
     // anything of type PUBLIC either (since that isn't a real resource).
     // We will need to update the list if there is a new resource type.
     for (ResourceType t : innerClasses.keySet()) {
diff --git a/src/tools/singlejar/input_jar.cc b/src/tools/singlejar/input_jar.cc
index ac6433b..4b3deb9 100644
--- a/src/tools/singlejar/input_jar.cc
+++ b/src/tools/singlejar/input_jar.cc
@@ -73,7 +73,7 @@
    * until we find ECD64.  We assume that the custom data is missing.
    */
 
-  // First, sanity checks.
+  // First, consistency check the directory.
   uint32_t cen_position = ecd->cen_offset32();
   if (!ziph::zfield_has_ext64(cen_position)) {
     if (!mapped_file_.mapped(mapped_file_.address(cen_position))) {