Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
4a6e4445
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4a6e4445
编写于
11月 02, 2012
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7169362: JDK8: Write compiler tests for repeating annotations for JDK8
Reviewed-by: darcy, jjg Contributed-by: sonali.goel@oracle.com
上级
0d937ac0
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
405 addition
and
0 deletion
+405
-0
test/tools/javac/annotations/repeatingAnnotations/BaseAnnoAsContainerAnno.java
...tations/repeatingAnnotations/BaseAnnoAsContainerAnno.java
+20
-0
test/tools/javac/annotations/repeatingAnnotations/BaseAnnoAsContainerAnno.out
...otations/repeatingAnnotations/BaseAnnoAsContainerAnno.out
+2
-0
test/tools/javac/annotations/repeatingAnnotations/CyclicAnnotation.java
...ac/annotations/repeatingAnnotations/CyclicAnnotation.java
+26
-0
test/tools/javac/annotations/repeatingAnnotations/CyclicAnnotation.out
...vac/annotations/repeatingAnnotations/CyclicAnnotation.out
+6
-0
test/tools/javac/annotations/repeatingAnnotations/DefaultCasePresent.java
.../annotations/repeatingAnnotations/DefaultCasePresent.java
+46
-0
test/tools/javac/annotations/repeatingAnnotations/DocumentedContainerAnno.java
...tations/repeatingAnnotations/DocumentedContainerAnno.java
+23
-0
test/tools/javac/annotations/repeatingAnnotations/DocumentedContainerAnno.out
...otations/repeatingAnnotations/DocumentedContainerAnno.out
+2
-0
test/tools/javac/annotations/repeatingAnnotations/InheritedContainerAnno.java
...otations/repeatingAnnotations/InheritedContainerAnno.java
+24
-0
test/tools/javac/annotations/repeatingAnnotations/InheritedContainerAnno.out
...notations/repeatingAnnotations/InheritedContainerAnno.out
+2
-0
test/tools/javac/annotations/repeatingAnnotations/MissingContainer.java
...ac/annotations/repeatingAnnotations/MissingContainer.java
+21
-0
test/tools/javac/annotations/repeatingAnnotations/MissingContainer.out
...vac/annotations/repeatingAnnotations/MissingContainer.out
+5
-0
test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.java
...annotations/repeatingAnnotations/MissingDefaultCase1.java
+23
-0
test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.out
.../annotations/repeatingAnnotations/MissingDefaultCase1.out
+2
-0
test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.java
...annotations/repeatingAnnotations/MissingDefaultCase2.java
+23
-0
test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.out
.../annotations/repeatingAnnotations/MissingDefaultCase2.out
+2
-0
test/tools/javac/annotations/repeatingAnnotations/MissingValueMethod.java
.../annotations/repeatingAnnotations/MissingValueMethod.java
+22
-0
test/tools/javac/annotations/repeatingAnnotations/MissingValueMethod.out
...c/annotations/repeatingAnnotations/MissingValueMethod.out
+4
-0
test/tools/javac/annotations/repeatingAnnotations/MultiLevelRepeatableAnno.java
...ations/repeatingAnnotations/MultiLevelRepeatableAnno.java
+51
-0
test/tools/javac/annotations/repeatingAnnotations/MultipleAnnoMixedOrder.java
...otations/repeatingAnnotations/MultipleAnnoMixedOrder.java
+60
-0
test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.java
...ac/annotations/repeatingAnnotations/NoRepeatableAnno.java
+12
-0
test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.out
...vac/annotations/repeatingAnnotations/NoRepeatableAnno.out
+3
-0
test/tools/javac/annotations/repeatingAnnotations/WrongReturnTypeForValue.java
...tations/repeatingAnnotations/WrongReturnTypeForValue.java
+23
-0
test/tools/javac/annotations/repeatingAnnotations/WrongReturnTypeForValue.out
...otations/repeatingAnnotations/WrongReturnTypeForValue.out
+3
-0
未找到文件。
test/tools/javac/annotations/repeatingAnnotations/BaseAnnoAsContainerAnno.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Base annotation specify itself as ContainerAnnotation
* @compile/fail/ref=BaseAnnoAsContainerAnno.out -XDrawDiagnostics BaseAnnoAsContainerAnno.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
(
Foo
.
class
)
@ContainerFor
(
Foo
.
class
)
@interface
Foo
{
Foo
[]
value
()
default
{};
}
@Foo
()
@Foo
()
public
class
BaseAnnoAsContainerAnno
{}
test/tools/javac/annotations/repeatingAnnotations/BaseAnnoAsContainerAnno.out
0 → 100644
浏览文件 @
4a6e4445
BaseAnnoAsContainerAnno.java:15:11: compiler.err.cyclic.annotation.element
1 error
test/tools/javac/annotations/repeatingAnnotations/CyclicAnnotation.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Cyclic annotation not allowed
* @compile/fail/ref=CyclicAnnotation.out -XDrawDiagnostics CyclicAnnotation.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
(
Foo
.
class
)
@ContainerFor
(
Baz
.
class
)
@interface
Baz
{
Foo
[]
value
()
default
{};
}
@ContainedBy
(
Baz
.
class
)
@ContainerFor
(
Foo
.
class
)
@interface
Foo
{
Baz
[]
value
()
default
{};
}
@Foo
(
value
=
{
@Baz
,
@Baz
})
@Baz
(
value
=
{
@Foo
,
@Foo
})
public
class
CyclicAnnotation
{}
test/tools/javac/annotations/repeatingAnnotations/CyclicAnnotation.out
0 → 100644
浏览文件 @
4a6e4445
CyclicAnnotation.java:12:1: compiler.err.invalid.container.wrong.containerfor: Foo, Baz
CyclicAnnotation.java:13:1: compiler.err.invalid.container.wrong.containedby: Foo, Baz
CyclicAnnotation.java:15:11: compiler.err.cyclic.annotation.element
CyclicAnnotation.java:18:1: compiler.err.invalid.container.wrong.containerfor: Baz, Foo
CyclicAnnotation.java:19:1: compiler.err.invalid.container.wrong.containedby: Baz, Foo
5 errors
test/tools/javac/annotations/repeatingAnnotations/DefaultCasePresent.java
0 → 100644
浏览文件 @
4a6e4445
/*
* Copyright (c) 2012, 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 7169362
* @author sogoel
* @summary Default case for methods other than value() in ContainerAnno
* @compile DefaultCasePresent.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
(
FooContainer
.
class
)
@interface
Foo
{}
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
[]
value
();
String
other
()
default
"other-method"
;
}
@Foo
@Foo
public
class
DefaultCasePresent
{}
test/tools/javac/annotations/repeatingAnnotations/DocumentedContainerAnno.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Base anno is Documented but Container anno is not
* @compile/fail/ref=DocumentedContainerAnno.out -XDrawDiagnostics DocumentedContainerAnno.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
import
java.lang.annotation.Documented
;
@Documented
@ContainedBy
(
FooContainer
.
class
)
@interface
Foo
{}
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
[]
value
();
}
@Foo
@Foo
public
class
DocumentedContainerAnno
{}
test/tools/javac/annotations/repeatingAnnotations/DocumentedContainerAnno.out
0 → 100644
浏览文件 @
4a6e4445
DocumentedContainerAnno.java:14:1: compiler.err.invalid.containedby.annotation.not.documented: FooContainer, Foo
1 error
test/tools/javac/annotations/repeatingAnnotations/InheritedContainerAnno.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Base anno is Inherited but Container anno is not
* @compile/fail/ref=InheritedContainerAnno.out -XDrawDiagnostics InheritedContainerAnno.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
import
java.lang.annotation.Inherited
;
@Inherited
@ContainedBy
(
FooContainer
.
class
)
@interface
Foo
{}
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
[]
value
();
}
@Foo
@Foo
public
class
InheritedContainerAnno
{}
test/tools/javac/annotations/repeatingAnnotations/InheritedContainerAnno.out
0 → 100644
浏览文件 @
4a6e4445
InheritedContainerAnno.java:14:1: compiler.err.invalid.containedby.annotation.not.inherited: FooContainer, Foo
1 error
test/tools/javac/annotations/repeatingAnnotations/MissingContainer.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary ContainerAnnotation does not have FooContainer.class specified
* @compile/fail/ref=MissingContainer.out -XDrawDiagnostics MissingContainer.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
()
@interface
Foo
{}
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
[]
value
();
}
@Foo
@Foo
public
class
MissingContainer
{}
test/tools/javac/annotations/repeatingAnnotations/MissingContainer.out
0 → 100644
浏览文件 @
4a6e4445
MissingContainer.java:20:1: compiler.err.invalid.containedby.annotation: Foo
MissingContainer.java:20:6: compiler.err.invalid.containedby.annotation: Foo
MissingContainer.java:12:1: compiler.err.annotation.missing.default.value: java.lang.annotation.ContainedBy, value
MissingContainer.java:15:1: compiler.err.invalid.container.wrong.containedby: Foo, FooContainer
4 errors
test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Default case not specified for other methods in container annotation
* @compile/fail/ref=MissingDefaultCase1.out -XDrawDiagnostics MissingDefaultCase1.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
(
FooContainer
.
class
)
@interface
Foo
{}
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
[]
value
();
String
other
();
// missing default clause
}
@Foo
@Foo
public
class
MissingDefaultCase1
{}
test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.out
0 → 100644
浏览文件 @
4a6e4445
MissingDefaultCase1.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
1 error
test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Missing default case for other method and return type is base annotation
* @compile/fail/ref=MissingDefaultCase2.out -XDrawDiagnostics MissingDefaultCase2.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
(
FooContainer
.
class
)
@interface
Foo
{}
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
[]
value
();
Foo
other
();
// missing default clause and return type is an annotation
}
@Foo
@Foo
public
class
MissingDefaultCase2
{}
test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.out
0 → 100644
浏览文件 @
4a6e4445
MissingDefaultCase2.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
1 error
test/tools/javac/annotations/repeatingAnnotations/MissingValueMethod.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Missing value() method in ContainerAnnotation
* @compile/fail/ref=MissingValueMethod.out -XDrawDiagnostics MissingValueMethod.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
(
FooContainer
.
class
)
@interface
Foo
{}
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
[]
values
();
// wrong method name
}
@Foo
@Foo
public
class
MissingValueMethod
{}
test/tools/javac/annotations/repeatingAnnotations/MissingValueMethod.out
0 → 100644
浏览文件 @
4a6e4445
MissingValueMethod.java:20:1: compiler.err.invalid.containedby.annotation.no.value: FooContainer
MissingValueMethod.java:20:6: compiler.err.invalid.containedby.annotation.no.value: FooContainer
MissingValueMethod.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, values()
3 errors
test/tools/javac/annotations/repeatingAnnotations/MultiLevelRepeatableAnno.java
0 → 100644
浏览文件 @
4a6e4445
/*
* Copyright (c) 2012, 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 7169362
* @author sogoel
* @summary ContainerType can have its own container
* @compile MultiLevelRepeatableAnno.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
(
FooContainer
.
class
)
@interface
Foo
{}
@ContainedBy
(
FooContainerContainer
.
class
)
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
[]
value
();
}
@ContainerFor
(
FooContainer
.
class
)
@interface
FooContainerContainer
{
FooContainer
[]
value
();
}
@Foo
@Foo
public
class
MultiLevelRepeatableAnno
{}
test/tools/javac/annotations/repeatingAnnotations/MultipleAnnoMixedOrder.java
0 → 100644
浏览文件 @
4a6e4445
/*
* Copyright (c) 2012, 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 7169362
* @author sogoel
* @summary Repeatable annotations in random order
* @compile MultipleAnnoMixedOrder.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
(
FooContainer
.
class
)
@interface
Foo
{
int
getNumbers
();
}
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
[]
value
();
}
@ContainedBy
(
BazContainer
.
class
)
@interface
Baz
{
String
getStr
();
}
@ContainerFor
(
Baz
.
class
)
@interface
BazContainer
{
Baz
[]
value
();
}
@Foo
(
getNumbers
=
1
)
@Baz
(
getStr
=
"hello"
)
@Foo
(
getNumbers
=
2
)
@Baz
(
getStr
=
"world"
)
public
class
MultipleAnnoMixedOrder
{}
test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Foo is not a repeatable annotation but used as one.
* @compile/fail/ref=NoRepeatableAnno.out -XDrawDiagnostics NoRepeatableAnno.java
*/
@interface
Foo
{}
@Foo
@Foo
public
class
NoRepeatableAnno
{}
test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.out
0 → 100644
浏览文件 @
4a6e4445
NoRepeatableAnno.java:11:1: compiler.err.duplicate.annotation.missing.container: Foo
NoRepeatableAnno.java:11:6: compiler.err.duplicate.annotation.missing.container: Foo
2 errors
test/tools/javac/annotations/repeatingAnnotations/WrongReturnTypeForValue.java
0 → 100644
浏览文件 @
4a6e4445
/**
* @test /nodynamiccopyright/
* @bug 7169362
* @author sogoel
* @summary Wrong return type for value() in ContainerAnnotation
* @compile/fail/ref=WrongReturnTypeForValue.out -XDrawDiagnostics WrongReturnTypeForValue.java
*/
import
java.lang.annotation.ContainedBy
;
import
java.lang.annotation.ContainerFor
;
@ContainedBy
(
FooContainer
.
class
)
@interface
Foo
{
int
getNumbers
();
}
@ContainerFor
(
Foo
.
class
)
@interface
FooContainer
{
Foo
value
();
// wrong return type
}
@Foo
@Foo
public
class
WrongReturnTypeForValue
{}
test/tools/javac/annotations/repeatingAnnotations/WrongReturnTypeForValue.out
0 → 100644
浏览文件 @
4a6e4445
WrongReturnTypeForValue.java:22:1: compiler.err.invalid.containedby.annotation.value.return: FooContainer, Foo, Foo[]
WrongReturnTypeForValue.java:22:6: compiler.err.invalid.containedby.annotation.value.return: FooContainer, Foo, Foo[]
2 errors
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录