8309778: java/nio/file/Files/CopyAndMove.java fails when using second test directory

Reviewed-by: alanb
This commit is contained in:
sunyaqi 2023-06-16 06:15:55 +00:00 committed by Jie Fu
parent db133dbc02
commit cfae6ef2f6

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -909,7 +909,7 @@ public class CopyAndMove {
if (supportsLinks) { if (supportsLinks) {
source = createSourceFile(dir1); source = createSourceFile(dir1);
link = dir1.resolve("link"); link = dir1.resolve("link");
createSymbolicLink(link, source); createSymbolicLink(link, source.getFileName());
target = getTargetFile(dir2); target = getTargetFile(dir2);
copyAndVerify(link, target); copyAndVerify(link, target);
delete(link); delete(link);