Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
7be4e72d
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看板
提交
7be4e72d
编写于
10月 20, 2013
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8026791: wrong type_path encoded for method_return on an inner class constructor
Reviewed-by: jjg Contributed-by: wdietl@gmail.com
上级
56280f0e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
9 deletion
+20
-9
src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
...are/classes/com/sun/tools/javac/code/TypeAnnotations.java
+10
-1
test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java
...otations/typeAnnotations/referenceinfos/Constructors.java
+10
-8
未找到文件。
src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
浏览文件 @
7be4e72d
...
...
@@ -323,7 +323,16 @@ public class TypeAnnotations {
if
(
type
==
null
)
{
// When type is null, put the type annotations to the symbol.
// This is used for constructor return annotations, for which
// no appropriate type exists.
// we use the type of the enclosing class.
type
=
sym
.
getEnclosingElement
().
asType
();
// Declaration annotations are always allowed on constructor returns.
// Therefore, use typeAnnotations instead of onlyTypeAnnos.
type
=
typeWithAnnotations
(
typetree
,
type
,
typeAnnotations
,
typeAnnotations
);
// Note that we don't use the result, the call to
// typeWithAnnotations side-effects the type annotation positions.
// This is important for constructors of nested classes.
sym
.
appendUniqueTypeAttributes
(
typeAnnotations
);
return
;
}
...
...
test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java
浏览文件 @
7be4e72d
...
...
@@ -21,14 +21,16 @@
* questions.
*/
import
static
com
.
sun
.
tools
.
classfile
.
TypeAnnotation
.
TargetType
.*;
/*
* @test
* @bug 8026791
* @summary Test population of reference info for constructor results
* @compile -g Driver.java ReferenceInfoUtil.java Constructors.java
* @run main Driver Constructors
*/
import
static
com
.
sun
.
tools
.
classfile
.
TypeAnnotation
.
TargetType
.*;
public
class
Constructors
{
@TADescriptions
({
...
...
@@ -42,8 +44,8 @@ public class Constructors {
}
@TADescriptions
({
@TADescription
(
annotation
=
"TA"
,
type
=
METHOD_RETURN
),
@TADescription
(
annotation
=
"TB"
,
type
=
METHOD_RETURN
),
@TADescription
(
annotation
=
"TA"
,
type
=
METHOD_RETURN
,
genericLocation
=
{
1
,
0
}
),
@TADescription
(
annotation
=
"TB"
,
type
=
METHOD_RETURN
,
genericLocation
=
{
1
,
0
}
),
@TADescription
(
annotation
=
"TC"
,
type
=
METHOD_FORMAL_PARAMETER
,
paramIndex
=
0
)
})
@TestClass
(
"Test$Inner"
)
...
...
@@ -56,9 +58,9 @@ public class Constructors {
@TADescriptions
({
@TADescription
(
annotation
=
"TA"
,
type
=
METHOD_RECEIVER
),
@TADescription
(
annotation
=
"TB"
,
type
=
METHOD_RETURN
),
@TADescription
(
annotation
=
"TB"
,
type
=
METHOD_RETURN
,
genericLocation
=
{
1
,
0
}
),
@TADescription
(
annotation
=
"TC"
,
type
=
METHOD_RECEIVER
),
@TADescription
(
annotation
=
"TD"
,
type
=
METHOD_RETURN
),
@TADescription
(
annotation
=
"TD"
,
type
=
METHOD_RETURN
,
genericLocation
=
{
1
,
0
}
),
@TADescription
(
annotation
=
"TE"
,
type
=
METHOD_FORMAL_PARAMETER
,
paramIndex
=
0
)
})
@TestClass
(
"Test$Inner"
)
...
...
@@ -72,9 +74,9 @@ public class Constructors {
@TADescriptions
({
@TADescription
(
annotation
=
"TA"
,
type
=
METHOD_RECEIVER
),
@TADescription
(
annotation
=
"TB"
,
type
=
METHOD_RECEIVER
,
genericLocation
=
{
1
,
0
}),
@TADescription
(
annotation
=
"TC"
,
type
=
METHOD_RETURN
),
@TADescription
(
annotation
=
"TC"
,
type
=
METHOD_RETURN
,
genericLocation
=
{
1
,
0
,
1
,
0
}
),
@TADescription
(
annotation
=
"TD"
,
type
=
METHOD_RECEIVER
,
genericLocation
=
{
1
,
0
}),
@TADescription
(
annotation
=
"TE"
,
type
=
METHOD_RETURN
),
@TADescription
(
annotation
=
"TE"
,
type
=
METHOD_RETURN
,
genericLocation
=
{
1
,
0
,
1
,
0
}
),
@TADescription
(
annotation
=
"TF"
,
type
=
METHOD_FORMAL_PARAMETER
,
paramIndex
=
0
)
})
@TestClass
(
"Outer$Middle$Inner"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录