8152897: refactor ToolBox to allow reduced documented dependencies

Reviewed-by: vromero
This commit is contained in:
Jonathan Gibbons 2016-03-31 15:20:50 -07:00
parent 208d93e110
commit 7812306bc0
212 changed files with 3955 additions and 3485 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2016, 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
@ -28,21 +28,24 @@
* @library /tools/lib
* @modules jdk.jdeps/com.sun.tools.classfile
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.file
* jdk.compiler/com.sun.tools.javac.main
* jdk.jdeps/com.sun.tools.javap
* @build ToolBox
* @build toolbox.ToolBox toolbox.JavacTask
* @run main TestNonSerializableLambdaNameStability
*/
import com.sun.tools.classfile.ClassFile;
import com.sun.tools.classfile.Method;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import javax.tools.StandardLocation;
import com.sun.tools.classfile.ClassFile;
import com.sun.tools.classfile.Method;
import toolbox.JavacTask;
import toolbox.ToolBox;
public class TestNonSerializableLambdaNameStability {
public static void main(String... args) throws Exception {
@ -71,12 +74,12 @@ public class TestNonSerializableLambdaNameStability {
ToolBox tb = new ToolBox();
try (ToolBox.MemoryFileManager fm = new ToolBox.MemoryFileManager()) {
tb.new JavacTask()
new JavacTask(tb)
.sources(sources.toArray(new String[sources.size()]))
.fileManager(fm)
.run();
for (String file : fm.files.get(StandardLocation.CLASS_OUTPUT).keySet()) {
for (String file : fm.getFileNames(StandardLocation.CLASS_OUTPUT)) {
byte[] fileBytes = fm.getFileBytes(StandardLocation.CLASS_OUTPUT, file);
try (InputStream in = new ByteArrayInputStream(fileBytes)) {
boolean foundLambdaMethod = false;