From d1926144eb2e10a05bcbb82aa9d42dfeab51ac06 Mon Sep 17 00:00:00 2001 From: jiefu Date: Fri, 29 Mar 2019 18:25:39 -0700 Subject: [PATCH] 8221596: test/hotspot/jtreg/runtime/containers/docker/TestCPUSets.java failed with FileAlreadyExistsException Using StandardCopyOption.REPLACE_EXISTING to copy whitebox.jar Reviewed-by: dholmes, mseledtsov --- test/lib/jdk/test/lib/containers/docker/Common.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/lib/jdk/test/lib/containers/docker/Common.java b/test/lib/jdk/test/lib/containers/docker/Common.java index 498eaca19c0..ab791feb13f 100644 --- a/test/lib/jdk/test/lib/containers/docker/Common.java +++ b/test/lib/jdk/test/lib/containers/docker/Common.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2019, 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 @@ -30,6 +30,7 @@ package jdk.test.lib.containers.docker; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; import jdk.test.lib.containers.docker.DockerRunOptions; import jdk.test.lib.containers.docker.DockerTestUtils; import jdk.test.lib.Utils; @@ -46,7 +47,7 @@ public class Common { public static void prepareWhiteBox() throws Exception { Files.copy(Paths.get(new File("whitebox.jar").getAbsolutePath()), - Paths.get(Utils.TEST_CLASSES, "whitebox.jar")); + Paths.get(Utils.TEST_CLASSES, "whitebox.jar"), StandardCopyOption.REPLACE_EXISTING); }