T6439826.java revision 494
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6439826 6411930 6380018 6392177
* @summary Exception issuing Diagnostic while processing generated errant code
*/
@SupportedAnnotationTypes("*")
public class T6439826 extends AbstractProcessor {
"-proc:only",
"-processor", "T6439826",
"-processorpath", testClasses);
// Expect the following 2 diagnostics, and no output to log
// Foo.java:1: illegal character: \35
// Foo.java:1: reached end of file while parsing
throw new AssertionError("unexpected output from compiler");
}
for (TypeElement e: elems) {
writeBadFile();
}
return false;
}
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latest();
}
private void writeBadFile() {
try {
} catch (IOException e) {
}
}
static class MyDiagListener implements DiagnosticListener {
public void report(Diagnostic d) {
count++;
}
public int count;
}
}