Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8348212: Need to add warn() step to JavacTaskImpl after JDK-8344148 #23223

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions test/langtools/tools/javac/api/TestJavacTaskWithWarning.java
Original file line number Diff line number Diff line change
@@ -26,25 +26,28 @@
* @bug 8348212
* @summary Ensure the warn() phase executes when the compiler is invoked via the API
* @modules jdk.compiler/com.sun.tools.javac.api
* @compile TestJavacTask.java TestJavacTaskWithWarning.java
* @run main TestJavacTaskWithWarning
*/

import com.sun.tools.javac.api.JavacTaskImpl;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;

import javax.tools.JavaCompiler;
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;

public class TestJavacTaskWithWarning extends TestJavacTask {
public class TestJavacTaskWithWarning {

static final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
static final StandardJavaFileManager fm = compiler.getStandardFileManager(null, null, null);

public static void warningTest() throws IOException {
public static void warningTest() throws Exception {

// Create a source file that will generate a warning
String srcdir = System.getProperty("test.src");
@@ -75,7 +78,7 @@ public GeneratesWarning() {
throw new AssertionError("warning not found in:\n" + buf);
}

public static void main(String[] args) throws IOException {
public static void main(String[] args) throws Exception {
try {
warningTest();
} finally {