[9] RFR of 8081293: java/nio/file/Files/CopyAndMove.java failed with java.nio.file.FileAlreadyExistsException intermittently

Brian Burkhalter brian.burkhalter at oracle.com
Fri Jun 19 01:10:31 UTC 2015


Please review at your convenience.

Issue:	https://bugs.openjdk.java.net/browse/JDK-8081293
Patch:	see diff below

This is not a fix for the issue per se, the failure apparently having been observed only once from what I could tell, but a modification of the test which might aid in reproducing the problem should it recur, at which point a new issue should be filed. If this change looks to be a reasonable resolution to the issue, the label “noreg-self” would be added.

Thanks,

Brian

--- a/test/java/nio/file/Files/CopyAndMove.java
+++ b/test/java/nio/file/Files/CopyAndMove.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,9 +23,9 @@
 
 /* @test
  * @bug 4313887 6838333 6917021 7006126 6950237 8006645
- * @summary Unit test for java.nio.file.Files copy and move methods
- * @library ..
- * @build CopyAndMove PassThroughFileSystem
+ * @summary Unit test for java.nio.file.Files copy and move methods (use -Dseed=X to set PRNG seed)
+ * @library .. /lib/testlibrary/
+ * @build jdk.testlibrary.* CopyAndMove PassThroughFileSystem
  * @run main/othervm CopyAndMove
  * @key randomness
  */
@@ -39,9 +39,10 @@
 import java.io.*;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
+import jdk.testlibrary.RandomFactory;
 
 public class CopyAndMove {
-    static final Random rand = new Random();
+    static final Random rand = RandomFactory.getRandom();
     static boolean heads() { return rand.nextBoolean(); }
     private static boolean testPosixAttributes = false;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150618/d6f84af6/attachment.html>


More information about the nio-dev mailing list