From 94760c81301ddd9facd08f2f2375eda1713c698a Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Mon, 9 Oct 2017 13:11:25 -0700 Subject: [PATCH] 8188828: Intermittent ClassNotFoundException: jdk.test.lib.Platform for compiler tests As a work around, remove dependency from jdk.test.lib.FileInstaller to other classes in this library Reviewed-by: iignatyev, gtriantafill, kvn, dholmes --- test/lib/jdk/test/lib/FileInstaller.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/lib/jdk/test/lib/FileInstaller.java b/test/lib/jdk/test/lib/FileInstaller.java index 5e16b315153..73bc23f3238 100644 --- a/test/lib/jdk/test/lib/FileInstaller.java +++ b/test/lib/jdk/test/lib/FileInstaller.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, 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 @@ -32,11 +32,18 @@ import java.nio.file.SimpleFileVisitor; import java.nio.file.StandardCopyOption; import java.nio.file.attribute.BasicFileAttributes; +// !!! +// NOTE: this class is widely used. DO NOT depend on any other classes in any test library, or else +// you may see intermittent ClassNotFoundException as in JDK-8188828 +// !!! + /** * Copy a resource: file or directory recursively, using relative path(src and dst) * which are applied to test source directory(src) and current directory(dst) */ public class FileInstaller { + public static final String TEST_SRC = System.getProperty("test.src", "").trim(); + /** * @param args source and destination * @throws IOException if an I/O error occurs @@ -45,7 +52,7 @@ public class FileInstaller { if (args.length != 2) { throw new IllegalArgumentException("Unexpected number of arguments for file copy"); } - Path src = Paths.get(Utils.TEST_SRC, args[0]).toAbsolutePath().normalize(); + Path src = Paths.get(TEST_SRC, args[0]).toAbsolutePath().normalize(); Path dst = Paths.get(args[1]).toAbsolutePath().normalize(); if (src.toFile().exists()) { System.out.printf("copying %s to %s%n", src, dst);