Upgrade jimfs to v1.2. am: 047cfe3604 am: 44bee9650f am: 6e5c098a23

Original change: https://android-review.googlesource.com/c/platform/external/jimfs/+/2283353

Change-Id: I6c338dc10df90c604682827b333be4edbfe9a95c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..b76b895
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,10 @@
+version: 2
+updates:
+  - package-ecosystem: "maven"
+    directory: "/"
+    schedule:
+      interval: "daily"
+  - package-ecosystem: "github-actions"
+    directory: "/"
+    schedule:
+      interval: "daily"
diff --git a/.travis.yml b/.travis.yml
index 0923403..338c662 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -24,7 +24,6 @@
     - secure: "bTcwsovwxPXplZysfwgNkTR3hfHjb7UvWMlxeEkHHt3GQiZxIDKkiJbgW2mHAG/e/H0wfKQyujeCgQwxn1fa5ttR+UbGz+TIIY2tgjpIFkSbBRzlNGOO0Y23wQpFXXUv3lAY//cV1pa0HlCz+IWNq7ZqPZAoReDAkxExbbmydtE="
     - secure: "JZnVEfpNSCLBZQg1MP7MuhzP9H8t2gGUU4salm5VsRKck27fgg1HwBxADolcVeON2k+2masSKLEQPkeYQizc/VN5hZsCZpTgYjuMke1ZLe1v0KsIdH3Rdt77fhhTqiT1BEkMV8tlBwiraYZz+41iLo+Ug5yjgfmXXayDjYm4h4w="
 
-
 branches:
   only:
     - master
diff --git a/METADATA b/METADATA
index 5e2f5a7..a237623 100644
--- a/METADATA
+++ b/METADATA
@@ -16,7 +16,7 @@
     type: GIT
     value: "https://github.com/google/jimfs.git"
   }
-  version: "v1.1"
-  last_upgrade_date { year: 2019 month: 12 day: 18 }
+  version: "v1.2"
+  last_upgrade_date { year: 2022 month: 11 day: 2 }
   license_type: NOTICE
 }
diff --git a/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java b/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java
index 7c6b115..9d18837 100644
--- a/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java
+++ b/jimfs/src/main/java/com/google/common/jimfs/JimfsPath.java
@@ -251,11 +251,7 @@
 
   /** Resolves the given name against this path. The name is assumed not to be a root name. */
   JimfsPath resolve(Name name) {
-    if (name.toString().isEmpty()) {
-      return this;
-    }
-    return pathService.createPathInternal(
-        root, ImmutableList.<Name>builder().addAll(names).add(name).build());
+    return resolve(pathService.createFileName(name));
   }
 
   @Override
diff --git a/jimfs/src/main/java/com/google/common/jimfs/PathService.java b/jimfs/src/main/java/com/google/common/jimfs/PathService.java
index 49717bd..2bd11a7 100644
--- a/jimfs/src/main/java/com/google/common/jimfs/PathService.java
+++ b/jimfs/src/main/java/com/google/common/jimfs/PathService.java
@@ -19,7 +19,6 @@
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.jimfs.PathType.ParseResult;
 import static java.nio.file.LinkOption.NOFOLLOW_LINKS;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -31,6 +30,7 @@
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Ordering;
+import com.google.common.jimfs.PathType.ParseResult;
 import java.net.URI;
 import java.nio.file.FileSystem;
 import java.nio.file.Files;
diff --git a/jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java b/jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java
index 217509d..1fee1e5 100644
--- a/jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java
+++ b/jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java
@@ -217,7 +217,7 @@
 
     /*
      * If we inline this into the assertThat call below, javac resolves it to assertThat(SortedSet),
-     * which isn't available publicly. Our @GoogleInternal checks consider that to be an error, even
+     * which isn't available publicly. Our internal build system considers that to be an error, even
      * though the code will compile fine externally by resolving to assertThat(Iterable) instead. So
      * we avoid that by assigning to a non-SortedSet type here.
      */
diff --git a/jimfs/src/test/java/com/google/common/jimfs/JimfsPathTest.java b/jimfs/src/test/java/com/google/common/jimfs/JimfsPathTest.java
index da7d43c..5b59081 100644
--- a/jimfs/src/test/java/com/google/common/jimfs/JimfsPathTest.java
+++ b/jimfs/src/test/java/com/google/common/jimfs/JimfsPathTest.java
@@ -219,6 +219,17 @@
   }
 
   @Test
