src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java
changeset 59226 a0f39cc47387
parent 58863 c16ac7a2eba4
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java	Fri Nov 22 09:06:35 2019 -0500
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java	Fri Nov 22 17:20:43 2019 +0100
@@ -85,6 +85,7 @@
             if (!SecuritySupport.existDirectory(repository)) {
                 this.repository = createRepository(baseLocation);
                 jvm.setRepositoryLocation(repository.toString());
+                SecuritySupport.setProperty(JFR_REPOSITORY_LOCATION_PROPERTY, repository.toString());
                 cleanupDirectories.add(repository);
             }
             return new RepositoryChunk(repository, timestamp);
@@ -115,9 +116,7 @@
         if (i == MAX_REPO_CREATION_RETRIES) {
             throw new IOException("Unable to create JFR repository directory using base location (" + basePath + ")");
         }
-        SafePath canonicalRepositoryPath = SecuritySupport.toRealPath(f);
-        SecuritySupport.setProperty(JFR_REPOSITORY_LOCATION_PROPERTY, canonicalRepositoryPath.toString());
-        return canonicalRepositoryPath;
+        return SecuritySupport.toRealPath(f);
     }
 
     private static SafePath createRealBasePath(SafePath safePath) throws IOException {