Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8249586: Test runtime/cds/appcds/DirClasspathTest.java will fail if r…
…un twice

Add the StandardCopyOption.REPLACE_EXISTING option when calling Files.copy().

Reviewed-by: iklam
  • Loading branch information
calvinccheung committed Aug 4, 2020
1 parent 41a8bfd commit c935976db509f231a210bab99256d7814e03efd4
Showing 1 changed file with 3 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, 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
@@ -38,6 +38,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Arrays;

public class DirClasspathTest {
@@ -118,7 +119,7 @@ public static void main(String[] args) throws Exception {
// Long path to non-empty dir in -cp: should report error if a class is loaded from it
File srcClass = new File(classDir.toFile(), "Super.class");
File destClass = new File(longDir, "Super.class");
Files.copy(srcClass.toPath(), destClass.toPath());
Files.copy(srcClass.toPath(), destClass.toPath(), StandardCopyOption.REPLACE_EXISTING);
output = doDump(longDir.getPath(), appClassList2, "-Xlog:class+path=info");
output.shouldNotHaveExitValue(0);
output.shouldContain("Cannot have non-empty directory in paths");

0 comments on commit c935976

Please sign in to comment.