8169074: Build is failing after JDK-8166538

Reverting d7c9720c4223

Reviewed-by: darcy
This commit is contained in:
Jan Lahoda 2016-11-02 20:21:45 +01:00
parent 5daafbe43b
commit 7cffceb22f
71 changed files with 114 additions and 1926 deletions

View file

@ -61,10 +61,9 @@ class Example implements Comparable<Example> {
declaredKeys = new TreeSet<String>();
srcFiles = new ArrayList<File>();
procFiles = new ArrayList<File>();
supportFiles = new ArrayList<File>();
srcPathFiles = new ArrayList<File>();
moduleSourcePathFiles = new ArrayList<File>();
modulePathFiles = new ArrayList<File>();
classPathFiles = new ArrayList<File>();
additionalFiles = new ArrayList<File>();
findFiles(file, srcFiles);
@ -90,13 +89,10 @@ class Example implements Comparable<Example> {
} else if (files == srcFiles && c.getName().equals("additional")) {
additionalFilesDir = c;
findFiles(c, additionalFiles);
} else if (files == srcFiles && c.getName().equals("modulepath")) {
findFiles(c, modulePathFiles);
} else if (files == srcFiles && c.getName().equals("classpath")) {
findFiles(c, classPathFiles);
} else {
} else if (files == srcFiles && c.getName().equals("support"))
findFiles(c, supportFiles);
else
findFiles(c, files);
}
}
} else if (f.isFile()) {
if (f.getName().endsWith(".java")) {
@ -198,32 +194,23 @@ class Example implements Comparable<Example> {
*/
private void run(PrintWriter out, Set<String> keys, boolean raw, boolean verbose)
throws IOException {
List<String> opts = new ArrayList<String>();
if (!modulePathFiles.isEmpty()) {
File modulepathDir = new File(tempDir, "modulepath");
modulepathDir.mkdirs();
clean(modulepathDir);
List<String> sOpts = Arrays.asList("-d", modulepathDir.getPath(),
"--module-source-path", new File(file, "modulepath").getAbsolutePath());
new Jsr199Compiler(verbose).run(null, null, false, sOpts, modulePathFiles);
opts.add("--module-path");
opts.add(modulepathDir.getAbsolutePath());
}
if (!classPathFiles.isEmpty()) {
File classpathDir = new File(tempDir, "classpath");
classpathDir.mkdirs();
clean(classpathDir);
List<String> sOpts = Arrays.asList("-d", classpathDir.getPath());
new Jsr199Compiler(verbose).run(null, null, false, sOpts, classPathFiles);
opts.add("--class-path");
opts.add(classpathDir.getAbsolutePath());
ClassLoader loader = getClass().getClassLoader();
if (supportFiles.size() > 0) {
File supportDir = new File(tempDir, "support");
supportDir.mkdirs();
clean(supportDir);
List<String> sOpts = Arrays.asList("-d", supportDir.getPath());
new Jsr199Compiler(verbose).run(null, null, false, sOpts, procFiles);
URLClassLoader ucl =
new URLClassLoader(new URL[] { supportDir.toURI().toURL() }, loader);
loader = ucl;
}
File classesDir = new File(tempDir, "classes");
classesDir.mkdirs();
clean(classesDir);
List<String> opts = new ArrayList<String>();
opts.add("-d");
opts.add(classesDir.getPath());
if (options != null)
@ -340,9 +327,8 @@ class Example implements Comparable<Example> {
File additionalFilesDir;
List<File> srcPathFiles;
List<File> moduleSourcePathFiles;
List<File> modulePathFiles;
List<File> classPathFiles;
List<File> additionalFiles;
List<File> supportFiles;
File infoFile;
private List<String> runOpts;
private List<String> options;