8049129: Group 8c - golden files for annotations test in tools/java dir
Reviewed-by: jjg
This commit is contained in:
parent
40f4caa8d0
commit
32b768c531
@ -1,35 +1,14 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4901271
|
||||
* @summary java.lang.annotation.Target
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail WrongTarget.java
|
||||
* @compile/fail/ref=WrongTarget.out -XDrawDiagnostics WrongTarget.java
|
||||
*/
|
||||
|
||||
import static java.lang.annotation.ElementType.*;
|
||||
|
||||
@java.lang.annotation.Target({FIELD})
|
||||
@interface foo {
|
||||
}
|
||||
|
@ -0,0 +1,2 @@
|
||||
WrongTarget.java:16:1: compiler.err.annotation.type.not.applicable
|
||||
1 error
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4973504
|
||||
* @summary Compiler allows Inherited meta-attribute on local variable declaration.
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail WrongTarget2.java
|
||||
* @compile/fail/ref=WrongTarget2.out -XDrawDiagnostics WrongTarget2.java
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Inherited;
|
||||
|
@ -0,0 +1,2 @@
|
||||
WrongTarget2.java:12:6: compiler.err.annotation.type.not.applicable
|
||||
1 error
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4951298
|
||||
* @summary compiler: crashes when attributes with same elements are used in place of other
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail WrongValue.java
|
||||
* @compile/fail/ref=WrongValue.out -XDrawDiagnostics WrongValue.java
|
||||
*/
|
||||
|
||||
@interface TestM2 {
|
||||
|
@ -0,0 +1,2 @@
|
||||
WrongValue.java:25:5: compiler.err.prob.found.req: (compiler.misc.inconvertible.types: TestM3, TestM2)
|
||||
1 error
|
@ -1,37 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4865660
|
||||
* @summary implement "metadata" (attribute interfaces and program annotations)
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Z10.java
|
||||
* @compile/fail/ref=Z10.out -XDrawDiagnostics Z10.java
|
||||
*/
|
||||
|
||||
enum Color { red, green, blue }
|
||||
|
||||
@interface An {
|
||||
int[][] a();
|
||||
}
|
||||
|
2
langtools/test/tools/javac/annotations/neg/Z10.out
Normal file
2
langtools/test/tools/javac/annotations/neg/Z10.out
Normal file
@ -0,0 +1,2 @@
|
||||
Z10.java:11:8: compiler.err.invalid.annotation.member.type
|
||||
1 error
|
@ -1,37 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4865660
|
||||
* @summary implement "metadata" (attribute interfaces and program annotations)
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Z11.java
|
||||
* @compile/fail/ref=Z11.out -XDrawDiagnostics Z11.java
|
||||
*/
|
||||
|
||||
enum Color { red, green, blue }
|
||||
|
||||
class X {}
|
||||
|
||||
@interface An {
|
||||
|
2
langtools/test/tools/javac/annotations/neg/Z11.out
Normal file
2
langtools/test/tools/javac/annotations/neg/Z11.out
Normal file
@ -0,0 +1,2 @@
|
||||
Z11.java:13:5: compiler.err.invalid.annotation.member.type
|
||||
1 error
|
@ -1,37 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4865660
|
||||
* @summary implement "metadata" (attribute interfaces and program annotations)
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Z12.java
|
||||
* @compile/fail/ref=Z12.out -XDrawDiagnostics Z12.java
|
||||
*/
|
||||
|
||||
enum Color { red, green, blue }
|
||||
|
||||
@interface An {
|
||||
void a();
|
||||
}
|
||||
|
2
langtools/test/tools/javac/annotations/neg/Z12.out
Normal file
2
langtools/test/tools/javac/annotations/neg/Z12.out
Normal file
@ -0,0 +1,2 @@
|
||||
Z12.java:11:5: compiler.err.invalid.annotation.member.type
|
||||
1 error
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4865660
|
||||
* @summary implement "metadata" (attribute interfaces and program annotations)
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Z13.java
|
||||
* @compile/fail/ref=Z13.out -XDrawDiagnostics Z13.java
|
||||
*/
|
||||
|
||||
@interface An {
|
||||
|
2
langtools/test/tools/javac/annotations/neg/Z13.out
Normal file
2
langtools/test/tools/javac/annotations/neg/Z13.out
Normal file
@ -0,0 +1,2 @@
|
||||
Z13.java:11:20: compiler.err.throws.not.allowed.in.intf.annotation
|
||||
1 error
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4865660
|
||||
* @summary implement "metadata" (attribute interfaces and program annotations)
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Z14.java
|
||||
* @compile/fail/ref=Z14.out -XDrawDiagnostics Z14.java
|
||||
*/
|
||||
|
||||
@interface An<T> {
|
||||
|
2
langtools/test/tools/javac/annotations/neg/Z14.out
Normal file
2
langtools/test/tools/javac/annotations/neg/Z14.out
Normal file
@ -0,0 +1,2 @@
|
||||
Z14.java:10:15: compiler.err.intf.annotation.cant.have.type.params
|
||||
1 error
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4865660
|
||||
* @summary implement "metadata" (attribute interfaces and program annotations)
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Z15.java
|
||||
* @compile/fail/ref=Z15.out -XDrawDiagnostics Z15.java
|
||||
*/
|
||||
|
||||
@interface An {
|
||||
|
2
langtools/test/tools/javac/annotations/neg/Z15.out
Normal file
2
langtools/test/tools/javac/annotations/neg/Z15.out
Normal file
@ -0,0 +1,2 @@
|
||||
Z15.java:11:36: compiler.err.attribute.value.must.be.constant
|
||||
1 error
|
@ -1,33 +1,10 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 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.
|
||||
*
|
||||
* 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
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 4865660
|
||||
* @summary implement "metadata" (attribute interfaces and program annotations)
|
||||
* @author gafter
|
||||
*
|
||||
* @compile/fail Z16.java
|
||||
* @compile/fail/ref=Z16.out -XDrawDiagnostics Z16.java
|
||||
*/
|
||||
|
||||
enum Color { red, green, blue }
|
||||
|
2
langtools/test/tools/javac/annotations/neg/Z16.out
Normal file
2
langtools/test/tools/javac/annotations/neg/Z16.out
Normal file
@ -0,0 +1,2 @@
|
||||
Z16.java:13:27: compiler.err.cant.resolve.location: kindname.variable, redx, , , (compiler.misc.location: kindname.annotation, Colored, null)
|
||||
1 error
|
Loading…
Reference in New Issue
Block a user