Update Guava to version 30.1.1-jre

Fixes: 199039678
Bug: 176783536
Change-Id: Id4f031f188b381c14ad22ce16bb8662ea3047fe6
diff --git a/LIBRARY-LICENSE b/LIBRARY-LICENSE
index 58b6798..adf291d 100644
--- a/LIBRARY-LICENSE
+++ b/LIBRARY-LICENSE
@@ -3,6 +3,19 @@
   copyrightHolder: The Guava Authors
   license: The Apache Software License, Version 2.0
   licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
+  url: https://github.com/google/guava
+- artifact: com.google.guava:failureaccess:+
+  name: Guava InternalFutureFailureAccess and InternalFutures
+  copyrightHolder: The Guava Authors
+  license: The Apache Software License, Version 2.0
+  licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
+  url: https://github.com/google/guava
+- artifact: com.google.guava:listenablefuture
+  name: Guava ListenableFuture only
+  copyrightHolder: The Guava Authors
+  license: The Apache Software License, Version 2.0
+  licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
+  url: https://github.com/google/guava
 - artifact: com.google.code.gson:gson:+
   name: Gson
   license: The Apache Software License, Version 2.0
@@ -72,3 +85,9 @@
   license: The Apache Software License, Version 2.0
   licenseUrl: http://www.apache.org/licenses/LICENSE-2.0.txt
   url: http://www.jetbrains.org
+- artifact: org.checkerframework:checker-qual
+  name: Checker Qual
+  copyrightHolder: Checker Framework developers
+  license: The MIT License
+  licenseUrl: http://opensource.org/licenses/MIT
+  url: https://github.com/typetools/checker-framework.git
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index eefc425..dae28e0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -38,7 +38,7 @@
     asmVersion = '9.2'  // When updating update tools/asmifier.py and Toolhelper as well.
     espressoVersion = '3.0.0'
     fastutilVersion = '7.2.0'
-    guavaVersion = '23.0'
+    guavaVersion = '30.1.1-jre'
     joptSimpleVersion = '4.6'
     gsonVersion = '2.7'
     junitVersion = '4.13-beta-2'
@@ -748,6 +748,7 @@
     mergeServiceFiles(it)
     exclude { it.getRelativePath().getPathString().endsWith("module-info.class") }
     exclude { it.getRelativePath().getPathString().startsWith("META-INF/maven/") }
+    exclude { it.getRelativePath().getPathString().equals("META-INF/LICENSE.txt") }
     baseName 'deps_all'
 }
 
@@ -816,7 +817,9 @@
                 "--map",
                 "org.jetbrains->com.android.tools.r8.org.jetbrains",
                 "--map",
-                "org.intellij->com.android.tools.r8.org.intellij"
+                "org.intellij->com.android.tools.r8.org.intellij",
+                "--map",
+                "org.checkerframework->com.android.tools.r8.org.checkerframework"
         ])
     }
 }
diff --git a/src/main/dontwarn.txt b/src/main/dontwarn.txt
index 42afa1d..e217663 100644
--- a/src/main/dontwarn.txt
+++ b/src/main/dontwarn.txt
@@ -1,4 +1,3 @@
 # TODO(b/176783536): Avoid need to use -dontwarn.
 -dontwarn com.google.errorprone.annotations.**
 -dontwarn com.google.j2objc.annotations.*
--dontwarn javax.annotation.Nullable
diff --git a/src/test/java/com/android/tools/r8/R8RunArtTestsTest.java b/src/test/java/com/android/tools/r8/R8RunArtTestsTest.java
index fbf3878..2af9e9a 100644
--- a/src/test/java/com/android/tools/r8/R8RunArtTestsTest.java
+++ b/src/test/java/com/android/tools/r8/R8RunArtTestsTest.java
@@ -31,6 +31,7 @@
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableListMultimap;
 import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
 import com.google.common.collect.Multimap;
 import com.google.common.collect.ObjectArrays;
 import com.google.common.collect.Sets;
@@ -57,6 +58,7 @@
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
 import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
 import org.junit.ComparisonFailure;
 import org.junit.Rule;
 import org.junit.rules.ExpectedException;
@@ -2480,9 +2482,15 @@
     }
     return ObjectArrays.concat(
         files,
-        com.google.common.io.Files.fileTreeTraverser().breadthFirstTraversal(directory)
-            .filter(f -> !f.isDirectory())
-            .toArray(File.class),
+        Iterables.toArray(
+            StreamSupport.stream(
+                    com.google.common.io.Files.fileTraverser()
+                        .breadthFirst(directory)
+                        .spliterator(),
+                    false)
+                .filter(f -> !f.isDirectory())
+                .collect(Collectors.toList()),
+            File.class),
         File.class);
   }
 
diff --git a/src/test/java/com/android/tools/r8/cf/bootstrap/BootstrapTest.java b/src/test/java/com/android/tools/r8/cf/bootstrap/BootstrapTest.java
index 409236d..acbd210 100644
--- a/src/test/java/com/android/tools/r8/cf/bootstrap/BootstrapTest.java
+++ b/src/test/java/com/android/tools/r8/cf/bootstrap/BootstrapTest.java
@@ -14,8 +14,10 @@
 import com.android.tools.r8.TestParametersCollection;
 import com.android.tools.r8.ToolHelper;
 import com.android.tools.r8.ToolHelper.ProcessResult;
+import com.android.tools.r8.origin.Origin;
 import com.android.tools.r8.utils.FileUtils;
 import com.google.common.base.Charsets;
+import com.google.common.collect.ImmutableList;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import org.junit.Test;
@@ -113,6 +115,10 @@
             .setProgramConsumer(new ClassFileConsumer.ArchiveConsumer(outputJar, true))
             .addProgramFiles(R8_STABLE_JAR)
             .addProguardConfigurationFiles(pgConfigFile, DONTWARN_R8)
+            // The R8_STABLE_JAR is from when Guava 23.0 was used, and that included
+            // javax.annotation.Nullable annotations in the retained code.
+            .addProguardConfiguration(
+                ImmutableList.of("-dontwarn javax.annotation.Nullable"), Origin.unknown())
             .build());
     return outputJar;
   }