< prev index next >

src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java

Print this page

        

@@ -48,12 +48,11 @@
  */
 public final class WriteableUserPath {
     private final AccessControlContext controlContext;
     private final Path original;
     private final Path real;
-    private final String realPathText;
-    private final String originalText;
+    private final String text;
 
     // Not to ensure security, but to help
     // against programming errors
     private volatile boolean inPrivileged;
 

@@ -67,13 +66,12 @@
         }
         // will throw if non-writeable
         BufferedWriter fw = Files.newBufferedWriter(path);
         fw.close();
         this.original = path;
-        this.originalText = path.toString();
         this.real = path.toRealPath();
-        this.realPathText = real.toString();
+        this.text = real.toString();
     }
 
     /**
      * Returns a potentially malicious path where the user may have implemented
      * their own version of Path. This method should never be called in an

@@ -85,29 +83,19 @@
     public Path getPotentiallyMaliciousOriginal() {
         return original;
     }
 
     /**
-     * Returns a string representation of the real path.
+     * Returns a string representation of the path.
      *
      * @return path as text
      */
-    public String getRealPathText() {
-        return realPathText;
+    public String getText() {
+        return text;
     }
 
     /**
-     * Returns a string representation of the original path.
-     *
-     * @return path as text
-     */
-    public String getOriginalText() {
-        return originalText;
-    }
-
-
-    /**
      * Returns a potentially malicious path where the user may have implemented
      * their own version of Path. This method should never be called in an
      * unsafe context and the Path value should never be passed along to other
      * methods.
      *
< prev index next >