test/tools/javac/processing/warnings/TestSourceVersionWarnings.java
Print this page
*** 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.
--- 1,7 ----
/*
! * Copyright (c) 2006, 2011, 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.
*** 21,31 ****
* questions.
*/
/*
* @test
! * @bug 6376083 6376084 6458819
* @summary Test that warnings about source versions are output as expected.
* @author Joseph D. Darcy
* @compile TestSourceVersionWarnings.java
* @compile/ref=gold_0.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -source 1.5 -Xlint:-options HelloWorld.java
* @compile/ref=gold_sv_warn_0_2.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_0 -source 1.2 -Xlint:-options HelloWorld.java
--- 21,31 ----
* questions.
*/
/*
* @test
! * @bug 6376083 6376084 6458819 7025784 7025786 7025789
* @summary Test that warnings about source versions are output as expected.
* @author Joseph D. Darcy
* @compile TestSourceVersionWarnings.java
* @compile/ref=gold_0.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -source 1.5 -Xlint:-options HelloWorld.java
* @compile/ref=gold_sv_warn_0_2.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_0 -source 1.2 -Xlint:-options HelloWorld.java
*** 33,43 ****
* @compile/ref=gold_sv_warn_2_3.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.3 -Xlint:-options HelloWorld.java
* @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.5 -Xlint:-options HelloWorld.java
* @compile/ref=gold_sv_warn_5_6.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.6 -Xlint:-options HelloWorld.java
* @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options HelloWorld.java
* @compile/ref=gold_unsp_warn.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options -Aunsupported HelloWorld.java
! * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7 HelloWorld.java
*/
import java.util.Set;
import java.util.HashSet;
import java.util.Arrays;
--- 33,44 ----
* @compile/ref=gold_sv_warn_2_3.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_2 -source 1.3 -Xlint:-options HelloWorld.java
* @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.5 -Xlint:-options HelloWorld.java
* @compile/ref=gold_sv_warn_5_6.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_5 -source 1.6 -Xlint:-options HelloWorld.java
* @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options HelloWorld.java
* @compile/ref=gold_unsp_warn.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_6 -source 1.6 -Xlint:-options -Aunsupported HelloWorld.java
! * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_7 -source 1.7 -Xlint:-options HelloWorld.java
! * @compile/ref=gold_sv_none.out -XDrawDiagnostics -processor TestSourceVersionWarnings -proc:only -ASourceVersion=RELEASE_8 -source 1.8 HelloWorld.java
*/
import java.util.Set;
import java.util.HashSet;
import java.util.Arrays;
*** 49,59 ****
import static javax.tools.Diagnostic.Kind.*;
/**
* This processor returns the supported source level as indicated by
* the "SourceLevel" option; therefore, don't use
! * JavacTestingAbstractProcessor which returns the latest source level.
*/
@SupportedAnnotationTypes("*")
@SupportedOptions("SourceVersion")
public class TestSourceVersionWarnings extends AbstractProcessor {
--- 50,61 ----
import static javax.tools.Diagnostic.Kind.*;
/**
* This processor returns the supported source level as indicated by
* the "SourceLevel" option; therefore, don't use
! * JavacTestingAbstractProcessor which returns the latest source
! * level.
*/
@SupportedAnnotationTypes("*")
@SupportedOptions("SourceVersion")
public class TestSourceVersionWarnings extends AbstractProcessor {