Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
4465f285
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看板
提交
4465f285
编写于
3月 09, 2012
作者:
M
mcimadamore
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7151802: compiler update caused sqe test failed
Summary: Fix regression caused by 7144506 Reviewed-by: jjg, dlsmith
上级
703816f5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
65 addition
and
13 deletion
+65
-13
src/share/classes/com/sun/tools/javac/comp/Attr.java
src/share/classes/com/sun/tools/javac/comp/Attr.java
+4
-2
src/share/classes/com/sun/tools/javac/comp/Check.java
src/share/classes/com/sun/tools/javac/comp/Check.java
+3
-5
src/share/classes/com/sun/tools/javac/comp/Infer.java
src/share/classes/com/sun/tools/javac/comp/Infer.java
+2
-2
test/tools/javac/6758789/T6758789b.out
test/tools/javac/6758789/T6758789b.out
+1
-1
test/tools/javac/generics/7015430/T7015430.out
test/tools/javac/generics/7015430/T7015430.out
+3
-3
test/tools/javac/generics/7151802/T7151802.java
test/tools/javac/generics/7151802/T7151802.java
+43
-0
test/tools/javac/generics/7151802/T7151802.out
test/tools/javac/generics/7151802/T7151802.out
+9
-0
未找到文件。
src/share/classes/com/sun/tools/javac/comp/Attr.java
浏览文件 @
4465f285
...
...
@@ -2725,6 +2725,8 @@ public class Attr extends JCTree.Visitor {
useVarargs
,
noteWarner
);
boolean
unchecked
=
noteWarner
.
hasNonSilentLint
(
LintCategory
.
UNCHECKED
);
// If this fails, something went wrong; we should not have
// found the identifier in the first place.
if
(
owntype
==
null
)
{
...
...
@@ -2735,10 +2737,10 @@ public class Attr extends JCTree.Visitor {
Type
.
toString
(
pt
().
getParameterTypes
()));
owntype
=
types
.
createErrorType
(
site
);
return
types
.
createErrorType
(
site
);
}
else
if
(
owntype
.
getReturnType
().
tag
==
FORALL
)
{
}
else
if
(
owntype
.
getReturnType
().
tag
==
FORALL
&&
!
unchecked
)
{
return
owntype
;
}
else
{
return
chk
.
checkMethod
(
owntype
,
sym
,
env
,
argtrees
,
argtypes
,
useVarargs
);
return
chk
.
checkMethod
(
owntype
,
sym
,
env
,
argtrees
,
argtypes
,
useVarargs
,
unchecked
);
}
}
...
...
src/share/classes/com/sun/tools/javac/comp/Check.java
浏览文件 @
4465f285
...
...
@@ -755,8 +755,8 @@ public class Check {
Env
<
AttrContext
>
env
,
final
List
<
JCExpression
>
argtrees
,
List
<
Type
>
argtypes
,
boolean
useVarargs
)
{
boolean
warned
=
false
;
boolean
useVarargs
,
boolean
unchecked
)
{
// System.out.println("call : " + env.tree);
// System.out.println("method : " + owntype);
// System.out.println("actuals: " + argtypes);
...
...
@@ -770,7 +770,6 @@ public class Check {
JCTree
arg
=
args
.
head
;
Warner
warn
=
convertWarner
(
arg
.
pos
(),
arg
.
type
,
formals
.
head
);
assertConvertible
(
arg
,
arg
.
type
,
formals
.
head
,
warn
);
warned
|=
warn
.
hasNonSilentLint
(
LintCategory
.
UNCHECKED
);
args
=
args
.
tail
;
formals
=
formals
.
tail
;
}
...
...
@@ -780,7 +779,6 @@ public class Check {
JCTree
arg
=
args
.
head
;
Warner
warn
=
convertWarner
(
arg
.
pos
(),
arg
.
type
,
varArg
);
assertConvertible
(
arg
,
arg
.
type
,
varArg
,
warn
);
warned
|=
warn
.
hasNonSilentLint
(
LintCategory
.
UNCHECKED
);
args
=
args
.
tail
;
}
}
else
if
((
sym
.
flags
()
&
VARARGS
)
!=
0
&&
allowVarargs
)
{
...
...
@@ -792,7 +790,7 @@ public class Check {
log
.
warning
(
argtrees
.
last
().
pos
(),
"inexact.non-varargs.call"
,
types
.
elemtype
(
varParam
),
varParam
);
}
if
(
warn
ed
)
{
if
(
uncheck
ed
)
{
warnUnchecked
(
env
.
tree
.
pos
(),
"unchecked.meth.invocation.applied"
,
kindName
(
sym
),
...
...
src/share/classes/com/sun/tools/javac/comp/Infer.java
浏览文件 @
4465f285
...
...
@@ -385,7 +385,6 @@ public class Infer {
final
Warner
warn
)
throws
InferenceException
{
//-System.err.println("instantiateMethod(" + tvars + ", " + mt + ", " + argtypes + ")"); //DEBUG
List
<
Type
>
undetvars
=
Type
.
map
(
tvars
,
fromTypeVarFun
);
//final List<Type> capturedArgs = types.capture(argtypes);
final
List
<
Type
>
capturedArgs
=
rs
.
checkRawArgumentsAcceptable
(
env
,
undetvars
,
argtypes
,
mt
.
getParameterTypes
(),
...
...
@@ -451,11 +450,12 @@ public class Infer {
types
.
subst
(
getThrownTypes
(),
tvars
,
inferred
),
qtype
.
tsym
);
// check that actuals conform to inferred formals
warn
.
clear
();
checkArgumentsAcceptable
(
env
,
capturedArgs
,
owntype
.
getParameterTypes
(),
allowBoxing
,
useVarargs
,
warn
);
// check that inferred bounds conform to their bounds
checkWithinBounds
(
all_tvars
,
types
.
subst
(
inferredTypes
,
tvars
,
inferred
),
warn
);
qtype
=
chk
.
checkMethod
(
owntype
,
msym
,
env
,
TreeInfo
.
args
(
env
.
tree
),
capturedArgs
,
useVarargs
);
qtype
=
chk
.
checkMethod
(
owntype
,
msym
,
env
,
TreeInfo
.
args
(
env
.
tree
),
capturedArgs
,
useVarargs
,
warn
.
hasNonSilentLint
(
Lint
.
LintCategory
.
UNCHECKED
)
);
}
};
}
...
...
test/tools/javac/6758789/T6758789b.out
浏览文件 @
4465f285
T6758789b.java:16:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo<
java.lang.Object
>
T6758789b.java:16:11: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T6758789a.Foo, T6758789a.Foo<
X
>
T6758789b.java:16:10: compiler.warn.unchecked.meth.invocation.applied: kindname.method, m, T6758789a.Foo<X>, T6758789a.Foo, kindname.class, T6758789a
- compiler.err.warnings.and.werror
1 error
...
...
test/tools/javac/generics/7015430/T7015430.out
浏览文件 @
4465f285
T7015430.java:41:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<
java.lang.Exception
>
T7015430.java:41:15: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<
E
>
T7015430.java:41:14: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
T7015430.java:50:42: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
T7015430.java:50:41: compiler.warn.unchecked.meth.invocation.applied: kindname.method, empty, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
T7015430.java:68:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<
java.lang.Exception
>
T7015430.java:68:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<
E
>
T7015430.java:68:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
T7015430.java:77:40: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
T7015430.java:77:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
T7015430.java:104:41: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<java.lang.RuntimeException>
T7015430.java:104:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
T7015430.java:113:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<
java.lang.Exception
>
T7015430.java:113:22: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), java.lang.Iterable, java.lang.Iterable<
E
>
T7015430.java:113:9: compiler.warn.unchecked.meth.invocation.applied: kindname.constructor, <init>, java.lang.Iterable<E>, java.lang.Iterable, kindname.class, T7015430
T7015430.java:41:14: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
T7015430.java:68:9: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception
...
...
test/tools/javac/generics/7151802/T7151802.java
0 → 100644
浏览文件 @
4465f285
/*
* @test /nodynamiccopyright/
* @bug 7151802
* @summary compiler update caused sqe test failed
* @compile/fail/ref=T7151802.out -Werror -Xlint:unchecked -XDrawDiagnostics T7151802.java
*/
class
T7151802
{
static
class
Foo
<
X
>
{
}
static
class
SubFoo
<
X
>
extends
Foo
<
X
>
{
}
//generic - bound - arg - non-slilent
<
Z
extends
Foo
<
String
>>
void
get1
(
Z
fz
)
{
}
void
test1
(
Foo
foo
)
{
get1
(
foo
);
}
//generic - bound - arg - silent
<
Z
extends
Foo
<?>>
void
get2
(
Z
fz
)
{
}
void
test2
(
Foo
foo
)
{
get2
(
foo
);
}
//generic - nobound - arg - non-slilent
<
Z
>
void
get3
(
Foo
<
Z
>
fz
)
{
}
void
test
(
Foo
foo
)
{
get3
(
foo
);
}
//generic - nobound - arg - slilent
<
Z
>
void
get4
(
Foo
<?>
fz
)
{
}
void
test4
(
Foo
foo
)
{
get4
(
foo
);
}
//generic - bound - ret - non-slilent
<
Z
extends
Foo
<
String
>>
Z
get5
()
{
return
null
;
}
void
test5
()
{
SubFoo
sf
=
get5
();
}
//generic - bound - ret - slilent
static
<
Z
extends
Foo
<?>>
Z
get6
()
{
return
null
;
}
void
test6
()
{
SubFoo
sf
=
get6
();
}
//nogeneric - nobound - arg - non-slilent
void
get7
(
Foo
<
String
>
fz
)
{
}
void
test7
(
Foo
foo
)
{
get7
(
foo
);
}
//nogeneric - nobound - arg - slilent
static
void
get8
(
Foo
<?>
fz
)
{
}
void
test8
(
Foo
foo
)
{
get8
(
foo
);
}
}
test/tools/javac/generics/7151802/T7151802.out
0 → 100644
浏览文件 @
4465f285
T7151802.java:14:31: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get1, Z, T7151802.Foo, kindname.class, T7151802
T7151802.java:22:31: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo<Z>
T7151802.java:22:30: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get3, T7151802.Foo<Z>, T7151802.Foo, kindname.class, T7151802
T7151802.java:30:36: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get5, compiler.misc.no.args, compiler.misc.no.args, kindname.class, T7151802
T7151802.java:38:32: compiler.warn.prob.found.req: (compiler.misc.unchecked.assign), T7151802.Foo, T7151802.Foo<java.lang.String>
T7151802.java:38:31: compiler.warn.unchecked.meth.invocation.applied: kindname.method, get7, T7151802.Foo<java.lang.String>, T7151802.Foo, kindname.class, T7151802
- compiler.err.warnings.and.werror
1 error
6 warnings
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录