test/tools/javac/processing/errors/TestFatalityOfParseErrors.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2006, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2006, 2010, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 24,33 **** --- 24,36 ---- /* * @test * @bug 6403459 * @summary Test that generating programs with syntax errors is a fatal condition * @author Joseph D. Darcy + * @library ../../lib + * @build JavacTestingAbstractProcessor + * @compile TestReturnCode.java * @compile TestFatalityOfParseErrors.java * @compile/fail -XprintRounds -processor TestFatalityOfParseErrors -proc:only TestFatalityOfParseErrors.java */ import java.util.Set;
*** 43,57 **** /** * Write out an incomplete source file and observe that the next round * is marked as an error. */ ! @SupportedAnnotationTypes("*") ! public class TestFatalityOfParseErrors extends AbstractProcessor { int round = 0; - Messager messager; - Filer filer; public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnvironment) { try { PrintWriter pw = null; --- 46,57 ---- /** * Write out an incomplete source file and observe that the next round * is marked as an error. */ ! public class TestFatalityOfParseErrors extends JavacTestingAbstractProcessor { int round = 0; public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnvironment) { try { PrintWriter pw = null;
*** 85,100 **** } catch (IOException ioException) { throw new RuntimeException(ioException); } return true; } - - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latest(); - } - - public void init(ProcessingEnvironment processingEnv) { - super.init(processingEnv); - messager = processingEnv.getMessager(); - filer = processingEnv.getFiler(); - } } --- 85,90 ----