+  public void testResolveName_againstEmptyPath() {
+    // resolve(Name) is only used in the DirectoryStream implementation, so it's only used to
+    // resolve the names of real existing files against some base directory's path. The base
+    // directory path could be the working directory path (i.e. just an empty string), in which case
+    // we need to be sure to return a path that is just the name of the file as opposed a path with
+    // two names, one being the empty string and the other the file name).
+    // See https://github.com/google/jimfs/issues/105
+    assertPathEquals("foo", pathService.emptyPath().resolve(Name.simple("foo")));
+  }
+
+  @Test
   public void testResolveSibling_givenEmptyPath() {
     Path path = pathService.parsePath("foo/bar");
     Path resolved = path.resolveSibling("");
diff --git a/pom.xml b/pom.xml
index d35a4c3..eed6efd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,11 +19,6 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.sonatype.oss</groupId>
-    <artifactId>oss-parent</artifactId>
-    <version>7</version>
-  </parent>
 
   <groupId>com.google.jimfs</groupId>
   <artifactId>jimfs-parent</artifactId>
@@ -84,19 +79,31 @@
     <url>http://github.com/google/jimfs/issues</url>
   </issueManagement>
 
+  <distributionManagement>
+    <snapshotRepository>
+      <id>sonatype-nexus-snapshots</id>
+      <name>Sonatype Nexus Snapshots</name>
+      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+    </snapshotRepository>
+    <repository>
+      <id>sonatype-nexus-staging</id>
+      <name>Nexus Release Repository</name>
+      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+    </repository>
+  </distributionManagement>
+
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <auto-service.version>1.0-rc6</auto-service.version>
+    <auto-service.version>1.0-rc7</auto-service.version>
     <java.version>1.7</java.version>
-    <guava.version>27.0.1-android</guava.version>
-    <surefire.version>3.0.0-M3</surefire.version>
+    <guava.version>30.1-android</guava.version>
     <!--
       NOTE: When updating errorprone.version, also update javac.version to the
       version used by the new error-prone version. You should be able to find
       it in the properties section of
       https://github.com/google/error-prone/blob/v${errorprone.version}/pom.xml
       -->
-    <errorprone.version>2.3.3</errorprone.version>
+    <errorprone.version>2.4.0</errorprone.version>
     <javac.version>9+181-r4173-1</javac.version>
   </properties>
 
@@ -113,7 +120,7 @@
       <dependency>
         <groupId>com.ibm.icu</groupId>
         <artifactId>icu4j</artifactId>
-        <version>65.1</version>
+        <version>68.2</version>
       </dependency>
 
       <!-- Compile-time dependencies -->
@@ -137,7 +144,7 @@
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
-        <version>4.12</version>
+        <version>4.13.1</version>
         <scope>test</scope>
       </dependency>
       <dependency>
@@ -149,7 +156,7 @@
       <dependency>
         <groupId>com.google.truth</groupId>
         <artifactId>truth</artifactId>
-        <version>0.45</version>
+        <version>1.1</version>
         <scope>test</scope>
       </dependency>
     </dependencies>
@@ -164,11 +171,11 @@
         </plugin>
         <plugin>
           <artifactId>maven-source-plugin</artifactId>
-          <version>3.0.1</version>
+          <version>3.2.1</version>
         </plugin>
         <plugin>
           <artifactId>maven-javadoc-plugin</artifactId>
-          <version>3.1.1</version>
+          <version>3.2.0</version>
           <configuration>
             <debug>true</debug>
             <encoding>UTF-8</encoding>
@@ -190,20 +197,12 @@
         </plugin>
         <plugin>
           <artifactId>maven-surefire-plugin</artifactId>
-          <version>${surefire.version}</version>
-          <!-- For some reason, we need this for our internal tests that run in offline mode: -->
-          <dependencies>
-            <dependency>
-              <groupId>org.apache.maven.surefire</groupId>
-              <artifactId>surefire-junit4</artifactId>
-              <version>${surefire.version}</version>
-            </dependency>
-          </dependencies>
+          <version>3.0.0-M5</version>
         </plugin>
         <plugin>
           <groupId>org.apache.felix</groupId>
           <artifactId>maven-bundle-plugin</artifactId>
-          <version>3.5.0</version>
+          <version>5.1.1</version>
         </plugin>
       </plugins>
     </pluginManagement>
@@ -339,6 +338,50 @@
         </plugins>
       </build>
     </profile>
+    <profile>
+      <id>sonatype-oss-release</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-source-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-sources</id>
+                <goals>
+                  <goal>jar-no-fork</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-javadoc-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-javadocs</id>
+                <goals>
+                  <goal>jar</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-gpg-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>sign-artifacts</id>
+                <phase>verify</phase>
+                <goals>
+                  <goal>sign</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
 </project>
diff --git a/util/deploy_snapshot.sh b/util/deploy_snapshot.sh
index 2a2db4c..6a26f10 100755
--- a/util/deploy_snapshot.sh
+++ b/util/deploy_snapshot.sh
@@ -5,7 +5,7 @@
 set -e -u
 
 if [ "$TRAVIS_REPO_SLUG" == "google/jimfs" ] && \
-   [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \
+   [ "$TRAVIS_JDK_VERSION" == "openjdk8" ] && \
    [ "$TRAVIS_PULL_REQUEST" == "false" ] && \
    [ "$TRAVIS_BRANCH" == "master" ]; then
   echo "Publishing Maven snapshot..."