/*
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6993978 7097436
* @summary Project Coin: Annotation to reduce varargs warnings
* @author mcimadamore
* @run main Warn5
*/
public class Warn5 {
enum XlintOption {
}
return "-Xlint:" + opt;
}
}
enum TrustMe {
}
}
enum SuppressLevel {
NONE,
return this == VARARGS ?
"@SuppressWarnings(\"varargs\")" :
"";
}
}
enum ModifierKind {
}
}
enum MethodKind {
}
}
enum SourceLevel {
}
}
enum SignatureKind {
boolean isReifiableArg;
boolean isVarargs;
this.isReifiableArg = isReifiableArg;
}
}
}
enum BodyKind {
boolean hasAliasing;
this.hasAliasing = hasAliasing;
}
}
enum WarningKind {
}
// Create a single file manager and reuse it for each compile to save time.
new Warn5(sourceLevel,
sig,
}
}
}
}
}
}
}
}
}
public Warn5(SourceLevel sourceLevel, XlintOption xlint, TrustMe trustMe, SuppressLevel suppressLevel, ModifierKind modKind, MethodKind methKind, SignatureKind sig, BodyKind body) {
this.sourceLevel = sourceLevel;
this.suppressLevel = suppressLevel;
this.source = new JavaSource();
this.dc = new DiagnosticChecker();
}
Arrays.asList(xlint.getXlintOption(), "-source", sourceLevel.sourceKey), null, Arrays.asList(source));
check();
}
void check() {
(methKind == MethodKind.CONSTRUCTOR || (methKind == MethodKind.METHOD && modKind != ModifierKind.NONE))) {
}
!sig.isReifiableArg &&
}
}
}
throw new Error("invalid diagnostics for source:\n" +
source.getCharContent(true) +
"\nExpected warnings: " + expectedWarnings +
}
}
"import java.util.List;\n" +
"class Test {\n" +
" static void test(Object o) {}\n" +
" static void testArr(Object[] o) {}\n" +
" #T \n #S #M { #B }\n" +
"}\n";
public JavaSource() {
}
return source;
}
}
}
}
}
}
}
}
}
}