--- a/langtools/test/tools/javac/AnonymousSubclassTest.java Thu Mar 31 14:56:33 2016 -0700
+++ b/langtools/test/tools/javac/AnonymousSubclassTest.java Thu Mar 31 15:20:50 2016 -0700
@@ -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
@@ -27,13 +27,15 @@
* @summary javac wrongly allows a subclass of an anonymous class
* @library /tools/lib
* @modules 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 AnonymousSubclassTest
*/
+import toolbox.JavacTask;
+import toolbox.Task;
+import toolbox.ToolBox;
+
public class AnonymousSubclassTest {
public static void main(String... args) throws Exception {
new AnonymousSubclassTest().run();
@@ -68,19 +70,19 @@
"}";
void compOk(String code) throws Exception {
- tb.new JavacTask()
+ new JavacTask(tb)
.sources(code)
.run();
}
void compFail(String code) throws Exception {
- String errs = tb.new JavacTask()
+ String errs = new JavacTask(tb)
.sources(code)
.classpath(".")
.options("-XDrawDiagnostics")
- .run(ToolBox.Expect.FAIL)
+ .run(Task.Expect.FAIL)
.writeAll()
- .getOutput(ToolBox.OutputKind.DIRECT);
+ .getOutput(Task.OutputKind.DIRECT);
if (!errs.contains("cant.inherit.from.anon")) {
throw new Exception("test failed");