Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
1ea6c13b
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看板
提交
1ea6c13b
编写于
10月 31, 2012
作者:
K
ksrini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8001112: Make -target 8 in javac generate version 52.0 classfile
Reviewed-by: darcy, jjg
上级
10f923ad
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
42 addition
and
35 deletion
+42
-35
src/share/classes/com/sun/tools/javac/jvm/Target.java
src/share/classes/com/sun/tools/javac/jvm/Target.java
+3
-3
test/tools/javac/classfiles/ClassVersionChecker.java
test/tools/javac/classfiles/ClassVersionChecker.java
+9
-9
test/tools/javac/versions/check.sh
test/tools/javac/versions/check.sh
+30
-23
未找到文件。
src/share/classes/com/sun/tools/javac/jvm/Target.java
浏览文件 @
1ea6c13b
/*
* Copyright (c) 2002, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
2
, 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
...
...
@@ -68,8 +68,8 @@ public enum Target {
/** JDK 7. */
JDK1_7
(
"1.7"
,
51
,
0
),
/** JDK 8. */
// For now, a clone of 7
JDK1_8
(
"1.8"
,
5
1
,
0
);
/** JDK 8. */
JDK1_8
(
"1.8"
,
5
2
,
0
);
private
static
final
Context
.
Key
<
Target
>
targetKey
=
new
Context
.
Key
<
Target
>();
...
...
test/tools/javac/classfiles/ClassVersionChecker.java
浏览文件 @
1ea6c13b
...
...
@@ -23,7 +23,7 @@
/*
* @test
* @bug 7157626
* @bug 7157626
8001112
* @summary Test major version for all legal combinations for -source and -target
* @author sgoel
*
...
...
@@ -57,14 +57,14 @@ public class ClassVersionChecker {
* -1 => invalid combinations
*/
int
[][]
ver
=
{{
5
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
},
{
48
,
46
,
47
,
48
,
49
,
50
,
51
,
5
1
},
{
48
,
46
,
47
,
48
,
49
,
50
,
51
,
5
1
},
{
48
,
-
1
,
-
1
,
48
,
49
,
50
,
51
,
5
1
},
{
5
1
,
-
1
,
-
1
,
-
1
,
49
,
50
,
51
,
51
},
{
5
1
,
-
1
,
-
1
,
-
1
,
-
1
,
50
,
51
,
51
},
{
5
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
51
,
51
},
{
5
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
51
}};
{{
5
2
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
},
{
48
,
46
,
47
,
48
,
49
,
50
,
51
,
5
2
},
{
48
,
46
,
47
,
48
,
49
,
50
,
51
,
5
2
},
{
48
,
-
1
,
-
1
,
48
,
49
,
50
,
51
,
5
2
},
{
5
2
,
-
1
,
-
1
,
-
1
,
49
,
50
,
51
,
52
},
{
5
2
,
-
1
,
-
1
,
-
1
,
-
1
,
50
,
51
,
52
},
{
5
2
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
51
,
52
},
{
5
2
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
52
}};
// Loop to run all possible combinations of source/target values
for
(
int
i
=
0
;
i
<
ver
.
length
;
i
++)
{
...
...
test/tools/javac/versions/check.sh
浏览文件 @
1ea6c13b
#
# Copyright (c) 2004, 201
1
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 201
2
, 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
...
...
@@ -22,7 +22,7 @@
#
# @test
# @bug 4981566 5028634 5094412 6304984 7025786 7025789
# @bug 4981566 5028634 5094412 6304984 7025786 7025789
8001112
# @summary Check interpretation of -target and -source options
# @build CheckClassFileVersion
# @run shell check.sh
...
...
@@ -47,32 +47,39 @@ check() {
"
$JC
"
${
TESTTOOLVMOPTS
}
-d
$TC
$*
$TC
/X.java
&&
"
$J
"
$CFV
$TC
/X.class
$V
||
exit
2
}
# check for all combinations of target values
check_target
()
{
check
$1
-source
$2
-target
$3
check
$1
-source
$2
-target
1.
${
3
}
}
# check for all combinations of source and target values
check_source_target
()
{
check_target
$1
$2
$3
check_target
$1
1.
${
2
}
$3
}
check 48.0
-source
1.4
check 49.0
-source
1.4
-target
1.5
check 49.0
-source
1.5
-target
1.5
check 50.0
-source
1.4
-target
1.6
check 50.0
-source
1.5
-target
1.6
check 50.0
-source
1.6
-target
1.6
check 50.0
-source
1.6
-target
6
check 50.0
-source
6
-target
1.6
check 50.0
-source
6
-target
6
check 51.0
check 51.0
-source
1.5
check 51.0
-source
1.6
check 51.0
-source
6
check 51.0
-source
1.7
check 51.0
-source
7
check 51.0
-source
7
-target
1.7
check 51.0
-source
7
-target
7
# Update when class file version is revved
check 51.0
-source
1.8
check 51.0
-source
8
check 51.0
-target
1.8
check 51.0
-target
8
check_target 50.0 1.4 6
check_target 50.0 1.5 6
check_source_target 50.0 6 6
check_target 51.0 1.4 7
check_target 51.0 1.5 7
check_source_target 51.0 6 7
check_source_target 51.0 7 7
check_target 52.0 1.4 8
check_target 52.0 1.5 8
check_source_target 52.0 6 8
check_source_target 52.0 7 8
check_source_target 52.0 8 8
# and finally the default with no options
check 52.0
# Check source versions
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录