提交 93ac494b 编写于 作者: J jfranck

8004822: RFE to write language model API tests for repeating annotations based on the spec updates

Reviewed-by: jjg, abuckley
Contributed-by: NMatherey Nunez <matherey.nunez@oracle.com>
上级 2b3127b0
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* MixRepeatableAndOfficialContainerBasicTest.java
*/
@ExpectedBase(
value = Bar.class,
getAnnotation = "@Bar(value=0)",
getAnnotationsByType = {
"@Bar(value=0)",
"@Bar(value=1)",
"@Bar(value=2)"
},
getAllAnnotationMirrors = {
"@Bar(0)",
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@Bar(0)",
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])",
getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"})
@Bar(value = 0)
@BarContainer(value = {@Bar(value = 1), @Bar(value = 2)})
class MixRepeatableAndOfficialContainerBasicTest {
@ExpectedBase(
value = Bar.class,
getAnnotation = "@Bar(value=0)",
getAnnotationsByType = {
"@Bar(value=0)",
"@Bar(value=1)",
"@Bar(value=2)"
},
getAllAnnotationMirrors = {
"@Bar(0)",
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@Bar(0)",
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])",
getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"})
@Bar(value = 0)
@BarContainer(value = {@Bar(value = 1), @Bar(value = 2)})
int testField = 0;
@ExpectedBase(
value = Bar.class,
getAnnotation = "@Bar(value=0)",
getAnnotationsByType = {
"@Bar(value=0)",
"@Bar(value=1)",
"@Bar(value=2)"
},
getAllAnnotationMirrors = {
"@Bar(0)",
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@Bar(0)",
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])",
getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"})
@Bar(value = 0)
@BarContainer(value = {@Bar(value = 1), @Bar(value = 2)})
void testMethod() {}
}
/*
* Copyright (c) 2013, 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.
*/
/*
* @ignore
* @test
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* MixRepeatableAndOfficialContainerInheritedA1Test.java
*/
@BarInherited(value = 0)
class E {}
@ExpectedBase(
value = BarInherited.class,
getAnnotation = "@BarInherited(value=0)",
getAnnotationsByType = {
"@BarInherited(value=1)",
"@BarInherited(value=2)"
},
getAllAnnotationMirrors = {
"@BarInherited(0)",
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarInheritedContainer.class,
getAnnotation = "@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])",
getAnnotationsByType = {"@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])"})
@BarInheritedContainer(value = {@BarInherited(value = 1), @BarInherited(value = 2)})
class MixRepeatableAndOfficialContainerInheritedA1Test extends E {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* MixRepeatableAndOfficialContainerInheritedA2Test.java
*/
@BarInherited(value = 0)
class N {}
@ExpectedBase(
value = BarInherited.class,
getAnnotation = "@BarInherited(value=3)",
getAnnotationsByType = {
"@BarInherited(value=1)",
"@BarInherited(value=2)",
"@BarInherited(value=3)"
},
getAllAnnotationMirrors = {
"@BarInherited(3)",
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarInherited(3)",
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarInheritedContainer.class,
getAnnotation = "@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])",
getAnnotationsByType = {"@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])"})
@BarInheritedContainer(value = {@BarInherited(value = 1), @BarInherited(value = 2)})
@BarInherited(value = 3)
class MixRepeatableAndOfficialContainerInheritedA2Test extends N {}
/*
* Copyright (c) 2013, 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.
*/
/*
* @ignore
* @test
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* MixRepeatableAndOfficialContainerInheritedB1Test.java
*/
@BarInheritedContainer(value = {@BarInherited(value = 1), @BarInherited(value = 2)})
class M {}
@ExpectedBase(
value = BarInherited.class,
getAnnotation = "@BarInherited(value=0)",
getAnnotationsByType = {"@BarInherited(value=0)"},
getAllAnnotationMirrors = {
"@BarInherited(0)",
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarInherited(0)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarInheritedContainer.class,
getAnnotation = "@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])",
getAnnotationsByType = {"@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])"})
@BarInherited(value = 0)
class MixRepeatableAndOfficialContainerInheritedB1Test extends M {}
/*
* Copyright (c) 2013, 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.
*/
/*
* @ignore
* @test
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* MixRepeatableAndOfficialContainerInheritedB2Test.java
*/
@BarInheritedContainer(value = {@BarInherited(value = 1), @BarInherited(value = 2)})
@BarInherited(value = 3)
class H {}
@ExpectedBase(
value = BarInherited.class,
getAnnotation = "@BarInherited(value=0)",
getAnnotationsByType = {"@BarInherited(value=0)"},
getAllAnnotationMirrors = {
"@BarInherited(0)",
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarInherited(0)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarInheritedContainer.class,
getAnnotation = "@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])",
getAnnotationsByType = {"@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])"})
@BarInherited(value = 0)
class MixRepeatableAndOfficialContainerInheritedB2Test extends H {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only MixSingularAndUnofficialContainerBasicTest.java
*/
@ExpectedBase(
value = Foo.class,
getAnnotation = "@Foo(value=0)",
getAnnotationsByType = {"@Foo(value=0)"},
getAllAnnotationMirrors = {
"@Foo(0)",
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@Foo(0)",
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialContainer.class,
getAnnotation = "@UnofficialContainer("
+ "value=[@Foo(value=1), @Foo(value=2)])",
getAnnotationsByType = {"@UnofficialContainer("
+ "value=[@Foo(value=1), @Foo(value=2)])"})
@Foo(value = 0)
@UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
class MixSingularAndUnofficialContainerBasicTest {
@ExpectedBase(
value = Foo.class,
getAnnotation = "@Foo(value=0)",
getAnnotationsByType = {"@Foo(value=0)"},
getAllAnnotationMirrors = {
"@Foo(0)",
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@Foo(0)",
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialContainer.class,
getAnnotation = "@UnofficialContainer("
+ "value=[@Foo(value=1), @Foo(value=2)])",
getAnnotationsByType = {"@UnofficialContainer("
+ "value=[@Foo(value=1), @Foo(value=2)])"})
@Foo(value = 0)
@UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
int testField = 0;
@ExpectedBase(
value = Foo.class,
getAnnotation = "@Foo(value=0)",
getAnnotationsByType = {"@Foo(value=0)"},
getAllAnnotationMirrors = {
"@Foo(0)",
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@Foo(0)",
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialContainer.class,
getAnnotation = "@UnofficialContainer("
+ "value=[@Foo(value=1), @Foo(value=2)])",
getAnnotationsByType = {"@UnofficialContainer("
+ "value=[@Foo(value=1), @Foo(value=2)])"})
@Foo(value = 0)
@UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
void testMethod() {}
}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* MixSingularAndUnofficialContainerInheritedA1Test.java
*/
@FooInherited(value = 0)
class L {}
@ExpectedBase(
value = FooInherited.class,
getAnnotation = "@FooInherited(value=0)",
getAnnotationsByType = {"@FooInherited(value=0)"},
getAllAnnotationMirrors = {
"@FooInherited(0)",
"@UnofficialInheritedContainer({@FooInherited(1), @FooInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@UnofficialInheritedContainer({@FooInherited(1), @FooInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialInheritedContainer.class,
getAnnotation = "@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])",
getAnnotationsByType = {"@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])"})
@UnofficialInheritedContainer(value = {@FooInherited(value = 1), @FooInherited(value = 2)})
class MixSingularAndUnofficialContainerInheritedA1Test extends L {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* MixSingularAndUnofficialContainerInheritedA2Test.java
*/
@FooInherited(value = 0)
class K {}
@ExpectedBase(
value = FooInherited.class,
getAnnotation = "@FooInherited(value=3)",
getAnnotationsByType = {"@FooInherited(value=3)"},
getAllAnnotationMirrors = {
"@FooInherited(3)",
"@UnofficialInheritedContainer({@FooInherited(1), @FooInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@UnofficialInheritedContainer({@FooInherited(1), @FooInherited(2)})",
"@FooInherited(3)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialInheritedContainer.class,
getAnnotation = "@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])",
getAnnotationsByType = {"@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])"})
@UnofficialInheritedContainer(value = {@FooInherited(value = 1), @FooInherited(value = 2)})
@FooInherited(value = 3)
class MixSingularAndUnofficialContainerInheritedA2Test extends K {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* MixSingularAndUnofficialContainerInheritedB1Test.java
*/
@UnofficialInheritedContainer(value = {@FooInherited(value = 1),@FooInherited(value = 2)})
class J {}
@ExpectedBase(
value = FooInherited.class,
getAnnotation = "@FooInherited(value=0)",
getAnnotationsByType = {"@FooInherited(value=0)"},
getAllAnnotationMirrors = {
"@FooInherited(0)",
"@UnofficialInheritedContainer({@FooInherited(1), @FooInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@FooInherited(0)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialInheritedContainer.class,
getAnnotation = "@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])",
getAnnotationsByType = {"@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])"})
@FooInherited(value = 0)
class MixSingularAndUnofficialContainerInheritedB1Test extends J {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* MixSingularAndUnofficialContainerInheritedB2Test.java
*/
@UnofficialInheritedContainer(value = {@FooInherited(value = 1), @FooInherited(value = 2)})
@FooInherited(value = 3)
class G {}
@ExpectedBase(
value = FooInherited.class,
getAnnotation = "@FooInherited(value=0)",
getAnnotationsByType = {"@FooInherited(value=0)"},
getAllAnnotationMirrors = {
"@FooInherited(0)",
"@UnofficialInheritedContainer({@FooInherited(1), @FooInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@FooInherited(0)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialInheritedContainer.class,
getAnnotation = "@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])",
getAnnotationsByType = {"@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])"})
@FooInherited(value = 0)
class MixSingularAndUnofficialContainerInheritedB2Test extends G{}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only OfficialContainerBasicTest.java
*/
@ExpectedBase(
value = Bar.class,
getAnnotation = "null",
getAnnotationsByType = {
"@Bar(value=1)",
"@Bar(value=2)"
},
getAllAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])",
getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"})
@BarContainer(value = {@Bar(value = 1), @Bar(value = 2)})
class OfficialContainerBasicTest {
@ExpectedBase(
value = Bar.class,
getAnnotation = "null",
getAnnotationsByType = {
"@Bar(value=1)",
"@Bar(value=2)"
},
getAllAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])",
getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"})
@BarContainer(value = {@Bar(value = 1), @Bar(value = 2)})
int testField = 0;
@ExpectedBase(
value = Bar.class,
getAnnotation = "null",
getAnnotationsByType = {
"@Bar(value=1)",
"@Bar(value=2)"
},
getAllAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])",
getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"})
@BarContainer(value = {@Bar(value = 1), @Bar(value = 2)})
void testMethod() {}
}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only OfficialContainerInheritedTest.java
*/
@BarInheritedContainer(value = {@BarInherited(value = 1), @BarInherited(value = 2)})
class D {}
@ExpectedBase(
value = BarInherited.class,
getAnnotation = "null",
getAnnotationsByType = {
"@BarInherited(value=1)",
"@BarInherited(value=2)"
},
getAllAnnotationMirrors = {
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarInheritedContainer.class,
getAnnotation = "@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])",
getAnnotationsByType = {"@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])"})
class OfficialContainerInheritedTest extends D {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only RepeatableBasicTest.java
*/
@ExpectedBase(
value = Bar.class,
getAnnotation = "null",
getAnnotationsByType = {
"@Bar(value=1)",
"@Bar(value=2)"
},
getAllAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])",
getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"})
@Bar(value = 1)
@Bar(value = 2)
class RepeatableBasicTest {
@ExpectedBase(
value = Bar.class,
getAnnotation = "null",
getAnnotationsByType = {
"@Bar(value=1)",
"@Bar(value=2)"
},
getAllAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])",
getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"})
@Bar(value = 1)
@Bar(value = 2)
int testField = 0;
@ExpectedBase(
value = Bar.class,
getAnnotation = "null",
getAnnotationsByType = {
"@Bar(value=1)",
"@Bar(value=2)"
},
getAllAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarContainer({@Bar(1), @Bar(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "@BarContainer(value=[@Bar(value=1), @Bar(value=2)])",
getAnnotationsByType = {"@BarContainer(value=[@Bar(value=1), @Bar(value=2)])"})
@Bar(value = 1)
@Bar(value = 2)
void testMethod() {}
}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only RepeatableInheritedTest.java
*/
@BarInherited(value = 1)
@BarInherited(value = 2)
class I {}
@ExpectedBase(
value = BarInherited.class,
getAnnotation = "null",
getAnnotationsByType = {
"@BarInherited(value=1)",
"@BarInherited(value=2)"
},
getAllAnnotationMirrors = {
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarInheritedContainer.class,
getAnnotation = "@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])",
getAnnotationsByType = {"@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])"})
class RepeatableInheritedTest extends I {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only RepeatableOfficialContainerBasicTest.java
*/
@ExpectedBase(
value = Bar.class,
getAnnotation = "null",
getAnnotationsByType = {},
getAllAnnotationMirrors = {
"@BarContainerContainer({@BarContainer({@Bar(1)}), @BarContainer({@Bar(2)})})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarContainerContainer({@BarContainer({@Bar(1)}), @BarContainer({@Bar(2)})})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "null",
getAnnotationsByType = {
"@BarContainer(value=[@Bar(value=1)])",
"@BarContainer(value=[@Bar(value=2)])"})
@BarContainer(value = {@Bar(value = 1)})
@BarContainer(value = {@Bar(value = 2)})
class RepeatableOfficialContainerBasicTest {
@ExpectedBase(
value = Bar.class,
getAnnotation = "null",
getAnnotationsByType = {},
getAllAnnotationMirrors = {
"@BarContainerContainer({@BarContainer({@Bar(1)}), @BarContainer({@Bar(2)})})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarContainerContainer({@BarContainer({@Bar(1)}), @BarContainer({@Bar(2)})})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "null",
getAnnotationsByType = {
"@BarContainer(value=[@Bar(value=1)])",
"@BarContainer(value=[@Bar(value=2)])"})
@BarContainer(value = {@Bar(value = 1)})
@BarContainer(value = {@Bar(value = 2)})
int testField = 0;
@ExpectedBase(
value = Bar.class,
getAnnotation = "null",
getAnnotationsByType = {},
getAllAnnotationMirrors = {
"@BarContainerContainer({@BarContainer({@Bar(1)}), @BarContainer({@Bar(2)})})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarContainerContainer({@BarContainer({@Bar(1)}), @BarContainer({@Bar(2)})})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarContainer.class,
getAnnotation = "null",
getAnnotationsByType = {
"@BarContainer(value=[@Bar(value=1)])",
"@BarContainer(value=[@Bar(value=2)])"})
@BarContainer(value = {@Bar(value = 1)})
@BarContainer(value = {@Bar(value = 2)})
void testMethod() {}
}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* RepeatableOfficialContainerInheritedTest.java
*/
@BarInheritedContainer(value = {@BarInherited(value = 1)})
@BarInheritedContainer(value = {@BarInherited(value = 2)})
class O {}
@ExpectedBase(
value = BarInheritedContainer.class,
getAnnotation = "null",
getAnnotationsByType = {
"@BarInheritedContainer(value=[@BarInherited(value=1)])",
"@BarInheritedContainer(value=[@BarInherited(value=2)])"
},
getAllAnnotationMirrors = {
"@BarInheritedContainerContainer("
+ "{@BarInheritedContainer({@BarInherited(1)}),"
+ " @BarInheritedContainer({@BarInherited(2)})})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarInheritedContainerContainer.class,
getAnnotation = "@BarInheritedContainerContainer("
+ "value=[@BarInheritedContainer(value=[@BarInherited(value=1)]),"
+ " @BarInheritedContainer(value=[@BarInherited(value=2)])])",
getAnnotationsByType = {"@BarInheritedContainerContainer("
+ "value=[@BarInheritedContainer(value=[@BarInherited(value=1)]),"
+ " @BarInheritedContainer(value=[@BarInherited(value=2)])])"})
class RepeatableOfficialContainerInheritedTest extends O {}
/*
* Copyright (c) 2013, 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.
*/
/*
* @ignore
* @test
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only RepeatableOverrideATest.java
*/
@BarInherited(value = 1)
@BarInherited(value = 2)
class B {}
@ExpectedBase(
value = BarInherited.class,
getAnnotation = "@BarInherited(value=3)",
getAnnotationsByType = {"@BarInherited(value=3)"},
getAllAnnotationMirrors = {
"@BarInherited(3)",
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarInherited(3)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarInheritedContainer.class,
getAnnotation = "@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])",
getAnnotationsByType = {"@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])"})
@BarInherited(value = 3)
class RepeatableOverrideATest extends B {}
/*
* Copyright (c) 2013, 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.
*/
/*
* @ignore
* @test
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only RepeatableOverrideBTest.java
*/
@BarInherited(value = 0)
class C {}
@ExpectedBase(
value = BarInherited.class,
getAnnotation = "@BarInherited(value=0)",
getAnnotationsByType = {
"@BarInherited(value=1)",
"@BarInherited(value=2)"
},
getAllAnnotationMirrors = {
"@BarInherited(0)",
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@BarInheritedContainer({@BarInherited(1), @BarInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = BarInheritedContainer.class,
getAnnotation = "@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])",
getAnnotationsByType = {"@BarInheritedContainer("
+ "value=[@BarInherited(value=1), @BarInherited(value=2)])"})
@BarInherited(value = 1)
@BarInherited(value = 2)
class RepeatableOverrideBTest extends C {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only SingularBasicTest.java
*/
@ExpectedBase(
value = Foo.class,
getAnnotation = "@Foo(value=0)",
getAnnotationsByType = {"@Foo(value=0)"},
getAllAnnotationMirrors = {
"@Foo(0)",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@Foo(0)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer
@Foo(value = 0)
public class SingularBasicTest {
@ExpectedBase(
value = Foo.class,
getAnnotation = "@Foo(value=0)",
getAnnotationsByType = {"@Foo(value=0)"},
getAllAnnotationMirrors = {
"@Foo(0)",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@Foo(0)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer
@Foo(value = 0)
int testField = 0;
@ExpectedBase(
value = Foo.class,
getAnnotation = "@Foo(value=0)",
getAnnotationsByType = {"@Foo(value=0)"},
getAllAnnotationMirrors = {
"@Foo(0)",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@Foo(0)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer
@Foo(value = 0)
void testMethod() {
}
}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only SingularInheritedATest.java
*/
@FooInherited(value = 0)
class A {}
@ExpectedBase(
value = FooInherited.class,
getAnnotation = "@FooInherited(value=0)",
getAnnotationsByType = {"@FooInherited(value=0)"},
getAllAnnotationMirrors = {
"@FooInherited(0)",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer
class SingularInheritedATest extends A {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only SingularInheritedBTest.java
*/
@FooInherited(value = 1)
class P {}
@ExpectedBase(
value = FooInherited.class,
getAnnotation = "@FooInherited(value=2)",
getAnnotationsByType = {"@FooInherited(value=2)"},
getAllAnnotationMirrors = {
"@FooInherited(2)",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@FooInherited(2)",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialInheritedContainer.class,
getAnnotation = "null",
getAnnotationsByType = {})
@FooInherited(value = 2)
class SingularInheritedBTest extends P {}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only UnofficialContainerBasicTest.java
*/
@ExpectedBase(
value = Foo.class,
getAnnotation = "null",
getAnnotationsByType = {},
getAllAnnotationMirrors = {
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialContainer.class,
getAnnotation = "@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])",
getAnnotationsByType = {"@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])"})
@UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
class UnofficialContainerBasicTest {
@ExpectedBase(
value = Foo.class,
getAnnotation = "null",
getAnnotationsByType = {},
getAllAnnotationMirrors = {
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialContainer.class,
getAnnotation = "@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])",
getAnnotationsByType = {"@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])"})
@UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
int testField = 0;
@ExpectedBase(
value = Foo.class,
getAnnotation = "null",
getAnnotationsByType = {},
getAllAnnotationMirrors = {
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"@UnofficialContainer({@Foo(1), @Foo(2)})",
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialContainer.class,
getAnnotation = "@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])",
getAnnotationsByType = {"@UnofficialContainer(value=[@Foo(value=1), @Foo(value=2)])"})
@UnofficialContainer(value = {@Foo(value = 1), @Foo(value = 2)})
void testMethod() {}
}
/*
* Copyright (c) 2013, 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
* @bug 8004822
* @author mnunez
* @summary Language model api test basics for repeating annotations
* @library /tools/javac/lib
* @library supportingAnnotations
* @build JavacTestingAbstractProcessor ElementRepAnnoTester
* @compile -processor ElementRepAnnoTester -proc:only
* UnofficialContainerInheritedTest.java
*/
@UnofficialInheritedContainer(value = {@FooInherited(value = 1),@FooInherited(value = 2)})
class F {}
@ExpectedBase(
value = FooInherited.class,
getAnnotation = "null",
getAnnotationsByType = {},
getAllAnnotationMirrors = {
"@UnofficialInheritedContainer({@FooInherited(1), @FooInherited(2)})",
"ExpectedBase",
"ExpectedContainer"
},
getAnnotationMirrors = {
"ExpectedBase",
"ExpectedContainer"
})
@ExpectedContainer(
value = UnofficialInheritedContainer.class,
getAnnotation = "@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])",
getAnnotationsByType = {"@UnofficialInheritedContainer("
+ "value=[@FooInherited(value=1), @FooInherited(value=2)])"})
class UnofficialContainerInheritedTest extends F {}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(BarContainer.class)
public @interface Bar {
int value();
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(BarContainerContainer.class)
public @interface BarContainer {
Bar[] value();
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface BarContainerContainer {
BarContainer[] value();
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Repeatable(BarInheritedContainer.class)
public @interface BarInherited {
int value();
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Repeatable(BarInheritedContainerContainer.class)
public @interface BarInheritedContainer {
BarInherited[] value();
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface BarInheritedContainerContainer {
BarInheritedContainer[] value();
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface ExpectedBase {
Class<? extends Annotation> value() default Annotation.class;
String getAnnotation() default "";
String[] getAllAnnotationMirrors() default {};
String[] getAnnotationMirrors() default {};
// Java SE 8 methods.
String[] getAnnotationsByType() default {};
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface ExpectedContainer {
Class<? extends Annotation> value() default Annotation.class;
String getAnnotation() default "";
// Java SE 8 methods.
String[] getAnnotationsByType() default {};
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Foo {
int value();
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface FooInherited {
int value();
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface UnofficialContainer {
Foo[] value();
}
/*
* Copyright (c) 2013, 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.
*/
import java.lang.annotation.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface UnofficialInheritedContainer {
FooInherited[] value();
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册